Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c500face92 | |||
| 37f4bd4185 | |||
| 808ae831bf | |||
| 6df7a3f6a8 | |||
| ed33c0553d | |||
| 23b73a387b |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*~
|
||||||
|
tpl_c/*.php
|
||||||
|
config.php
|
||||||
47
about.php
47
about.php
@@ -1,43 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("about.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup page
|
|
||||||
// set vars
|
|
||||||
$smarty->assign("config_version", $config_version);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("about.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
87
asset.php
87
asset.php
@@ -1,38 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// create letter links
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// create letter links
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
|
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
|
||||||
FROM
|
FROM
|
||||||
asset
|
asset
|
||||||
@@ -41,44 +22,34 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
asset_letter";
|
asset_letter";
|
||||||
|
|
||||||
// run query
|
$alphabet = $db->db_select($query);
|
||||||
$alphabet = $db->db_select($query);
|
$smarty->assign("alphabet", $alphabet);
|
||||||
$smarty->assign("alphabet", $alphabet);
|
|
||||||
|
|
||||||
// setup asset
|
// setup current letter
|
||||||
// setup current letter
|
if(isset($_GET['asset_letter'])) {
|
||||||
if(isset($_GET['asset_letter'])) {
|
|
||||||
$asset_letter = sanitize($_GET['asset_letter']);
|
$asset_letter = sanitize($_GET['asset_letter']);
|
||||||
} else {
|
} else {
|
||||||
$asset_letter = $alphabet[0]['asset_letter'];
|
$asset_letter = $alphabet[0]['asset_letter'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
a.asset_id,
|
||||||
asset.asset_id AS asset_id,
|
IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name,
|
||||||
IF(LENGTH(asset.asset_name)>0, asset.asset_name, '...') AS asset_name,
|
a.asset_info,
|
||||||
asset.asset_info AS asset_info,
|
c.assetclass_id,
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
c.assetclass_name
|
||||||
assetclass.assetclass_name AS assetclass_name
|
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
|
||||||
assetclass
|
|
||||||
WHERE
|
WHERE
|
||||||
SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "'
|
SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "'
|
||||||
AND assetclass.assetclass_id=asset.assetclass_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
asset.asset_name";
|
a.asset_name";
|
||||||
|
|
||||||
// run query
|
$assets = $db->db_select($query);
|
||||||
$assets = $db->db_select($query);
|
|
||||||
|
|
||||||
// counter to tpl
|
$smarty->assign("assets", $assets);
|
||||||
$smarty->assign("assets", $assets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("asset.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("asset.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
68
assetadd.php
68
assetadd.php
@@ -1,59 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = "");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
assetclass_id,
|
||||||
include("includes.php");
|
assetclass_name
|
||||||
|
FROM
|
||||||
// get id
|
|
||||||
if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = "");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name
|
|
||||||
FROM
|
|
||||||
assetclass
|
assetclass
|
||||||
ORDER BY
|
ORDER BY
|
||||||
assetclass.assetclass_name";
|
assetclass_name";
|
||||||
|
|
||||||
// run query
|
$assetclasses = $db->db_select($query);
|
||||||
$assetclasses = $db->db_select($query);
|
foreach ($assetclasses as $assetclass) {
|
||||||
foreach ($assetclasses as $assetclass) {
|
|
||||||
$assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name'];
|
$assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("assetclass_options", $assetclass_options);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("assetclass_options", $assetclass_options);
|
||||||
// output
|
$smarty->display("assetadd.tpl");
|
||||||
$smarty->display("assetadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,61 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$query = "SELECT
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
a.assetclass_id,
|
||||||
|
a.assetclass_name,
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
g.assetclassgroup_id,
|
||||||
or contact me at wietsew@users.sourceforge.net
|
g.assetclassgroup_name,
|
||||||
*****************************************************************************/
|
g.assetclassgroup_color
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name,
|
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
|
|
||||||
FROM
|
FROM
|
||||||
assetclass,
|
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
|
||||||
assetclassgroup
|
|
||||||
WHERE
|
|
||||||
assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
assetclass.assetclass_name";
|
a.assetclass_name";
|
||||||
|
|
||||||
// run query
|
$assetclasses = $db->db_select($query);
|
||||||
$assetclasses = $db->db_select($query);
|
|
||||||
|
|
||||||
// counter to tpl
|
$smarty->assign("assetclasses", $assetclasses);
|
||||||
$smarty->assign("assetclasses", $assetclasses);
|
$smarty->display("assetclass.tpl");
|
||||||
|
|
||||||
|
include("footer.php");
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("assetclass.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,45 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = "");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
|
||||||
// includes
|
$smarty->display("assetclassadd.tpl");
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
include("footer.php");
|
||||||
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = "");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("assetclassadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,59 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclass_id = sanitize($_GET['assetclass_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
assetclass_id,
|
||||||
include("includes.php");
|
assetclass_name
|
||||||
|
|
||||||
// get id
|
|
||||||
$assetclass_id = sanitize($_GET['assetclass_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name
|
|
||||||
FROM
|
FROM
|
||||||
assetclass
|
assetclass
|
||||||
WHERE
|
WHERE
|
||||||
assetclass.assetclass_id=" . $assetclass_id;
|
assetclass_id=" . $assetclass_id;
|
||||||
|
|
||||||
// run query
|
$assetclass = $db->db_select($query);
|
||||||
$assetclass = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,65 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclass_id = sanitize($_GET['assetclass_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
include("header.php");
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$query = "SELECT
|
||||||
or contact me at wietsew@users.sourceforge.net
|
assetclass_id,
|
||||||
*****************************************************************************/
|
assetclass_name,
|
||||||
|
assetclassgroup_id
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$assetclass_id = sanitize($_GET['assetclass_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name,
|
|
||||||
assetclass.assetclassgroup_id AS assetclassgroup_id
|
|
||||||
FROM
|
FROM
|
||||||
assetclass
|
assetclass
|
||||||
WHERE
|
WHERE
|
||||||
assetclass.assetclass_id=" . $assetclass_id;
|
assetclass_id=" . $assetclass_id;
|
||||||
|
|
||||||
// run query
|
$assetclass = $db->db_select($query);
|
||||||
$assetclass = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
|
||||||
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
|
||||||
// build query
|
|
||||||
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,54 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$query = "SELECT
|
||||||
or contact me at wietsew@users.sourceforge.net
|
assetclassgroup_id,
|
||||||
*****************************************************************************/
|
assetclassgroup_name,
|
||||||
|
assetclassgroup_color
|
||||||
// start page
|
FROM
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
|
|
||||||
assetclassgroup.assetclassgroup_color AS assetclassgroup_color
|
|
||||||
FROM
|
|
||||||
assetclassgroup
|
assetclassgroup
|
||||||
ORDER BY
|
ORDER BY
|
||||||
assetclassgroup.assetclassgroup_name";
|
assetclassgroup_name";
|
||||||
|
|
||||||
// run query
|
$assetclassgroups = $db->db_select($query);
|
||||||
$assetclassgroups = $db->db_select($query);
|
|
||||||
$smarty->assign("assetclassgroups", $assetclassgroups);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("assetclassgroups", $assetclassgroups);
|
||||||
// output
|
$smarty->display("assetclassgroup.tpl");
|
||||||
$smarty->display("assetclassgroup.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("assetclassgroupadd.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("assetclassgroupadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,59 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$smarty->assign($lang);
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
$query = "SELECT
|
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
assetclassgroup_id,
|
||||||
|
assetclassgroup_name
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
|
|
||||||
FROM
|
FROM
|
||||||
assetclassgroup
|
assetclassgroup
|
||||||
WHERE
|
WHERE
|
||||||
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
|
assetclassgroup_id=" . $assetclassgroup_id;
|
||||||
|
|
||||||
// run query
|
$assetclassgroup = $db->db_select($query);
|
||||||
$assetclassgroup = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassgroupdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassgroupdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,62 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$smarty->assign("scripts", 'jscolor.js');
|
||||||
or contact me at wietsew@users.sourceforge.net
|
include("header.php");
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$smarty->assign($lang);
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
$query = "SELECT
|
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
assetclassgroup_id,
|
||||||
|
assetclassgroup_name,
|
||||||
// start output
|
assetclassgroup_color
|
||||||
$smarty->assign("scripts", 'jscolor.js');
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
|
|
||||||
assetclassgroup.assetclassgroup_color AS assetclassgroup_color
|
|
||||||
FROM
|
FROM
|
||||||
assetclassgroup
|
assetclassgroup
|
||||||
WHERE
|
WHERE
|
||||||
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
|
assetclassgroup_id=" . $assetclassgroup_id;
|
||||||
|
|
||||||
// run query
|
$assetclassgroup = $db->db_select($query);
|
||||||
$assetclassgroup = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
|
||||||
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassgroupedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassgroupedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,77 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
assetclassgroup_id,
|
||||||
include("includes.php");
|
assetclassgroup_name,
|
||||||
|
assetclassgroup_color
|
||||||
// get id
|
|
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
|
|
||||||
assetclassgroup.assetclassgroup_color AS assetclassgroup_color
|
|
||||||
FROM
|
FROM
|
||||||
assetclassgroup
|
assetclassgroup
|
||||||
WHERE
|
WHERE
|
||||||
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
|
assetclassgroup_id=" . $assetclassgroup_id;
|
||||||
|
|
||||||
// run query
|
$assetclassgroup = $db->db_select($query);
|
||||||
$assetclassgroup = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
|
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
|
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
|
||||||
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
|
|
||||||
|
|
||||||
// setup assetclass
|
$query = "SELECT
|
||||||
// build query
|
assetclass_id,
|
||||||
$query = "SELECT
|
assetclass_name
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name
|
|
||||||
FROM
|
FROM
|
||||||
assetclass
|
assetclass
|
||||||
WHERE
|
WHERE
|
||||||
assetclass.assetclassgroup_id=" . $assetclassgroup_id . "
|
assetclassgroup_id=" . $assetclassgroup_id . "
|
||||||
ORDER BY
|
ORDER BY
|
||||||
assetclass.assetclass_name";
|
assetclass_name";
|
||||||
|
|
||||||
// run query
|
$assetclasses = $db->db_select($query);
|
||||||
$assetclasses = $db->db_select($query);
|
$smarty->assign("assetclasses", $assetclasses);
|
||||||
$smarty->assign("assetclasses", $assetclasses);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassgroupview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassgroupview.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,67 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$assetclass_id = sanitize($_GET['assetclass_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$assetclass_id = sanitize($_GET['assetclass_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
assetclass.assetclass_id,
|
a.assetclass_id, a.assetclass_name,
|
||||||
assetclass.assetclass_name,
|
g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
|
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
|
|
||||||
FROM
|
FROM
|
||||||
assetclass,
|
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
|
||||||
assetclassgroup
|
|
||||||
WHERE
|
WHERE
|
||||||
assetclass.assetclass_id=" . $assetclass_id . "
|
a.assetclass_id=" . $assetclass_id;
|
||||||
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
|
|
||||||
|
|
||||||
// run query
|
$assetclass = $db->db_select($query);
|
||||||
$assetclass = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
|
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
|
$smarty->assign("assetclass_selected", "");
|
||||||
$smarty->assign("assetclass_selected", "");
|
|
||||||
|
|
||||||
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
|
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
|
||||||
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
|
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
|
||||||
|
$smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']);
|
||||||
|
|
||||||
// send to tpl
|
$query = "SELECT
|
||||||
// setup asset
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset_id,
|
asset_id,
|
||||||
asset_name,
|
asset_name,
|
||||||
CONCAT(LEFT(asset_info, 80), IF(CHAR_LENGTH(asset_info)>80,'...','')) AS asset_info
|
CONCAT(LEFT(asset_info, 80), IF(CHAR_LENGTH(asset_info)>80,'...','')) AS asset_info
|
||||||
@@ -72,14 +42,10 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
asset_name";
|
asset_name";
|
||||||
|
|
||||||
// run query
|
$assets = $db->db_select($query);
|
||||||
$assets = $db->db_select($query);
|
$smarty->assign("assets", $assets);
|
||||||
$smarty->assign("assets", $assets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetclassview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetclassview.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
78
assetdel.php
78
assetdel.php
@@ -1,74 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$asset_id = sanitize($_GET['asset_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
asset_name
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$asset_id = sanitize($_GET['asset_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup asset
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_name AS asset_name
|
|
||||||
FROM
|
FROM
|
||||||
asset
|
asset
|
||||||
WHERE
|
WHERE
|
||||||
asset.asset_id=" . $asset_id;
|
asset_id=" . $asset_id;
|
||||||
|
|
||||||
// run query
|
$asset = $db->db_select($query);
|
||||||
$asset = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("asset_id", $asset_id);
|
||||||
$smarty->assign("asset_id", $asset_id);
|
$smarty->assign("asset_name", $asset[0]['asset_name']);
|
||||||
$smarty->assign("asset_name", $asset[0]['asset_name']);
|
|
||||||
|
|
||||||
// setup node
|
$query = "SELECT
|
||||||
// build query
|
node_id,
|
||||||
$query = "SELECT
|
node_ip
|
||||||
node.node_id AS node_id,
|
|
||||||
node.node_ip AS node_ip
|
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.asset_id=" . $asset_id . "
|
asset_id=" . $asset_id . "
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
$smarty->assign("nodes", $nodes);
|
||||||
$smarty->assign("nodes", $nodes);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetdel.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,62 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$asset_id = sanitize($_GET['asset_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$asset_id = sanitize($_GET['asset_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup asset
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset_id,
|
asset_id,
|
||||||
asset.asset_name AS asset_name,
|
asset_name,
|
||||||
asset.asset_hostname AS asset_hostname,
|
asset_hostname,
|
||||||
asset.asset_info AS asset_info,
|
asset_info,
|
||||||
asset.assetclass_id AS assetclass_id
|
assetclass_id
|
||||||
FROM
|
FROM
|
||||||
asset
|
asset
|
||||||
WHERE
|
WHERE
|
||||||
asset.asset_id=" . $asset_id;
|
asset_id=" . $asset_id;
|
||||||
|
|
||||||
// run query
|
$asset = $db->db_select($query);
|
||||||
$asset = $db->db_select($query);
|
$smarty->assign("asset", $asset[0]);
|
||||||
$smarty->assign("asset", $asset[0]);
|
|
||||||
|
|
||||||
// setup assetclass
|
$smarty->assign("assetclass_options", $db->options_assetclass());
|
||||||
$smarty->assign("assetclass_options", $db->options_assetclass());
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetedit.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,86 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$asset_id = sanitize($_GET['asset_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
a.asset_name,
|
||||||
include("includes.php");
|
a.asset_hostname,
|
||||||
|
a.asset_info,
|
||||||
// get id
|
c.assetclass_id,
|
||||||
$asset_id = sanitize($_GET['asset_id']);
|
c.assetclass_name
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup asset
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_name,
|
|
||||||
asset.asset_hostname,
|
|
||||||
asset.asset_info,
|
|
||||||
assetclass.assetclass_id AS assetclass_id,
|
|
||||||
assetclass.assetclass_name AS assetclass_name
|
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
|
||||||
assetclass
|
|
||||||
WHERE
|
WHERE
|
||||||
asset.asset_id=" . $asset_id . "
|
a.asset_id=" . $asset_id;
|
||||||
AND assetclass.assetclass_id=asset.assetclass_id";
|
|
||||||
|
|
||||||
// run query
|
$asset = $db->db_select($query);
|
||||||
$asset = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("asset_id", $asset_id);
|
||||||
$smarty->assign("asset_id", $asset_id);
|
$smarty->assign("asset_name", $asset[0]['asset_name']);
|
||||||
$smarty->assign("asset_name", $asset[0]['asset_name']);
|
$smarty->assign("asset_hostname", $asset[0]['asset_hostname']);
|
||||||
$smarty->assign("asset_hostname", $asset[0]['asset_hostname']);
|
$smarty->assign("asset_info", nl2br($asset[0]['asset_info']));
|
||||||
$smarty->assign("asset_info", nl2br($asset[0]['asset_info']));
|
|
||||||
|
|
||||||
$smarty->assign("assetclass_id", $asset[0]['assetclass_id']);
|
$smarty->assign("assetclass_id", $asset[0]['assetclass_id']);
|
||||||
$smarty->assign("assetclass_name", $asset[0]['assetclass_name']);
|
$smarty->assign("assetclass_name", $asset[0]['assetclass_name']);
|
||||||
|
|
||||||
// setup node
|
$query = "SELECT
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
node_id,
|
node_id,
|
||||||
node_ip,
|
node_ip,
|
||||||
LEFT(node_info, 40) as node_info
|
LEFT(node_info, 40) as node_info
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.asset_id=" . $asset_id . "
|
asset_id=" . $asset_id . "
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
$smarty->assign("nodes", $nodes);
|
||||||
$smarty->assign("nodes", $nodes);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assetview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assetview.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,61 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_ip = sanitize($_GET['node_ip']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
subnet_address,
|
||||||
include("includes.php");
|
subnet_mask
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$node_ip = sanitize($_GET['node_ip']);
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("node_ip", $node_ip);
|
||||||
$smarty->assign("node_ip", $node_ip);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("assigniptonode.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assigniptonode.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,79 +1,49 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$asset_id = sanitize($_GET['asset_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
$node_ip = sanitize($_GET['node_ip']);
|
||||||
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$smarty->assign("node_ip", $node_ip);
|
||||||
// includes
|
$smarty->assign("asset_id", $asset_id);
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
$query = "SELECT
|
||||||
$asset_id = sanitize($_GET['asset_id']);
|
asset_id,
|
||||||
$node_ip = sanitize($_GET['node_ip']);
|
asset_name
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// to tpl
|
|
||||||
$smarty->assign("node_ip", $node_ip);
|
|
||||||
|
|
||||||
// setup asset
|
|
||||||
$smarty->assign("asset_id", $asset_id);
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_id AS asset_id,
|
|
||||||
asset.asset_name AS asset_name
|
|
||||||
FROM
|
FROM
|
||||||
asset
|
asset
|
||||||
ORDER BY
|
ORDER BY
|
||||||
asset.asset_name";
|
asset_name";
|
||||||
|
|
||||||
// run query
|
$assets = $db->db_select($query);
|
||||||
$assets = $db->db_select($query);
|
foreach ($assets as $asset) {
|
||||||
foreach ($assets as $asset) {
|
|
||||||
$asset_options[$asset['asset_id']] = $asset['asset_name'];
|
$asset_options[$asset['asset_id']] = $asset['asset_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("asset_options", $asset_options);
|
$smarty->assign("asset_options", $asset_options);
|
||||||
|
|
||||||
// setup subnet
|
$query = "SELECT subnet_id,
|
||||||
// build query
|
|
||||||
$query = "SELECT subnet_id,
|
|
||||||
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
|
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
|
||||||
FROM subnet
|
FROM subnet
|
||||||
ORDER BY INET_ATON(subnet_address)";
|
ORDER BY INET_ATON(subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
foreach ($subnets as $subnet) {
|
||||||
foreach ($subnets as $subnet) {
|
|
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_name'];
|
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("subnet_options", $subnet_options);
|
$smarty->assign("subnet_options", $subnet_options);
|
||||||
|
|
||||||
// end page
|
$smarty->display("assignnodetoasset.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("assignnodetoasset.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
44
comments.php
44
comments.php
@@ -1,42 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// includes
|
$comments = sanitize($_GET['comments']);
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
$smarty->assign("comments", $lang['lang_comments_' . $comments]);
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
$smarty->display("comments.tpl");
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// get error
|
include("footer.php");
|
||||||
$comments = sanitize($_GET['comments']);
|
|
||||||
|
|
||||||
// set veriables
|
|
||||||
$smarty->assign("comments", $lang['lang_comments_' . $comments]);
|
|
||||||
|
|
||||||
// output
|
|
||||||
$smarty->display("comments.tpl");
|
|
||||||
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
41
config.php
41
config.php
@@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*****************************************************************************
|
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// version
|
|
||||||
$config_version = 'v0.7';
|
|
||||||
|
|
||||||
// db connection
|
|
||||||
$config_mysql_host = 'localhost';
|
|
||||||
$config_mysql_username = 'ipreg';
|
|
||||||
$config_mysql_password = 'changeme!';
|
|
||||||
$config_mysql_dbname = 'ipreg';
|
|
||||||
|
|
||||||
// default values for IP blocks
|
|
||||||
$config_color_blocked = 'dcdcdc';
|
|
||||||
$config_color_unused = 'ffffff';
|
|
||||||
$config_color_dynamic = 'e0e0e0';
|
|
||||||
|
|
||||||
// language
|
|
||||||
$config_lang = array('de', 'en');
|
|
||||||
$config_lang_default = 'en';
|
|
||||||
|
|
||||||
?>
|
|
||||||
24
config.php-sample
Normal file
24
config.php-sample
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/*****************************************************************************
|
||||||
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
// db connection
|
||||||
|
$config_mysql_host = 'localhost';
|
||||||
|
$config_mysql_username = 'ipreg';
|
||||||
|
$config_mysql_password = 'changeme!';
|
||||||
|
$config_mysql_dbname = 'ipreg';
|
||||||
|
|
||||||
|
// default values for IP blocks
|
||||||
|
$config_color_blocked = 'dcdcdc';
|
||||||
|
$config_color_unused = 'ffffff';
|
||||||
|
$config_color_dynamic = 'e0e0e0';
|
||||||
|
|
||||||
|
// language
|
||||||
|
$config_lang_default = 'en';
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -1,28 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
$dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password);
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
mysqli_select_db($dblink, $config_mysql_dbname);
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// build connection
|
|
||||||
$dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password);
|
|
||||||
|
|
||||||
// select db
|
|
||||||
mysqli_select_db($dblink, $config_mysql_dbname);
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
34
footer.php
34
footer.php
@@ -1,31 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
$smarty->assign("config_version", $config_version);
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("footer.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
|
|
||||||
// get version for the footer-stamp
|
|
||||||
$smarty->assign("config_version", $config_version);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("footer.tpl");
|
|
||||||
?>
|
?>
|
||||||
82
header.php
82
header.php
@@ -1,69 +1,41 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include('lang/' . $_SESSION['suser_language'] . '.php');
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
$smarty->assign($lang);
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
// search box
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
if (isset($_POST['search'])) {
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// include language file
|
|
||||||
include('lang/' . $_SESSION['suser_language'] . '.php');
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// search box
|
|
||||||
// new search?
|
|
||||||
if (isset($_POST['search'])) {
|
|
||||||
// set var
|
|
||||||
$search = sanitize($_POST['search']);
|
$search = sanitize($_POST['search']);
|
||||||
|
|
||||||
// store var
|
|
||||||
$_SESSION['search'] = $search;
|
$_SESSION['search'] = $search;
|
||||||
} else {
|
} else {
|
||||||
// check for stored var
|
if (isset($_SESSION['search'])) {
|
||||||
if(isset($_SESSION['search'])) {
|
|
||||||
// set var
|
|
||||||
$search = $_SESSION['search'];
|
$search = $_SESSION['search'];
|
||||||
} else {
|
} else {
|
||||||
// empty var
|
|
||||||
$search = '';
|
$search = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// to tpl
|
$smarty->assign("config_version", $config_version);
|
||||||
// set global template vars
|
$smarty->assign("suser_name", $_SESSION['suser_displayname']);
|
||||||
$smarty->assign("config_version", $config_version);
|
$smarty->assign("search", $search);
|
||||||
$smarty->assign("suser_name", $_SESSION['suser_displayname']);
|
|
||||||
$smarty->assign("search", $search);
|
|
||||||
|
|
||||||
// menu
|
// menu
|
||||||
$smarty->assign("menu_assets", $_SESSION['suser_menu_assets']=='on');
|
$smarty->assign("menu_assets", $_SESSION['suser_menu_assets']=='on');
|
||||||
$smarty->assign("menu_assetclasses", $_SESSION['suser_menu_assetclasses']=='on');
|
$smarty->assign("menu_assetclasses", $_SESSION['suser_menu_assetclasses']=='on');
|
||||||
$smarty->assign("menu_assetclassgroups", $_SESSION['suser_menu_assetclassgroups']=='on');
|
$smarty->assign("menu_assetclassgroups", $_SESSION['suser_menu_assetclassgroups']=='on');
|
||||||
$smarty->assign("menu_locations", $_SESSION['suser_menu_locations']=='on');
|
$smarty->assign("menu_locations", $_SESSION['suser_menu_locations']=='on');
|
||||||
$smarty->assign("menu_nodes", $_SESSION['suser_menu_nodes']=='on');
|
$smarty->assign("menu_nodes", $_SESSION['suser_menu_nodes']=='on');
|
||||||
$smarty->assign("menu_subnets", $_SESSION['suser_menu_subnets']=='on');
|
$smarty->assign("menu_subnets", $_SESSION['suser_menu_subnets']=='on');
|
||||||
$smarty->assign("menu_users", $_SESSION['suser_menu_users']=='on');
|
$smarty->assign("menu_users", $_SESSION['suser_menu_users']=='on');
|
||||||
$smarty->assign("menu_vlans", $_SESSION['suser_menu_vlans']=='on');
|
$smarty->assign("menu_vlans", $_SESSION['suser_menu_vlans']=='on');
|
||||||
$smarty->assign("menu_zones", $_SESSION['suser_menu_zones']=='on');
|
$smarty->assign("menu_zones", $_SESSION['suser_menu_zones']=='on');
|
||||||
|
|
||||||
// end page
|
$smarty->display("header.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("header.tpl");
|
|
||||||
?>
|
?>
|
||||||
50
image.php
50
image.php
@@ -1,35 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if(isset($_GET['icon'])) {
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// icon image
|
|
||||||
if(isset($_GET['icon'])) {
|
|
||||||
// get desired image
|
|
||||||
$icon = sanitize($_GET['icon']);
|
$icon = sanitize($_GET['icon']);
|
||||||
|
|
||||||
// switch selected
|
|
||||||
switch($icon) {
|
switch($icon) {
|
||||||
case ("add") :
|
case ("add") :
|
||||||
$png = 'page_add';
|
$png = 'page_add';
|
||||||
@@ -72,38 +54,28 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get image
|
|
||||||
$image = imagecreatefrompng("images/" . $png . ".png");
|
$image = imagecreatefrompng("images/" . $png . ".png");
|
||||||
|
|
||||||
// alpha blending
|
|
||||||
imagealphablending($image, true);
|
imagealphablending($image, true);
|
||||||
|
|
||||||
// save alphablending setting
|
|
||||||
imagesavealpha($image, true);
|
imagesavealpha($image, true);
|
||||||
|
|
||||||
// display image
|
|
||||||
header('Content-type: image/png');
|
header('Content-type: image/png');
|
||||||
imagepng($image);
|
imagepng($image);
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
}
|
}
|
||||||
|
|
||||||
// colored block
|
if(isset($_GET['color'])) {
|
||||||
if(isset($_GET['color'])) {
|
|
||||||
// get desired color
|
|
||||||
$color = sanitize($_GET['color']);
|
$color = sanitize($_GET['color']);
|
||||||
|
|
||||||
// create base image
|
|
||||||
$image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']);
|
$image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']);
|
||||||
|
|
||||||
// build color
|
|
||||||
$color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));
|
$color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));
|
||||||
|
|
||||||
// fill image with color
|
|
||||||
imagefill($image, 0, 0, $color);
|
imagefill($image, 0, 0, $color);
|
||||||
|
|
||||||
// display image
|
|
||||||
header('Content-type: image/png');
|
header('Content-type: image/png');
|
||||||
imagepng($image);
|
imagepng($image);
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
BIN
images/arrow_left.png
Normal file
BIN
images/arrow_left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 388 B |
BIN
images/arrow_right.png
Normal file
BIN
images/arrow_right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 379 B |
54
includes.php
54
includes.php
@@ -1,50 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
session_name('ipreg');
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
session_start();
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
// check for user_id, if unnkown, redirect to login
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
if(empty($_SESSION['suser_id'])) {
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// session
|
|
||||||
// start session
|
|
||||||
session_name('ipreg');
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
// check for user_id, if unnkown, redirect to login
|
|
||||||
if(empty($_SESSION['suser_id'])) {
|
|
||||||
// redirect
|
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// headers
|
include("config.php");
|
||||||
// raw http headers
|
include("dbconnect.php");
|
||||||
header("Content-Type: text/html; charset=utf-8");
|
|
||||||
|
|
||||||
// includes
|
include("lib.php");
|
||||||
// includes
|
|
||||||
include("config.php");
|
|
||||||
include("dbconnect.php");
|
|
||||||
|
|
||||||
// load lib
|
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
|
||||||
include("lib.php");
|
|
||||||
|
|
||||||
// set language
|
|
||||||
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
127
index.php
127
index.php
@@ -1,118 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
// asset
|
||||||
or contact me at wietsew@users.sourceforge.net
|
$query = "SELECT
|
||||||
*****************************************************************************/
|
COUNT(asset_id) AS asset_counter
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup asset
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(asset.asset_id) AS asset_counter
|
|
||||||
FROM
|
FROM
|
||||||
asset";
|
asset";
|
||||||
|
|
||||||
// run query
|
$assets = $db->db_select($query);
|
||||||
$assets = $db->db_select($query);
|
$smarty->assign("asset_counter", $assets[0]['asset_counter']);
|
||||||
|
|
||||||
// counter to tpl
|
// location
|
||||||
$smarty->assign("asset_counter", $assets[0]['asset_counter']);
|
$query = "SELECT
|
||||||
|
COUNT(location_id) AS location_counter
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(location.location_id) AS location_counter
|
|
||||||
FROM
|
FROM
|
||||||
location";
|
location";
|
||||||
|
|
||||||
// run query
|
$locations = $db->db_select($query);
|
||||||
$locations = $db->db_select($query);
|
$smarty->assign("location_counter", $locations[0]['location_counter']);
|
||||||
|
|
||||||
// counter to tpl
|
// node
|
||||||
$smarty->assign("location_counter", $locations[0]['location_counter']);
|
$query = "SELECT
|
||||||
|
COUNT(node_id) AS node_counter
|
||||||
// setup node
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(node.node_id) AS node_counter
|
|
||||||
FROM
|
FROM
|
||||||
node";
|
node";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
$smarty->assign("node_counter", $nodes[0]['node_counter']);
|
||||||
|
|
||||||
// counter to tpl
|
// subnet
|
||||||
$smarty->assign("node_counter", $nodes[0]['node_counter']);
|
$query = "SELECT
|
||||||
|
COUNT(subnet_id) AS subnet_counter
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(subnet.subnet_id) AS subnet_counter
|
|
||||||
FROM
|
FROM
|
||||||
subnet";
|
subnet";
|
||||||
|
$subnets = $db->db_select($query);
|
||||||
|
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']);
|
||||||
|
|
||||||
// run query
|
// vlan
|
||||||
$subnets = $db->db_select($query);
|
$query = "SELECT
|
||||||
|
COUNT(vlan_id) AS vlan_counter
|
||||||
// counter to tpl
|
|
||||||
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(vlan.vlan_id) AS vlan_counter
|
|
||||||
FROM
|
FROM
|
||||||
vlan";
|
vlan";
|
||||||
|
|
||||||
// run query
|
$vlans = $db->db_select($query);
|
||||||
$vlans = $db->db_select($query);
|
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']);
|
||||||
|
|
||||||
// counter to tpl
|
// zone
|
||||||
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']);
|
$query = "SELECT
|
||||||
|
|
||||||
// setup zone
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
COUNT(zone_id) AS zone_counter
|
COUNT(zone_id) AS zone_counter
|
||||||
FROM
|
FROM
|
||||||
zone";
|
zone";
|
||||||
|
$zones = $db->db_select($query);
|
||||||
|
$smarty->assign("zone_counter", $zones[0]['zone_counter']);
|
||||||
|
|
||||||
// run query
|
$smarty->display("index.tpl");
|
||||||
$zones = $db->db_select($query);
|
|
||||||
|
|
||||||
// counter to tpl
|
include("footer.php");
|
||||||
$smarty->assign("zone_counter", $zones[0]['zone_counter']);
|
|
||||||
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("index.tpl");
|
|
||||||
|
|
||||||
// footer
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -2,8 +2,9 @@ IP Reg Installation
|
|||||||
|
|
||||||
1. Install requirements
|
1. Install requirements
|
||||||
IP Reg version 0.6 and up depends on smarty template engine.
|
IP Reg version 0.6 and up depends on smarty template engine.
|
||||||
In Debian install ist with: "apt-get install smarty3".
|
In Debian install it with: "apt-get install smarty3".
|
||||||
The GHP-GD module is also required: "apt-get install php-gd".
|
The PHP-GD module is also required: "apt-get install php-gd".
|
||||||
|
|
||||||
|
|
||||||
2. Create database
|
2. Create database
|
||||||
Create a database for IP Reg on your web server, as well as a MySQL user who
|
Create a database for IP Reg on your web server, as well as a MySQL user who
|
||||||
@@ -16,27 +17,39 @@ Create database-user for application with minimum necessary rights.
|
|||||||
CREATE USER 'ipreg'@'localhost' IDENTIFIED BY '********';
|
CREATE USER 'ipreg'@'localhost' IDENTIFIED BY '********';
|
||||||
GRANT SELECT, INSERT, UPDATE, DELETE ON ipreg.* TO 'ipreg'@'localhost';
|
GRANT SELECT, INSERT, UPDATE, DELETE ON ipreg.* TO 'ipreg'@'localhost';
|
||||||
|
|
||||||
3. Run import
|
|
||||||
|
3. Run database import
|
||||||
Import the mysql.sql file into your database, which will create the tables
|
Import the mysql.sql file into your database, which will create the tables
|
||||||
and some sample data.
|
|
||||||
|
|
||||||
mysql ipreg < mysql.sql
|
mysql ipreg < mysql.sql
|
||||||
|
|
||||||
4. Edit config file
|
Optional import some sample data
|
||||||
Open config.php in a text editor and fill in your database details.
|
|
||||||
|
|
||||||
5. Upload files
|
mysql ipreg < mysql_sample.sql
|
||||||
Upload all files and directory's (except the install directory) to your
|
|
||||||
|
|
||||||
|
4. Upload files
|
||||||
|
Upload all files and directories (except the install directory) to your
|
||||||
webserver.
|
webserver.
|
||||||
|
|
||||||
|
|
||||||
|
5. Create and edit config file
|
||||||
|
Rename sample configfile config.php-sample:
|
||||||
|
mv config.php-sample config.php
|
||||||
|
|
||||||
|
Open config.php in a text editor and fill in your database details.
|
||||||
|
|
||||||
|
|
||||||
6. Check file access rights for security
|
6. Check file access rights for security
|
||||||
Only directory tpl_c should be writeble by webserver
|
Only directory tpl_c should be writeble by webserver.
|
||||||
|
Configfile should be readable by webserver but not writeable.
|
||||||
|
|
||||||
chmod 640 config.php
|
chmod 640 config.php
|
||||||
chgrp www-data config.php
|
chgrp www-data config.php
|
||||||
|
|
||||||
chown www-data tpl_c
|
chown www-data tpl_c
|
||||||
|
|
||||||
|
|
||||||
7. Start using IP Reg
|
7. Start using IP Reg
|
||||||
Start your browser and login to IP Reg with the default username/password:
|
Start your browser and login to IP Reg with the default username/password:
|
||||||
admin/admin
|
admin/admin
|
||||||
|
|||||||
@@ -4,38 +4,26 @@ CREATE TABLE asset (
|
|||||||
asset_hostname varchar(100) DEFAULT NULL,
|
asset_hostname varchar(100) DEFAULT NULL,
|
||||||
assetclass_id int(10) NOT NULL,
|
assetclass_id int(10) NOT NULL,
|
||||||
asset_info text DEFAULT NULL,
|
asset_info text DEFAULT NULL,
|
||||||
PRIMARY KEY (asset_id)
|
PRIMARY KEY (asset_id),
|
||||||
|
INDEX ix_asset_name (asset_name)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO asset (asset_name, assetclass_id) VALUES
|
|
||||||
('My Computer', 1),
|
|
||||||
('My Server', 2);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE assetclass (
|
CREATE TABLE assetclass (
|
||||||
assetclass_id int(10) NOT NULL AUTO_INCREMENT,
|
assetclass_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
assetclassgroup_id int(10) NOT NULL,
|
assetclassgroup_id int(10) NOT NULL,
|
||||||
assetclass_name varchar(100) NOT NULL,
|
assetclass_name varchar(100) NOT NULL,
|
||||||
PRIMARY KEY (assetclass_id)
|
PRIMARY KEY (assetclass_id),
|
||||||
|
INDEX ix_assetclass_name (assetclass_name)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
|
|
||||||
(1, 'PC'),
|
|
||||||
(2, 'Server');
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE assetclassgroup (
|
CREATE TABLE assetclassgroup (
|
||||||
assetclassgroup_id int(10) NOT NULL AUTO_INCREMENT,
|
assetclassgroup_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
assetclassgroup_name varchar(100) NOT NULL,
|
assetclassgroup_name varchar(100) NOT NULL,
|
||||||
assetclassgroup_color varchar(6) NOT NULL DEFAULT '000000',
|
assetclassgroup_color varchar(6) NOT NULL DEFAULT '000000',
|
||||||
PRIMARY KEY (assetclassgroup_id)
|
PRIMARY KEY (assetclassgroup_id),
|
||||||
|
INDEX ix_assetclassgroup_name (assetclassgroup_name)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
|
|
||||||
('Workstations', '000000'),
|
|
||||||
('Servers', '0000CC');
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE location (
|
CREATE TABLE location (
|
||||||
location_id int(10) NOT NULL AUTO_INCREMENT,
|
location_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
location_name varchar(100) NOT NULL,
|
location_name varchar(100) NOT NULL,
|
||||||
@@ -43,13 +31,10 @@ CREATE TABLE location (
|
|||||||
location_info text DEFAULT NULL,
|
location_info text DEFAULT NULL,
|
||||||
location_sort int(11) NOT NULL DEFAULT 0,
|
location_sort int(11) NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (location_id),
|
PRIMARY KEY (location_id),
|
||||||
KEY location_sort (location_sort)
|
INDEX ix_location_sort (location_sort),
|
||||||
|
INDEX ix_location_name (location_name)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO location (location_name, location_parent) VALUES
|
|
||||||
('Main Office', 0);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE nat (
|
CREATE TABLE nat (
|
||||||
nat_id int(10) NOT NULL AUTO_INCREMENT,
|
nat_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
nat_type int(1) NOT NULL,
|
nat_type int(1) NOT NULL,
|
||||||
@@ -72,11 +57,6 @@ CREATE TABLE node (
|
|||||||
PRIMARY KEY (node_id)
|
PRIMARY KEY (node_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
|
|
||||||
('192.168.1.2', '001122334455', 1, 1),
|
|
||||||
('192.168.1.1', 'aabbccddeeff', 1, 2);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE subnet (
|
CREATE TABLE subnet (
|
||||||
subnet_id int(10) NOT NULL AUTO_INCREMENT,
|
subnet_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
subnet_address varchar(45) NOT NULL,
|
subnet_address varchar(45) NOT NULL,
|
||||||
@@ -89,10 +69,6 @@ CREATE TABLE subnet (
|
|||||||
PRIMARY KEY (subnet_id)
|
PRIMARY KEY (subnet_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO subnet (subnet_address, subnet_mask) VALUES
|
|
||||||
('192.168.0.0', 24);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE subnetlocation (
|
CREATE TABLE subnetlocation (
|
||||||
subnetlocation_id int(10) NOT NULL AUTO_INCREMENT,
|
subnetlocation_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
subnet_id int(10) NOT NULL,
|
subnet_id int(10) NOT NULL,
|
||||||
@@ -100,7 +76,6 @@ CREATE TABLE subnetlocation (
|
|||||||
PRIMARY KEY (subnetlocation_id)
|
PRIMARY KEY (subnetlocation_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE subnetvlan (
|
CREATE TABLE subnetvlan (
|
||||||
subnetvlan_id int(10) NOT NULL AUTO_INCREMENT,
|
subnetvlan_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
subnet_id int(10) NOT NULL,
|
subnet_id int(10) NOT NULL,
|
||||||
@@ -108,10 +83,6 @@ CREATE TABLE subnetvlan (
|
|||||||
PRIMARY KEY (subnetvlan_id)
|
PRIMARY KEY (subnetvlan_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO subnetvlan (subnet_id, vlan_id) VALUES
|
|
||||||
(1, 1);
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE user (
|
CREATE TABLE user (
|
||||||
user_id int(10) NOT NULL AUTO_INCREMENT,
|
user_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
user_name varchar(100) NOT NULL,
|
user_name varchar(100) NOT NULL,
|
||||||
@@ -134,12 +105,12 @@ CREATE TABLE user (
|
|||||||
user_menu_vlans varchar(2) NOT NULL DEFAULT 'on',
|
user_menu_vlans varchar(2) NOT NULL DEFAULT 'on',
|
||||||
user_menu_zones varchar(2) NOT NULL DEFAULT 'on',
|
user_menu_zones varchar(2) NOT NULL DEFAULT 'on',
|
||||||
user_tooltips varchar(2) NOT NULL DEFAULT 'on',
|
user_tooltips varchar(2) NOT NULL DEFAULT 'on',
|
||||||
PRIMARY KEY (user_id)
|
PRIMARY KEY (user_id),
|
||||||
|
UNIQUE INDEX ix_username (user_name)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO user (user_name, user_pass, user_displayname, user_imagesize, user_imagecount, user_mac, user_dateformat, user_menu_assets, user_menu_assetclasses, user_menu_assetclassgroups, user_menu_locations, user_menu_nodes, user_menu_subnets, user_menu_users, user_menu_vlans) VALUES
|
INSERT INTO user (user_name, user_pass, user_displayname) VALUES
|
||||||
('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator', 6, 64, 'xxxxxxxxxxxx', 'd M Y H:i', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on');
|
('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator');
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE vlan (
|
CREATE TABLE vlan (
|
||||||
vlan_id int(10) NOT NULL AUTO_INCREMENT,
|
vlan_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
@@ -149,10 +120,6 @@ CREATE TABLE vlan (
|
|||||||
PRIMARY KEY (vlan_id)
|
PRIMARY KEY (vlan_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO vlan (vlan_number, vlan_name) VALUES
|
|
||||||
(1, 'DEFAULT_VLAN');
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE zone (
|
CREATE TABLE zone (
|
||||||
zone_id int(10) NOT NULL AUTO_INCREMENT,
|
zone_id int(10) NOT NULL AUTO_INCREMENT,
|
||||||
zone_soa varchar(40) CHARACTER SET utf8 NOT NULL,
|
zone_soa varchar(40) CHARACTER SET utf8 NOT NULL,
|
||||||
@@ -172,6 +139,3 @@ CREATE TABLE zone (
|
|||||||
zone_info text CHARACTER SET utf8 DEFAULT NULL,
|
zone_info text CHARACTER SET utf8 DEFAULT NULL,
|
||||||
PRIMARY KEY (zone_id)
|
PRIMARY KEY (zone_id)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO zone (zone_soa, zone_origin, zone_hostmaster, zone_serial, zone_ns1) VALUES
|
|
||||||
('ns1.example.com.', 'example.com.', 'hostmaster@example.com', '2023021301', 'ns1.example.com');
|
|
||||||
|
|||||||
56
install/mysql_sample.sql
Normal file
56
install/mysql_sample.sql
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
INSERT INTO asset (asset_name, assetclass_id) VALUES
|
||||||
|
('Computer', 1),
|
||||||
|
('Server', 3),
|
||||||
|
('Printer', 4),
|
||||||
|
('Firewall', 6);
|
||||||
|
|
||||||
|
INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
|
||||||
|
(1, 'Desktop'),
|
||||||
|
(1, 'Notebook'),
|
||||||
|
(2, 'Server'),
|
||||||
|
(3, 'Printer'),
|
||||||
|
(4, 'Switch'),
|
||||||
|
(4, 'Firewall'),
|
||||||
|
(5, 'Scanner');
|
||||||
|
|
||||||
|
INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
|
||||||
|
('Personal Computer', '000000'),
|
||||||
|
('Servers', '0000CC'),
|
||||||
|
('Periphery', '00CC00'),
|
||||||
|
('Network', 'CCCC00'),
|
||||||
|
('Miscellaneous', 'CC0000');
|
||||||
|
|
||||||
|
INSERT INTO location (location_name, location_parent) VALUES
|
||||||
|
('Main Office', 0),
|
||||||
|
('Branch Office A', 1),
|
||||||
|
('Branch Office B', 1);
|
||||||
|
|
||||||
|
INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
|
||||||
|
('192.168.0.10', '001122334455', 1, 1),
|
||||||
|
('192.168.0.11', 'aabbccddeeff', 1, 2),
|
||||||
|
('192.168.0.12', '775544881199', 1, 3),
|
||||||
|
('192.168.0.1', '667755441122', 1, 4),
|
||||||
|
('192.168.1.1', '667755441123', 2, 4),
|
||||||
|
('192.168.10.1', '667755441124', 3, 4),
|
||||||
|
('192.168.20.1', '667755441125', 4, 4);
|
||||||
|
|
||||||
|
INSERT INTO subnet (subnet_address, subnet_mask) VALUES
|
||||||
|
('192.168.0.0', 24),
|
||||||
|
('192.168.1.0', 24),
|
||||||
|
('192.168.10.0', 24),
|
||||||
|
('192.168.20.0', 24);
|
||||||
|
|
||||||
|
INSERT INTO subnetlocation (subnet_id, location_id) VALUES
|
||||||
|
(1, 1),
|
||||||
|
(2, 1),
|
||||||
|
(3, 2),
|
||||||
|
(4, 3);
|
||||||
|
|
||||||
|
INSERT INTO subnetvlan (subnet_id, vlan_id) VALUES
|
||||||
|
(1, 1);
|
||||||
|
|
||||||
|
INSERT INTO vlan (vlan_number, vlan_name) VALUES
|
||||||
|
(1, 'DEFAULT_VLAN');
|
||||||
|
|
||||||
|
INSERT INTO zone (zone_soa, zone_origin, zone_hostmaster, zone_serial, zone_ns1) VALUES
|
||||||
|
('ns1.example.com.', 'example.com.', 'hostmaster@example.com', '2023021301', 'ns1.example.com');
|
||||||
19
lang/de.php
19
lang/de.php
@@ -88,6 +88,7 @@ $lang = array(
|
|||||||
'lang_location_name' => 'Standortname',
|
'lang_location_name' => 'Standortname',
|
||||||
'lang_location_parent' => 'Übergeordneter Standort',
|
'lang_location_parent' => 'Übergeordneter Standort',
|
||||||
'lang_sublocation_add' => 'Unterstandort hinzufügen',
|
'lang_sublocation_add' => 'Unterstandort hinzufügen',
|
||||||
|
'lang_location_none' => 'Es sind keine Standorte vorhanden',
|
||||||
|
|
||||||
'lang_locationsubnet' => 'Standort/Subnetz',
|
'lang_locationsubnet' => 'Standort/Subnetz',
|
||||||
'lang_locationsubnet_edit' => 'Standort/Subnetz bearbeiten',
|
'lang_locationsubnet_edit' => 'Standort/Subnetz bearbeiten',
|
||||||
@@ -96,6 +97,7 @@ $lang = array(
|
|||||||
'lang_node_del' => 'Knoten löschen',
|
'lang_node_del' => 'Knoten löschen',
|
||||||
'lang_node_edit' => 'Knoten ändern',
|
'lang_node_edit' => 'Knoten ändern',
|
||||||
'lang_node_info' => 'Knoteninfo',
|
'lang_node_info' => 'Knoteninfo',
|
||||||
|
'lang_node_none' => 'Es sind keine Knoten vorhanden',
|
||||||
'lang_dns1' => 'DNS-Name',
|
'lang_dns1' => 'DNS-Name',
|
||||||
'lang_dns2' => 'DNS-Alias',
|
'lang_dns2' => 'DNS-Alias',
|
||||||
'lang_ip' => 'IP-Adresse',
|
'lang_ip' => 'IP-Adresse',
|
||||||
@@ -128,6 +130,7 @@ $lang = array(
|
|||||||
'lang_subnet_dhcpstart' => 'DHCP Anfang',
|
'lang_subnet_dhcpstart' => 'DHCP Anfang',
|
||||||
'lang_subnet_dhcpend' => 'DHCP Ende',
|
'lang_subnet_dhcpend' => 'DHCP Ende',
|
||||||
'lang_subnet_ntp_server' => 'NTP-Server',
|
'lang_subnet_ntp_server' => 'NTP-Server',
|
||||||
|
'lang_subnet_none' => 'Es sind keine Subnetze vorhanden',
|
||||||
|
|
||||||
'lang_subnetlocation' => 'Subnetz/Ort',
|
'lang_subnetlocation' => 'Subnetz/Ort',
|
||||||
'lang_subnetlocation_edit' => 'Subnetz/Ort bearbeiten',
|
'lang_subnetlocation_edit' => 'Subnetz/Ort bearbeiten',
|
||||||
@@ -145,7 +148,7 @@ $lang = array(
|
|||||||
'lang_zone_add' => 'Zone hinzufügen',
|
'lang_zone_add' => 'Zone hinzufügen',
|
||||||
'lang_zone_del' => 'Zone löschen',
|
'lang_zone_del' => 'Zone löschen',
|
||||||
'lang_zone_edit' => 'Zone bearbeiten',
|
'lang_zone_edit' => 'Zone bearbeiten',
|
||||||
|
'lang_zone_none' => 'Es sind keine Zonen vorhanden',
|
||||||
|
|
||||||
'lang_vlan_add' => 'VLAN hinzufügen',
|
'lang_vlan_add' => 'VLAN hinzufügen',
|
||||||
'lang_vlan_del' => 'VLAN löschen',
|
'lang_vlan_del' => 'VLAN löschen',
|
||||||
@@ -154,6 +157,7 @@ $lang = array(
|
|||||||
'lang_vlan_info' => 'VLAN Info',
|
'lang_vlan_info' => 'VLAN Info',
|
||||||
'lang_vlan_new' => 'VLAN Info',
|
'lang_vlan_new' => 'VLAN Info',
|
||||||
'lang_vlan_name' => 'VLAN Name',
|
'lang_vlan_name' => 'VLAN Name',
|
||||||
|
'lang_vlan_none' => 'Es sind keine VLANs vorhanden',
|
||||||
|
|
||||||
'lang_vlansubnet' => 'VLAN/Subnetz',
|
'lang_vlansubnet' => 'VLAN/Subnetz',
|
||||||
'lang_vlansubnet_edit' => 'VLAN/Subnetz bearbeiten',
|
'lang_vlansubnet_edit' => 'VLAN/Subnetz bearbeiten',
|
||||||
@@ -181,9 +185,9 @@ $lang = array(
|
|||||||
'lang_options_dateformat' => 'Datumsformat',
|
'lang_options_dateformat' => 'Datumsformat',
|
||||||
'lang_options_dateformat_help' => 'Format in which dates are displayed using the php-date-format (see http://www.php.net/date for more info)',
|
'lang_options_dateformat_help' => 'Format in which dates are displayed using the php-date-format (see http://www.php.net/date for more info)',
|
||||||
'lang_options_dns1suffix' => 'DNS Name suffix',
|
'lang_options_dns1suffix' => 'DNS Name suffix',
|
||||||
'lang_options_dns1suffix_help' => 'Default DNS Name suffix f<EFBFBD>r neue Knoten',
|
'lang_options_dns1suffix_help' => 'Default DNS Name suffix für neue Knoten',
|
||||||
'lang_options_dns2suffix' => 'DNS Alias suffix',
|
'lang_options_dns2suffix' => 'DNS Alias suffix',
|
||||||
'lang_options_dns2suffix_help' => 'Default DNS Alias suffix f<EFBFBD>r neue Knoten',
|
'lang_options_dns2suffix_help' => 'Default DNS Alias suffix für neue Knoten',
|
||||||
'lang_options_currentpassword' => 'Aktuelles Kennwort',
|
'lang_options_currentpassword' => 'Aktuelles Kennwort',
|
||||||
'lang_options_currentpassword_help' => 'Bitte geben Sie hier Ihr bisheriges Kennwort ein',
|
'lang_options_currentpassword_help' => 'Bitte geben Sie hier Ihr bisheriges Kennwort ein',
|
||||||
'lang_options_newpassword1' => 'Neues Kennwort',
|
'lang_options_newpassword1' => 'Neues Kennwort',
|
||||||
@@ -193,7 +197,8 @@ $lang = array(
|
|||||||
'lang_options_tooltips_help' => 'Tooltips anzeigen',
|
'lang_options_tooltips_help' => 'Tooltips anzeigen',
|
||||||
'lang_options_language_help' => 'Sprache für diesen Benutzer',
|
'lang_options_language_help' => 'Sprache für diesen Benutzer',
|
||||||
|
|
||||||
'lang_about_sfprojectpage' => 'Sourceforge Project Page',
|
'lang_about_projectpage' => 'Aktuelle Projektseite',
|
||||||
|
'lang_about_sfprojectpage' => 'Sourceforge Projektseite',
|
||||||
'lang_about_license' => 'Lizenz',
|
'lang_about_license' => 'Lizenz',
|
||||||
'lang_about_gpl' => 'GNU General Public License (GPL)',
|
'lang_about_gpl' => 'GNU General Public License (GPL)',
|
||||||
'lang_about_smarty' => 'Smarty Template Engine',
|
'lang_about_smarty' => 'Smarty Template Engine',
|
||||||
@@ -202,12 +207,14 @@ $lang = array(
|
|||||||
'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)<br>Copyright (C) 2011-2023 Thomas Hooge<p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<p> You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.',
|
'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)<br>Copyright (C) 2011-2023 Thomas Hooge<p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<p> You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.',
|
||||||
|
|
||||||
'lang_about_changelog' => 'Changelog (major changes only)',
|
'lang_about_changelog' => 'Changelog (major changes only)',
|
||||||
|
'lang_about_changelog_v08' => 'v0.8 (feb 2023)',
|
||||||
|
'lang_about_changelog_v08_ext' => '- Some small improvements and bugfixing<br>- Code simplification as preparation for big refactoring',
|
||||||
'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
|
'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
|
||||||
'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
|
'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
|
||||||
'lang_about_changelog_v06' => 'v0.6 (may 2011)',
|
'lang_about_changelog_v06' => 'v0.6 (may 2011)',
|
||||||
'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine<br />- language support finalized<br />- added german language<br />- some small bug fixes',
|
'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine<br />- language support finalized<br>- added german language<br>- some small bug fixes',
|
||||||
'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
|
'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
|
||||||
'lang_about_changelog_v05_ext' => '- Complete code rewrite<br>- Input sanitation<br>- Background image<br>- Added multiple counters<br>- HTML is now 100% W3C valid<br>More user options',
|
'lang_about_changelog_v05_ext' => '- Complete code rewrite<br>- Input sanitation<br>- Background image<br>- Added multiple counters<br>- HTML is now 100% W3C valid<br>- More user options',
|
||||||
'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
|
'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
|
||||||
'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed<br>- PHP-generated images in subnet overview',
|
'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed<br>- PHP-generated images in subnet overview',
|
||||||
'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
|
'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
|
||||||
|
|||||||
12
lang/en.php
12
lang/en.php
@@ -88,6 +88,7 @@ $lang = array(
|
|||||||
'lang_location_name' => 'Location name',
|
'lang_location_name' => 'Location name',
|
||||||
'lang_location_parent' => 'Parent',
|
'lang_location_parent' => 'Parent',
|
||||||
'lang_sublocation_add' => 'Add Sub-location',
|
'lang_sublocation_add' => 'Add Sub-location',
|
||||||
|
'lang_location_none' => 'There are no locations defined',
|
||||||
|
|
||||||
'lang_locationsubnet' => 'Location/Subnet',
|
'lang_locationsubnet' => 'Location/Subnet',
|
||||||
'lang_locationsubnet_edit' => 'Edit Location/Subnet',
|
'lang_locationsubnet_edit' => 'Edit Location/Subnet',
|
||||||
@@ -96,6 +97,7 @@ $lang = array(
|
|||||||
'lang_node_del' => 'Delete node',
|
'lang_node_del' => 'Delete node',
|
||||||
'lang_node_edit' => 'Modify node',
|
'lang_node_edit' => 'Modify node',
|
||||||
'lang_node_info' => 'Node info',
|
'lang_node_info' => 'Node info',
|
||||||
|
'lang_node_none' => 'There are no nodes defined',
|
||||||
'lang_dns1' => 'DNS name',
|
'lang_dns1' => 'DNS name',
|
||||||
'lang_dns2' => 'DNS Alias',
|
'lang_dns2' => 'DNS Alias',
|
||||||
'lang_ip' => 'IP Address',
|
'lang_ip' => 'IP Address',
|
||||||
@@ -128,6 +130,7 @@ $lang = array(
|
|||||||
'lang_subnet_dhcpstart' => 'DHCP Start',
|
'lang_subnet_dhcpstart' => 'DHCP Start',
|
||||||
'lang_subnet_dhcpend' => 'DHCP End',
|
'lang_subnet_dhcpend' => 'DHCP End',
|
||||||
'lang_subnet_ntp_server' => 'NTP Server',
|
'lang_subnet_ntp_server' => 'NTP Server',
|
||||||
|
'lang_subnet_none' => 'There are no subnets defined',
|
||||||
|
|
||||||
'lang_subnetlocation' => 'Subnet/Location',
|
'lang_subnetlocation' => 'Subnet/Location',
|
||||||
'lang_subnetlocation_edit' => 'Edit Subnet/Location',
|
'lang_subnetlocation_edit' => 'Edit Subnet/Location',
|
||||||
@@ -144,6 +147,7 @@ $lang = array(
|
|||||||
'lang_zone_add' => 'Add zone',
|
'lang_zone_add' => 'Add zone',
|
||||||
'lang_zone_del' => 'Delete zone',
|
'lang_zone_del' => 'Delete zone',
|
||||||
'lang_zone_edit' => 'Mofidy zone',
|
'lang_zone_edit' => 'Mofidy zone',
|
||||||
|
'lang_zone_none' => 'There are no zones defined',
|
||||||
|
|
||||||
'lang_vlan_add' => 'Add VLAN',
|
'lang_vlan_add' => 'Add VLAN',
|
||||||
'lang_vlan_del' => 'Delete VLAN',
|
'lang_vlan_del' => 'Delete VLAN',
|
||||||
@@ -152,6 +156,7 @@ $lang = array(
|
|||||||
'lang_vlan_info' => 'VLAN info',
|
'lang_vlan_info' => 'VLAN info',
|
||||||
'lang_vlan_new' => 'VLAN info',
|
'lang_vlan_new' => 'VLAN info',
|
||||||
'lang_vlan_name' => 'VLAN name',
|
'lang_vlan_name' => 'VLAN name',
|
||||||
|
'lang_vlan_none' => 'There are no VLANs defined',
|
||||||
'lang_user_language' => 'Language',
|
'lang_user_language' => 'Language',
|
||||||
|
|
||||||
'lang_vlansubnet' => 'VLAN/Subnet',
|
'lang_vlansubnet' => 'VLAN/Subnet',
|
||||||
@@ -192,6 +197,7 @@ $lang = array(
|
|||||||
'lang_options_tooltips_help' => 'Show tooltips',
|
'lang_options_tooltips_help' => 'Show tooltips',
|
||||||
'lang_options_language_help' => 'Language for this user',
|
'lang_options_language_help' => 'Language for this user',
|
||||||
|
|
||||||
|
'lang_about_projectpage' => 'Current Project Page',
|
||||||
'lang_about_sfprojectpage' => 'Sourceforge Project Page',
|
'lang_about_sfprojectpage' => 'Sourceforge Project Page',
|
||||||
'lang_about_license' => 'License',
|
'lang_about_license' => 'License',
|
||||||
'lang_about_gpl' => 'GNU General Public License (GPL)',
|
'lang_about_gpl' => 'GNU General Public License (GPL)',
|
||||||
@@ -201,12 +207,14 @@ $lang = array(
|
|||||||
'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)<br>Copyright (C) 2011-2023 Thomas Hooge<p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<p> You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.',
|
'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)<br>Copyright (C) 2011-2023 Thomas Hooge<p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<p> You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.',
|
||||||
|
|
||||||
'lang_about_changelog' => 'Changelog (major changes only)',
|
'lang_about_changelog' => 'Changelog (major changes only)',
|
||||||
|
'lang_about_changelog_v08' => 'v0.8 (feb 2023)',
|
||||||
|
'lang_about_changelog_v08_ext' => '- Some small improvements and bugfixing<br>- Code simplification as preparation for big refactoring',
|
||||||
'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
|
'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
|
||||||
'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
|
'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
|
||||||
'lang_about_changelog_v06' => 'v0.6 (may 2011)',
|
'lang_about_changelog_v06' => 'v0.6 (may 2011)',
|
||||||
'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine<br />- language support finalized<br />- added german language<br />- some small bug fixes',
|
'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine<br />- language support finalized<br>- added german language<br>- some small bug fixes',
|
||||||
'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
|
'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
|
||||||
'lang_about_changelog_v05_ext' => '- Complete code rewrite<br>- Input sanitation<br>- Background image<br>- Added multiple counters<br>- HTML is now 100% W3C valid<br>More user options',
|
'lang_about_changelog_v05_ext' => '- Complete code rewrite<br>- Input sanitation<br>- Background image<br>- Added multiple counters<br>- HTML is now 100% W3C valid<br>- More user options',
|
||||||
'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
|
'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
|
||||||
'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed<br>- PHP-generated images in subnet overview',
|
'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed<br>- PHP-generated images in subnet overview',
|
||||||
'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
|
'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
|
||||||
|
|||||||
59
lib.php
59
lib.php
@@ -1,48 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
// global version string
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
$config_version = 'v0.8';
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
// available languages
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
$config_lang = array('de', 'en');
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("lib/functions.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// functions
|
require("lib/db.class.php");
|
||||||
include("lib/functions.php");
|
$db = new Db($dblink);
|
||||||
|
|
||||||
// classes
|
require("lib/user.class.php");
|
||||||
// db
|
$user = new User();
|
||||||
// load class
|
|
||||||
require("lib/db.class.php");
|
|
||||||
|
|
||||||
// create instance
|
require_once('smarty3/Smarty.class.php');
|
||||||
$db = new Db($dblink);
|
$smarty = new Smarty();
|
||||||
|
$smarty->template_dir = 'tpl';
|
||||||
|
$smarty->compile_dir = 'tpl_c';
|
||||||
|
$smarty->registerPlugin('function', 'treelist', 'print_tree');
|
||||||
|
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']);
|
||||||
|
|
||||||
// user
|
|
||||||
// load class
|
|
||||||
require("lib/user.class.php");
|
|
||||||
|
|
||||||
// create instance
|
|
||||||
$user = new User();
|
|
||||||
|
|
||||||
// tpl
|
|
||||||
require_once('smarty3/Smarty.class.php');
|
|
||||||
$smarty = new Smarty();
|
|
||||||
$smarty->template_dir = 'tpl';
|
|
||||||
$smarty->compile_dir = 'tpl_c';
|
|
||||||
$smarty->registerPlugin('function', 'treelist', 'print_tree');
|
|
||||||
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']);
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
64
location.php
64
location.php
@@ -1,50 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$query = "SELECT
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// start location
|
|
||||||
// look for locations
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location_id AS id,
|
location_id AS id,
|
||||||
location_name AS value,
|
location_name AS value,
|
||||||
location_parent AS parent_id
|
location_parent AS parent_id
|
||||||
FROM
|
FROM
|
||||||
location
|
location
|
||||||
ORDER BY location_parent, location_sort, location_name";
|
ORDER BY location_parent, location_sort, location_name";
|
||||||
|
|
||||||
// run query
|
$locations = $db->db_select($query);
|
||||||
$locations = $db->db_select($query);
|
|
||||||
|
|
||||||
function build_tree($parent_id, $level) {
|
// function for recursion
|
||||||
|
function build_tree($parent_id, $level) {
|
||||||
global $locations;
|
global $locations;
|
||||||
$children = array();
|
$children = array();
|
||||||
foreach ($locations as $key => $location) {
|
foreach ($locations as $key => $location) {
|
||||||
@@ -57,14 +35,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $children;
|
return $children;
|
||||||
}
|
}
|
||||||
$tree = build_tree(0, 0);
|
|
||||||
$smarty->assign("locations", $tree);
|
|
||||||
|
|
||||||
// end page
|
$tree = build_tree(0, 0);
|
||||||
// output
|
$smarty->assign("locations", $tree);
|
||||||
$smarty->display("location.tpl");
|
|
||||||
|
|
||||||
// footer
|
$smarty->display("location.tpl");
|
||||||
include("footer.php");
|
|
||||||
|
include("footer.php");
|
||||||
?>
|
?>
|
||||||
@@ -1,71 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_parent = sanitize($_GET['location_parent']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$location_parent = sanitize($_GET['location_parent']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
|
|
||||||
// ************* <option value="0">{$lang_option_none}</option>
|
// ************* <option value="0">{$lang_option_none}</option>
|
||||||
|
|
||||||
|
$query = "SELECT location_id, location_name, location_parent, location_sort
|
||||||
// start parent
|
|
||||||
// look for locations
|
|
||||||
// build query
|
|
||||||
$query = "SELECT location_id, location_name, location_parent, location_sort
|
|
||||||
FROM location
|
FROM location
|
||||||
ORDER BY location_parent, location_sort, location_name";
|
ORDER BY location_parent, location_sort, location_name";
|
||||||
|
|
||||||
// run query
|
$locations = $db->db_select($query);
|
||||||
$locations = $db->db_select($query);
|
|
||||||
|
|
||||||
// count results
|
$location_counter = count($locations);
|
||||||
$location_counter = count($locations);
|
|
||||||
|
|
||||||
// any loactions?
|
if ($location_counter>0) {
|
||||||
if ($location_counter>0) {
|
|
||||||
// get objects
|
// get objects
|
||||||
foreach($locations AS $location) {
|
foreach ($locations AS $location) {
|
||||||
// create arrays
|
// create arrays
|
||||||
$location_names[$location['location_id']] = $location['location_name'];
|
$location_names[$location['location_id']] = $location['location_name'];
|
||||||
$parents[$location['location_parent']][] = $location['location_id'];
|
$parents[$location['location_parent']][] = $location['location_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for parents
|
// look for parents
|
||||||
// function to look for parents and create a new array for every child
|
// function to look for parents and create a new array for every child
|
||||||
function location($parents, $parent = 0) {
|
function location($parents, $parent = 0) {
|
||||||
// loop array to check
|
// loop array to check
|
||||||
foreach($parents[$parent] as $child) {
|
foreach ($parents[$parent] as $child) {
|
||||||
if(isset($parents[$child])) {
|
if (isset($parents[$child])) {
|
||||||
// element has children
|
// element has children
|
||||||
$children[$child] = location($parents, $child);
|
$children[$child] = location($parents, $child);
|
||||||
} else {
|
} else {
|
||||||
@@ -76,10 +49,10 @@
|
|||||||
|
|
||||||
// and again...
|
// and again...
|
||||||
return $children;
|
return $children;
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursive children check to template
|
// recursive children check to template
|
||||||
function checkchildren($locations, $level) {
|
function checkchildren($locations, $level) {
|
||||||
global $location_options;
|
global $location_options;
|
||||||
global $location_names;
|
global $location_names;
|
||||||
global $location_parent;
|
global $location_parent;
|
||||||
@@ -87,23 +60,19 @@
|
|||||||
foreach ($locations as $parent=>$child) {
|
foreach ($locations as $parent=>$child) {
|
||||||
$row = str_repeat("- ", $level) . $location_names[$parent];
|
$row = str_repeat("- ", $level) . $location_names[$parent];
|
||||||
$location_options[$parent] = $row;
|
$location_options[$parent] = $row;
|
||||||
if(isset($child)) {
|
if (isset($child)) {
|
||||||
checkchildren($child, $level+1);
|
checkchildren($child, $level+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
$tree = location($parents);
|
||||||
|
$location_options = array(0 => '-');
|
||||||
|
checkchildren($tree, 0);
|
||||||
|
$smarty->assign("location_options", $location_options);
|
||||||
|
$smarty->assign("location_parent", $location_parent);
|
||||||
|
|
||||||
$tree = location($parents);
|
$smarty->display("locationadd.tpl");
|
||||||
$location_options = array(0 => '-');
|
|
||||||
checkchildren($tree, 0);
|
|
||||||
$smarty->assign("location_options", $location_options);
|
|
||||||
$smarty->assign("location_parent", $location_parent);
|
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("locationadd.tpl");
|
|
||||||
|
|
||||||
// footer
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,58 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
location_name
|
||||||
include("includes.php");
|
FROM
|
||||||
|
|
||||||
// get id
|
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location.location_name AS location_name
|
|
||||||
FROM
|
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_id=" . $location_id;
|
location_id=" . $location_id;
|
||||||
|
|
||||||
// run query
|
$location = $db->db_select($query);
|
||||||
$location = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_name", $location[0]['location_name']);
|
||||||
$smarty->assign("location_name", $location[0]['location_name']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("locationdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("locationdel.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
133
locationedit.php
133
locationedit.php
@@ -1,96 +1,67 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// location
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location_name,
|
location_name,
|
||||||
location_parent,
|
location_parent,
|
||||||
location_info,
|
location_info,
|
||||||
location_sort
|
location_sort
|
||||||
FROM
|
FROM
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_id=" . $location_id;
|
location_id=" . $location_id;
|
||||||
|
|
||||||
// run query
|
$location = $db->db_select($query);
|
||||||
$location = $db->db_select($query);
|
|
||||||
|
|
||||||
// get parent
|
$location_parent = $location[0]['location_parent'];
|
||||||
$location_parent = $location[0]['location_parent'];
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_name", $location[0]['location_name']);
|
||||||
$smarty->assign("location_name", $location[0]['location_name']);
|
$smarty->assign("location_info", $location[0]['location_info']);
|
||||||
$smarty->assign("location_info", $location[0]['location_info']);
|
$smarty->assign("location_sort", $location[0]['location_sort']);
|
||||||
$smarty->assign("location_sort", $location[0]['location_sort']);
|
|
||||||
|
|
||||||
// setup parent location
|
// parent location
|
||||||
// look for locations
|
$query = "SELECT
|
||||||
// build query
|
location_id,
|
||||||
$query = "SELECT
|
location_name,
|
||||||
location.location_id AS location_id,
|
location_parent
|
||||||
location.location_name AS location_name,
|
FROM
|
||||||
location.location_parent AS location_parent
|
|
||||||
FROM
|
|
||||||
location
|
location
|
||||||
ORDER BY
|
WHERE
|
||||||
location.location_name";
|
location_id != " . $location_id . "
|
||||||
|
ORDER BY
|
||||||
|
location_name";
|
||||||
|
|
||||||
// run query
|
$locations = $db->db_select($query);
|
||||||
$locations = $db->db_select($query);
|
|
||||||
|
|
||||||
// count results
|
$location_counter = count($locations);
|
||||||
$location_counter = count($locations);
|
|
||||||
|
|
||||||
// counter to tpl
|
$smarty->assign("location_counter", $location_counter);
|
||||||
$smarty->assign("location_counter", $location_counter);
|
|
||||||
|
|
||||||
// any loactions?
|
// any loactions?
|
||||||
if ($location_counter>0) {
|
if ($location_counter>0) {
|
||||||
// get objects
|
|
||||||
foreach($locations AS $location) {
|
foreach($locations AS $location) {
|
||||||
// create arrays
|
|
||||||
$location_names[$location['location_id']] = $location['location_name'];
|
$location_names[$location['location_id']] = $location['location_name'];
|
||||||
$parents[$location['location_parent']][] = $location['location_id'];
|
$parents[$location['location_parent']][] = $location['location_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for parents
|
// look for parents
|
||||||
// function to look for parents and create a new array for every child
|
// function to look for parents and create a new array for every child
|
||||||
function location($parents, $parent = 0) {
|
function location($parents, $parent = 0) {
|
||||||
// loop array to check
|
// loop array to check
|
||||||
foreach($parents[$parent] as $child) {
|
foreach($parents[$parent] as $child) {
|
||||||
if(isset($parents[$child])) {
|
if(isset($parents[$child])) {
|
||||||
@@ -104,10 +75,10 @@
|
|||||||
|
|
||||||
// and again...
|
// and again...
|
||||||
return $children;
|
return $children;
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursive children check to template
|
// recursive children check to template
|
||||||
function checkchildren($locations, $level) {
|
function checkchildren($locations, $level) {
|
||||||
global $location_options;
|
global $location_options;
|
||||||
global $location_names;
|
global $location_names;
|
||||||
global $location_parent;
|
global $location_parent;
|
||||||
@@ -119,19 +90,15 @@
|
|||||||
checkchildren($child, $level+1);
|
checkchildren($child, $level+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tree = location($parents);
|
$tree = location($parents);
|
||||||
$location_options = array(0 => '-');
|
$location_options = array(0 => '-');
|
||||||
checkchildren($tree, 0);
|
checkchildren($tree, 0);
|
||||||
$smarty->assign("location_options", $location_options);
|
$smarty->assign("location_options", $location_options);
|
||||||
$smarty->assign("location_parent", $location_parent);
|
$smarty->assign("location_parent", $location_parent);
|
||||||
|
|
||||||
|
$smarty->display("locationedit.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("locationedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,60 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
location_name
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location.location_name AS location_name
|
|
||||||
FROM
|
FROM
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_id=" . $location_id;
|
location_id=" . $location_id;
|
||||||
|
|
||||||
// run query
|
$location = $db->db_select($query);
|
||||||
$location = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_name", $location[0]['location_name']);
|
$smarty->assign("location_name", $location[0]['location_name']);
|
||||||
|
$smarty->assign("subnet_options", $db->options_subnet());
|
||||||
|
$smarty->display("locationsubnetadd.tpl");
|
||||||
|
|
||||||
// setup subnet
|
include("footer.php");
|
||||||
$smarty->assign("subnet_options", $db->options_subnet());
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("locationsubnetadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,76 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// location
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
location_name
|
||||||
|
FROM
|
||||||
// get ip and id
|
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location.location_name AS location_name
|
|
||||||
FROM
|
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_id=" . $location_id;
|
location_id=" . $location_id;
|
||||||
|
|
||||||
// run query
|
$location = $db->db_select($query);
|
||||||
$location = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_name", $location[0]['location_name']);
|
$smarty->assign("location_name", $location[0]['location_name']);
|
||||||
|
|
||||||
// setup subnet
|
// subnet
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
s.subnet_id,
|
||||||
subnet.subnet_id AS subnet_id,
|
s.subnet_address,
|
||||||
subnet.subnet_address AS subnet_address,
|
s.subnet_mask
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnetlocation,
|
subnetlocation AS l LEFT JOIN subnet AS s USING (subnet_id)
|
||||||
subnet
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetlocation.location_id=" . $location_id . "
|
l.location_id=" . $location_id . "
|
||||||
AND subnet.subnet_id=subnetlocation.subnet_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(subnet.subnet_address)";
|
INET_ATON(s.subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
$smarty->assign($subnets);
|
||||||
$smarty->assign($subnets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("locationsubnetdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("locationsubnetdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,58 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
// location
|
||||||
*****************************************************************************/
|
$query = "SELECT
|
||||||
|
location_name
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup location
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
location.location_name AS location_name
|
|
||||||
FROM
|
FROM
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_id=" . $location_id;
|
location_id=" . $location_id;
|
||||||
|
|
||||||
// run query
|
$location = $db->db_select($query);
|
||||||
$location = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_name", $location[0]['location_name']);
|
||||||
$smarty->assign("location_name", $location[0]['location_name']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("locationsubnetedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("locationsubnetedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
100
locationview.php
100
locationview.php
@@ -1,52 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$location_id = sanitize($_GET['location_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
// locationcrumb
|
||||||
$location_id = sanitize($_GET['location_id']);
|
|
||||||
|
|
||||||
// start output
|
$query = "SELECT location_id AS id,
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// start locationcrumb
|
|
||||||
// get location crumbs
|
|
||||||
|
|
||||||
$query = "SELECT location_id AS id,
|
|
||||||
location_name AS name,
|
location_name AS name,
|
||||||
location_parent AS parent_id,
|
location_parent AS parent_id,
|
||||||
location_info
|
location_info
|
||||||
FROM location
|
FROM location
|
||||||
WHERE location_id=" . $location_id;
|
WHERE location_id=" . $location_id;
|
||||||
$location = $db->db_select($query);
|
$location = $db->db_select($query);
|
||||||
$location[0]['url'] = 'locationview.php?location_id=' . $location[0]['id'];
|
$location[0]['url'] = 'locationview.php?location_id=' . $location[0]['id'];
|
||||||
$crumbs[] = $location[0];
|
$crumbs[] = $location[0];
|
||||||
$level = 1;
|
$level = 1;
|
||||||
while ($crumbs[0]['parent_id'] != 0) {
|
while ($crumbs[0]['parent_id'] != 0) {
|
||||||
$query = "SELECT location_id AS id,
|
$query = "SELECT location_id AS id,
|
||||||
location_name AS name,
|
location_name AS name,
|
||||||
location_parent AS parent_id
|
location_parent AS parent_id
|
||||||
@@ -56,17 +36,15 @@
|
|||||||
$result[0]['url'] = 'locationview.php?location_id=' . $result[0]['id'];
|
$result[0]['url'] = 'locationview.php?location_id=' . $result[0]['id'];
|
||||||
array_unshift($crumbs, $result[0]);
|
array_unshift($crumbs, $result[0]);
|
||||||
$level++;
|
$level++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("location_id", $location_id);
|
||||||
$smarty->assign("location_id", $location_id);
|
$smarty->assign("location_info", nl2br($location[0]['location_info']));
|
||||||
$smarty->assign("location_info", nl2br($location[0]['location_info']));
|
$smarty->assign("crumbs", $crumbs);
|
||||||
$smarty->assign("crumbs", $crumbs);
|
|
||||||
|
|
||||||
|
|
||||||
// setup sublocations
|
// sublocations
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
|
||||||
location_id AS sublocation_id,
|
location_id AS sublocation_id,
|
||||||
location_name AS sublocation_name,
|
location_name AS sublocation_name,
|
||||||
LEFT(location_info, 40) AS info_short,
|
LEFT(location_info, 40) AS info_short,
|
||||||
@@ -78,33 +56,25 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
location_name";
|
location_name";
|
||||||
|
|
||||||
// run query
|
$sublocations = $db->db_select($query);
|
||||||
$sublocations = $db->db_select($query);
|
$smarty->assign("sublocations", $sublocations);
|
||||||
$smarty->assign("sublocations", $sublocations);
|
|
||||||
|
|
||||||
// setup subnets
|
// subnets
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
s.subnet_id,
|
||||||
subnet.subnet_id AS subnet_id,
|
s.subnet_address,
|
||||||
subnet.subnet_address AS subnet_address,
|
s.subnet_mask
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet,
|
subnet AS s LEFT JOIN subnetlocation USING (subnet_id)
|
||||||
subnetlocation
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetlocation.location_id=" . $location_id . "
|
subnetlocation.location_id=" . $location_id . "
|
||||||
AND subnetlocation.subnet_id=subnet.subnet_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(subnet.subnet_address)";
|
INET_ATON(s.subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
$smarty->assign("subnets", $subnets);
|
||||||
$smarty->assign("subnets", $subnets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("locationview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("locationview.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
72
login.php
72
login.php
@@ -1,49 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
session_name('ipreg');
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
session_start();
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("config.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
include("dbconnect.php");
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("lib.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// session
|
// include language file
|
||||||
// start session
|
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
|
||||||
session_name('ipreg');
|
include('lang/' . $language . '.php');
|
||||||
session_start();
|
|
||||||
|
|
||||||
// headers
|
// check for submit
|
||||||
// raw http headers
|
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
|
||||||
header("Content-Type: text/html; charset=utf-8");
|
|
||||||
|
|
||||||
// includes
|
|
||||||
// includes
|
|
||||||
include("config.php");
|
|
||||||
include("dbconnect.php");
|
|
||||||
|
|
||||||
// load lib
|
|
||||||
include("lib.php");
|
|
||||||
|
|
||||||
// include language file
|
|
||||||
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
|
|
||||||
include('lang/' . $language . '.php');
|
|
||||||
|
|
||||||
// try login?
|
|
||||||
// check for submit
|
|
||||||
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
|
|
||||||
/// get post info
|
/// get post info
|
||||||
$user_name = sanitize($_POST['user_name']);
|
$user_name = sanitize($_POST['user_name']);
|
||||||
$user_pass = sanitize($_POST['user_pass']);
|
$user_pass = sanitize($_POST['user_pass']);
|
||||||
@@ -59,19 +36,12 @@
|
|||||||
$_SESSION = array();
|
$_SESSION = array();
|
||||||
session_destroy();
|
session_destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// start output
|
$smarty->assign("config_version", $config_version);
|
||||||
// get version for the footer-stamp
|
$smarty->assign($lang);
|
||||||
$smarty->assign("config_version", $config_version);
|
|
||||||
|
|
||||||
// set language variables
|
$smarty->display("login.tpl");
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("login.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
38
logout.php
38
logout.php
@@ -1,33 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
// user logout: clear session
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
$_SESSION = array();
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
// redirect to start page
|
||||||
or contact me at wietsew@users.sourceforge.net
|
header("Location: index.php");
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// logout
|
|
||||||
// user logout
|
|
||||||
$user->user_logout();
|
|
||||||
|
|
||||||
// redirect
|
|
||||||
header("Location: index.php");
|
|
||||||
?>
|
?>
|
||||||
99
natadd.php
99
natadd.php
@@ -1,64 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_id = sanitize($_GET['node_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// node_ext
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
node_ip AS node_ip_ext
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$node_id = sanitize($_GET['node_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node_ext
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
node.node_ip AS node_ip_ext
|
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.node_id=" . $node_id;
|
node_id=" . $node_id;
|
||||||
|
|
||||||
// run query
|
$node = $db->db_select($query);
|
||||||
$node = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("node_id_ext", $node_id);
|
$smarty->assign("node_id_ext", $node_id);
|
||||||
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
|
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
|
||||||
|
|
||||||
// setup node_int
|
// node_int
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
a.asset_name,
|
||||||
asset.asset_name AS asset_name,
|
n.node_id AS node_id_int,
|
||||||
node.node_id AS node_id_int,
|
n.node_ip AS node_ip_int
|
||||||
node.node_ip AS node_ip_int
|
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset AS a LEFT JOIN node AS n USING (asset_id)
|
||||||
node
|
|
||||||
WHERE
|
WHERE
|
||||||
node.node_id NOT IN (
|
n.node_id NOT IN (
|
||||||
SELECT
|
SELECT
|
||||||
nat_int
|
nat_int
|
||||||
FROM
|
FROM
|
||||||
@@ -66,27 +42,22 @@
|
|||||||
WHERE
|
WHERE
|
||||||
nat_ext=" . $node_id . "
|
nat_ext=" . $node_id . "
|
||||||
)
|
)
|
||||||
AND node.node_id!=" . $node_id . "
|
AND n.node_id!=" . $node_id . "
|
||||||
AND asset.asset_id=node.asset_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(n.node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
foreach ($nodes as $rec) {
|
||||||
foreach ($nodes as $rec) {
|
|
||||||
$node_options[$rec['node_id_int']] = $rec['node_ip_int'] . '/' . $rec['asset_name'];
|
$node_options[$rec['node_id_int']] = $rec['node_ip_int'] . '/' . $rec['asset_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("node_options", $node_options);
|
$smarty->assign("node_options", $node_options);
|
||||||
|
|
||||||
$nat_type_options[1] = $lang['lang_nat_type_1'];
|
$nat_type_options[1] = $lang['lang_nat_type_1'];
|
||||||
$nat_type_options[2] = $lang['lang_nat_type_2'];
|
$nat_type_options[2] = $lang['lang_nat_type_2'];
|
||||||
$nat_type_options[3] = $lang['lang_nat_type_3'];
|
$nat_type_options[3] = $lang['lang_nat_type_3'];
|
||||||
$smarty->assign("nat_type_options", $nat_type_options);
|
$smarty->assign("nat_type_options", $nat_type_options);
|
||||||
|
|
||||||
// end page
|
$smarty->display("natadd.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("natadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
97
natdel.php
97
natdel.php
@@ -1,80 +1,55 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_id = sanitize($_GET['node_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// node_ext
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
node_ip AS node_ip_ext
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$node_id = sanitize($_GET['node_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node_ext
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
node.node_ip AS node_ip_ext
|
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.node_id=" . $node_id;
|
node_id=" . $node_id;
|
||||||
|
|
||||||
// run query
|
$node = $db->db_select($query);
|
||||||
$node = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("node_id_ext", $node_id);
|
$smarty->assign("node_id_ext", $node_id);
|
||||||
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
|
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
|
||||||
|
|
||||||
// setup node
|
// options
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
a.asset_name,
|
||||||
asset.asset_name AS asset_name,
|
n.node_ip,
|
||||||
node.node_id AS node_id_int,
|
x.nat_ext
|
||||||
node.node_ip AS node_ip_int
|
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset AS a,
|
||||||
nat,
|
nat AS x,
|
||||||
node
|
node AS n
|
||||||
WHERE
|
WHERE
|
||||||
nat.nat_ext=" . $node_id . "
|
x.nat_ext=" . $node_id . "
|
||||||
AND node.node_id=nat.nat_int
|
AND n.node_id=x.nat_int
|
||||||
AND asset.asset_id=node.asset_id
|
AND a.asset_id=n.asset_id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(n.node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
|
||||||
$smarty->assign("nodes", $nodes);
|
|
||||||
|
|
||||||
// *** <option value="{node_id_int}">{node_ip_int}/{asset_name}</option>
|
$options = array();
|
||||||
|
foreach ($nodes as $rec) {
|
||||||
|
$options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name'];
|
||||||
|
}
|
||||||
|
$smarty->assign("nat_options", $options);
|
||||||
|
$smarty->display("natdel.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("natdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
62
natedit.php
62
natedit.php
@@ -1,57 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_id = sanitize($_GET['node_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
node_ip
|
||||||
include("includes.php");
|
FROM
|
||||||
|
|
||||||
// get id
|
|
||||||
$node_id = sanitize($_GET['node_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
node.node_ip AS node_ip
|
|
||||||
FROM
|
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.node_id=" . $node_id;
|
node.node_id=" . $node_id;
|
||||||
|
|
||||||
// run query
|
$node = $db->db_select($query);
|
||||||
$node = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("node_id", $node_id);
|
$smarty->assign("node_id", $node_id);
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']);
|
$smarty->assign("node_ip", $node[0]['node_ip']);
|
||||||
|
|
||||||
// end page
|
$smarty->display("natedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("natedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
74
node.php
74
node.php
@@ -1,78 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if(isset($_GET['subnet_id'])) {
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// start node
|
|
||||||
// setup view
|
|
||||||
// subnet
|
|
||||||
if(isset($_GET['subnet_id'])) {
|
|
||||||
// get id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
|
$subnet_view = "WHERE node.subnet_id=" . $subnet_id;
|
||||||
// build query part
|
|
||||||
$subnet_view = "AND node.subnet_id=" . $subnet_id;
|
|
||||||
|
|
||||||
// to tpl
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
} else {
|
} else {
|
||||||
// to tpl
|
|
||||||
$smarty->assign("subnet_id", "");
|
$smarty->assign("subnet_id", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_id,
|
asset.asset_id,
|
||||||
REPLACE(asset.asset_name, ' ', ' ') AS asset_name,
|
REPLACE(asset.asset_name, ' ', ' ') AS asset_name,
|
||||||
asset.asset_info,
|
asset.asset_info,
|
||||||
node.node_id,
|
node.node_id,
|
||||||
node.node_ip
|
node.node_ip
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset LEFT JOIN node USING (asset_id)
|
||||||
node
|
|
||||||
WHERE
|
|
||||||
asset.asset_id=node.asset_id
|
|
||||||
" . $subnet_view . "
|
" . $subnet_view . "
|
||||||
GROUP BY
|
GROUP BY
|
||||||
node.node_id
|
node.node_id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(node.node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
$smarty->assign("nodes", $nodes);
|
||||||
$smarty->assign("nodes", $nodes);
|
$smarty->display("node.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("node.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
62
nodeadd.php
62
nodeadd.php
@@ -1,54 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if ((isset($_GET['node_ip'])) ? $node_ip = sanitize($_GET['node_ip']) : $node_ip = '');
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
if ((isset($_GET['subnet_id'])) ? $subnet_id = sanitize($_GET['subnet_id']) : $subnet_id = '');
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']);
|
||||||
// includes
|
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
|
||||||
include("includes.php");
|
$smarty->assign("node_ip", $node_ip);
|
||||||
|
|
||||||
// check for set ip and/or subnet_id
|
$smarty->assign("subnet_options", $db->options_subnet());
|
||||||
if ((isset($_GET['node_ip'])) ? $node_ip = sanitize($_GET['node_ip']) : $node_ip = '');
|
$smarty->assign("assetclass_options", $db->options_assetclass());
|
||||||
if ((isset($_GET['subnet_id'])) ? $subnet_id = sanitize($_GET['subnet_id']) : $subnet_id = '');
|
$smarty->display("nodeadd.tpl");
|
||||||
|
|
||||||
// start output
|
include("footer.php");
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// set vars
|
|
||||||
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']);
|
|
||||||
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
|
|
||||||
$smarty->assign("node_ip", $node_ip);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
$smarty->assign("subnet_options", $db->options_subnet());
|
|
||||||
|
|
||||||
// setup assetclass
|
|
||||||
$smarty->assign("assetclass_options", $db->options_assetclass());
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("nodeadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
67
nodedel.php
67
nodedel.php
@@ -1,60 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_id = sanitize($_GET['node_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
asset_id,
|
||||||
include("includes.php");
|
node_ip
|
||||||
|
|
||||||
// get id
|
|
||||||
$node_id = sanitize($_GET['node_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
node.asset_id AS asset_id,
|
|
||||||
node.node_ip AS node_ip
|
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.node_id=" . $node_id;
|
node_id=" . $node_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$node = $db->db_select($query);
|
$node = $db->db_select($query);
|
||||||
|
|
||||||
// send to tpl
|
// send to tpl
|
||||||
$smarty->assign("node_id", $node_id);
|
$smarty->assign("node_id", $node_id);
|
||||||
$smarty->assign("asset_id", $node[0]['asset_id']);
|
$smarty->assign("asset_id", $node[0]['asset_id']);
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']);
|
$smarty->assign("node_ip", $node[0]['node_ip']);
|
||||||
|
|
||||||
// end page
|
$smarty->display("nodedel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("nodedel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
112
nodeedit.php
112
nodeedit.php
@@ -1,86 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$node_id = sanitize($_GET['node_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
a.asset_id,
|
||||||
include("includes.php");
|
n.node_id,
|
||||||
|
n.node_ip,
|
||||||
// get id
|
n.node_mac,
|
||||||
$node_id = sanitize($_GET['node_id']);
|
n.node_dns1,
|
||||||
|
n.node_dns2,
|
||||||
// start output
|
n.node_info,
|
||||||
include("header.php");
|
s.subnet_id,
|
||||||
|
n.zone_id
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_id AS asset_id,
|
|
||||||
node.node_id AS node_id,
|
|
||||||
node.node_ip AS node_ip,
|
|
||||||
node.node_mac AS node_mac,
|
|
||||||
node.node_dns1 AS node_dns1,
|
|
||||||
node.node_dns2 AS node_dns2,
|
|
||||||
node.node_info AS node_info,
|
|
||||||
subnet.subnet_id AS subnet_id,
|
|
||||||
node.zone_id AS zone_id
|
|
||||||
FROM
|
FROM
|
||||||
asset,
|
asset AS a,
|
||||||
node,
|
node AS n,
|
||||||
subnet
|
subnet AS s
|
||||||
WHERE
|
WHERE
|
||||||
asset.asset_id=node.asset_id
|
a.asset_id=n.asset_id
|
||||||
AND node.node_id=" . $node_id . "
|
AND n.node_id=" . $node_id . "
|
||||||
AND subnet.subnet_id=node.subnet_id";
|
AND s.subnet_id=n.subnet_id";
|
||||||
|
|
||||||
// run query
|
$node = $db->db_select($query);
|
||||||
$node = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("node_id", $node[0]['node_id']);
|
||||||
$smarty->assign("node_id", $node[0]['node_id']);
|
$smarty->assign("node_ip", $node[0]['node_ip']);
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']);
|
$smarty->assign("node_mac", write_mac($node[0]['node_mac']));
|
||||||
$smarty->assign("node_mac", write_mac($node[0]['node_mac']));
|
$smarty->assign("node_dns1", $node[0]['node_dns1']);
|
||||||
$smarty->assign("node_dns1", $node[0]['node_dns1']);
|
$smarty->assign("node_dns2", $node[0]['node_dns2']);
|
||||||
$smarty->assign("node_dns2", $node[0]['node_dns2']);
|
$smarty->assign("node_info", $node[0]['node_info']);
|
||||||
$smarty->assign("node_info", $node[0]['node_info']);
|
$smarty->assign("asset_id", $node[0]['asset_id']);
|
||||||
$smarty->assign("asset_id", $node[0]['asset_id']);
|
$smarty->assign("subnet_id", $node[0]['subnet_id']);
|
||||||
$smarty->assign("subnet_id", $node[0]['subnet_id']);
|
$smarty->assign("zone_id", $node[0]['zone_id']);
|
||||||
$smarty->assign("zone_id", $node[0]['zone_id']);
|
|
||||||
|
|
||||||
// setup asset
|
$smarty->assign("asset_options", $db->options_asset());
|
||||||
$smarty->assign("asset_options", $db->options_asset());
|
$smarty->assign("subnet_options", $db->options_subnet());
|
||||||
|
$smarty->assign("zone_options", $db->options_zone("(keine)"));
|
||||||
|
|
||||||
// setup subnet
|
$smarty->display("nodeedit.tpl");
|
||||||
$smarty->assign("subnet_options", $db->options_subnet());
|
|
||||||
|
|
||||||
// setup zone
|
include("footer.php");
|
||||||
$smarty->assign("zone_options", $db->options_zone("(keine)"));
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("nodeedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
84
nodeview.php
84
nodeview.php
@@ -1,41 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if (isset($_GET['node_id']) && (!empty($_GET['node_id']))) {
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$node_id = sanitize($_GET['node_id']);
|
$node_id = sanitize($_GET['node_id']);
|
||||||
|
} else {
|
||||||
|
// redirect to error page
|
||||||
|
header_location("comments.php?comments=error");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// start output
|
include("header.php");
|
||||||
include("header.php");
|
// node
|
||||||
|
$query = "SELECT
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup node
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_id,
|
asset.asset_id,
|
||||||
asset.asset_name,
|
asset.asset_name,
|
||||||
node.node_id,
|
node.node_id,
|
||||||
@@ -57,14 +41,12 @@
|
|||||||
WHERE
|
WHERE
|
||||||
node.node_id=" . $node_id;
|
node.node_id=" . $node_id;
|
||||||
|
|
||||||
// run query
|
$node = $db->db_select($query);
|
||||||
$node = $db->db_select($query);
|
$node[0]['node_mac'] = write_mac($node[0]['node_mac']);
|
||||||
$node[0]['node_mac'] = write_mac($node[0]['node_mac']);
|
$smarty->assign("node", $node[0]);
|
||||||
$smarty->assign("node", $node[0]);
|
|
||||||
|
|
||||||
// setup nat
|
// nat
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
|
||||||
asset_ext.asset_id AS asset_id_ext,
|
asset_ext.asset_id AS asset_id_ext,
|
||||||
asset_int.asset_id AS asset_id_int,
|
asset_int.asset_id AS asset_id_int,
|
||||||
asset_ext.asset_name AS asset_name_ext,
|
asset_ext.asset_name AS asset_name_ext,
|
||||||
@@ -74,13 +56,15 @@
|
|||||||
nat.nat_ext AS nat_ext,
|
nat.nat_ext AS nat_ext,
|
||||||
nat.nat_int AS nat_int,
|
nat.nat_int AS nat_int,
|
||||||
node_ext.node_ip AS node_ip_ext,
|
node_ext.node_ip AS node_ip_ext,
|
||||||
node_int.node_ip AS node_ip_int
|
node_int.node_ip AS node_ip_int,
|
||||||
|
node_int.node_id AS node_id_int,
|
||||||
|
node_ext.node_id AS node_id_ext
|
||||||
FROM
|
FROM
|
||||||
asset asset_ext,
|
asset AS asset_ext,
|
||||||
asset asset_int,
|
asset AS asset_int,
|
||||||
nat,
|
nat,
|
||||||
node node_ext,
|
node AS node_ext,
|
||||||
node node_int
|
node AS node_int
|
||||||
WHERE
|
WHERE
|
||||||
(nat.nat_ext=" . $node_id . "
|
(nat.nat_ext=" . $node_id . "
|
||||||
OR nat.nat_int=" . $node_id . ")
|
OR nat.nat_int=" . $node_id . ")
|
||||||
@@ -92,14 +76,10 @@
|
|||||||
INET_ATON(node_ext.node_ip),
|
INET_ATON(node_ext.node_ip),
|
||||||
INET_ATON(node_int.node_ip)";
|
INET_ATON(node_int.node_ip)";
|
||||||
|
|
||||||
// run query
|
$natrules = $db->db_select($query);
|
||||||
$natrules = $db->db_select($query);
|
$smarty->assign("natrules", $natrules);
|
||||||
// counter to tpl
|
|
||||||
$smarty->assign("natrules", $natrules);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("nodeview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("nodeview.tpl");
|
|
||||||
|
|
||||||
include("footer.php");
|
include("footer.php");
|
||||||
?>
|
?>
|
||||||
|
|||||||
43
options.php
43
options.php
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("options.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("options.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,123 +1,99 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$smarty->assign("language", $language);
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
if($_SESSION['suser_menu_assets']=='on') {
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
$smarty->assign("language", $language);
|
|
||||||
|
|
||||||
// setup options
|
|
||||||
// set menu checkboxes
|
|
||||||
// assets
|
|
||||||
if($_SESSION['suser_menu_assets']=='on') {
|
|
||||||
$user_menu_assets_checked = 'checked';
|
$user_menu_assets_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_assets_checked = '';
|
$user_menu_assets_checked = '';
|
||||||
}
|
}
|
||||||
// assetclasses
|
// assetclasses
|
||||||
if($_SESSION['suser_menu_assetclasses']=='on') {
|
if($_SESSION['suser_menu_assetclasses']=='on') {
|
||||||
$user_menu_assetclasses_checked = 'checked';
|
$user_menu_assetclasses_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_assetclasses_checked = '';
|
$user_menu_assetclasses_checked = '';
|
||||||
}
|
}
|
||||||
// assetclassgroups
|
// assetclassgroups
|
||||||
if($_SESSION['suser_menu_assetclassgroups']=='on') {
|
if($_SESSION['suser_menu_assetclassgroups']=='on') {
|
||||||
$user_menu_assetclassgroups_checked = 'checked';
|
$user_menu_assetclassgroups_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_assetclassgroups_checked = '';
|
$user_menu_assetclassgroups_checked = '';
|
||||||
}
|
}
|
||||||
// locations
|
// locations
|
||||||
if($_SESSION['suser_menu_locations']=='on') {
|
if($_SESSION['suser_menu_locations']=='on') {
|
||||||
$user_menu_locations_checked = 'checked';
|
$user_menu_locations_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_locations_checked = '';
|
$user_menu_locations_checked = '';
|
||||||
}
|
}
|
||||||
// nodes
|
// nodes
|
||||||
if($_SESSION['suser_menu_nodes']=='on') {
|
if($_SESSION['suser_menu_nodes']=='on') {
|
||||||
$user_menu_nodes_checked = 'checked';
|
$user_menu_nodes_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_nodes_checked = '';
|
$user_menu_nodes_checked = '';
|
||||||
}
|
}
|
||||||
// subnets
|
// subnets
|
||||||
if($_SESSION['suser_menu_subnets']=='on') {
|
if($_SESSION['suser_menu_subnets']=='on') {
|
||||||
$user_menu_subnets_checked = 'checked';
|
$user_menu_subnets_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_subnets_checked = '';
|
$user_menu_subnets_checked = '';
|
||||||
}
|
}
|
||||||
// users
|
// users
|
||||||
if($_SESSION['suser_menu_users']=='on') {
|
if($_SESSION['suser_menu_users']=='on') {
|
||||||
$user_menu_users_checked = 'checked';
|
$user_menu_users_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_users_checked = '';
|
$user_menu_users_checked = '';
|
||||||
}
|
}
|
||||||
// vlans
|
// vlans
|
||||||
if($_SESSION['suser_menu_vlans']=='on') {
|
if($_SESSION['suser_menu_vlans']=='on') {
|
||||||
$user_menu_vlans_checked = 'checked';
|
$user_menu_vlans_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_vlans_checked = '';
|
$user_menu_vlans_checked = '';
|
||||||
}
|
}
|
||||||
// zones
|
// zones
|
||||||
if($_SESSION['suser_menu_zones']=='on') {
|
if($_SESSION['suser_menu_zones']=='on') {
|
||||||
$user_menu_zones_checked = 'checked';
|
$user_menu_zones_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_menu_zones_checked = '';
|
$user_menu_zones_checked = '';
|
||||||
}
|
}
|
||||||
// tooltips
|
// tooltips
|
||||||
if($_SESSION['suser_tooltips']=='on') {
|
if($_SESSION['suser_tooltips']=='on') {
|
||||||
$user_tooltips_checked = 'checked';
|
$user_tooltips_checked = 'checked';
|
||||||
} else {
|
} else {
|
||||||
$user_tooltips_checked = '';
|
$user_tooltips_checked = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("user_id", $_SESSION['suser_id']);
|
||||||
$smarty->assign("user_id", $_SESSION['suser_id']);
|
$smarty->assign("user_imagesize", $_SESSION['suser_imagesize']);
|
||||||
$smarty->assign("user_imagesize", $_SESSION['suser_imagesize']);
|
$smarty->assign("user_imagecount", $_SESSION['suser_imagecount']);
|
||||||
$smarty->assign("user_imagecount", $_SESSION['suser_imagecount']);
|
$smarty->assign("user_mac", $_SESSION['suser_mac']);
|
||||||
$smarty->assign("user_mac", $_SESSION['suser_mac']);
|
$smarty->assign("user_dateformat", $_SESSION['suser_dateformat']);
|
||||||
$smarty->assign("user_dateformat", $_SESSION['suser_dateformat']);
|
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']);
|
||||||
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']);
|
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
|
||||||
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
|
$smarty->assign("user_language", $_SESSION['suser_language']);
|
||||||
$smarty->assign("user_language", $_SESSION['suser_language']);
|
$smarty->assign("user_menu_assets_checked", $user_menu_assets_checked);
|
||||||
$smarty->assign("user_menu_assets_checked", $user_menu_assets_checked);
|
$smarty->assign("user_menu_assetclasses_checked", $user_menu_assetclasses_checked);
|
||||||
$smarty->assign("user_menu_assetclasses_checked", $user_menu_assetclasses_checked);
|
$smarty->assign("user_menu_assetclassgroups_checked", $user_menu_assetclassgroups_checked);
|
||||||
$smarty->assign("user_menu_assetclassgroups_checked", $user_menu_assetclassgroups_checked);
|
$smarty->assign("user_menu_locations_checked", $user_menu_locations_checked);
|
||||||
$smarty->assign("user_menu_locations_checked", $user_menu_locations_checked);
|
$smarty->assign("user_menu_nodes_checked", $user_menu_nodes_checked);
|
||||||
$smarty->assign("user_menu_nodes_checked", $user_menu_nodes_checked);
|
$smarty->assign("user_menu_subnets_checked", $user_menu_subnets_checked);
|
||||||
$smarty->assign("user_menu_subnets_checked", $user_menu_subnets_checked);
|
$smarty->assign("user_menu_users_checked", $user_menu_users_checked);
|
||||||
$smarty->assign("user_menu_users_checked", $user_menu_users_checked);
|
$smarty->assign("user_menu_vlans_checked", $user_menu_vlans_checked);
|
||||||
$smarty->assign("user_menu_vlans_checked", $user_menu_vlans_checked);
|
$smarty->assign("user_menu_zones_checked", $user_menu_zones_checked);
|
||||||
$smarty->assign("user_menu_zones_checked", $user_menu_zones_checked);
|
$smarty->assign("user_tooltips_checked", $user_tooltips_checked);
|
||||||
$smarty->assign("user_tooltips_checked", $user_tooltips_checked);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("optionseditdisplay.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("optionseditdisplay.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("optionseditpassword.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("optionseditpassword.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
131
search.php
131
search.php
@@ -1,40 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
// get string that was searched for ($search is already set in header.php)
|
||||||
or contact me at wietsew@users.sourceforge.net
|
if (empty($search)) {
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// get string that was searched for ($search is already set in header.php)
|
|
||||||
if (empty($search)) {
|
|
||||||
// parse nosearch box
|
// parse nosearch box
|
||||||
$smarty->assign("nosearch", TRUE);
|
$smarty->assign("nosearch", TRUE);
|
||||||
} else {
|
} else {
|
||||||
// hide nosearch box
|
// hide nosearch box
|
||||||
$smarty->assign("nosearch", FALSE);
|
$smarty->assign("nosearch", FALSE);
|
||||||
$smarty->assign("search", $search);
|
$smarty->assign("search", $search);
|
||||||
@@ -45,103 +26,93 @@
|
|||||||
// set counter
|
// set counter
|
||||||
$resultcounter = 0;
|
$resultcounter = 0;
|
||||||
|
|
||||||
// setup asset
|
// asset
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
asset.asset_id AS id,
|
asset_id AS id,
|
||||||
asset.asset_name AS name,
|
asset_name AS name,
|
||||||
asset.asset_info AS description
|
asset_info AS description
|
||||||
FROM
|
FROM
|
||||||
asset
|
asset
|
||||||
WHERE
|
WHERE
|
||||||
asset.asset_name LIKE '" . $needle . "'
|
asset_name LIKE '" . $needle . "'
|
||||||
OR asset.asset_hostname LIKE '" . $needle . "'
|
OR asset_hostname LIKE '" . $needle . "'
|
||||||
OR asset.asset_info LIKE '" . $needle . "'
|
OR asset_info LIKE '" . $needle . "'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
asset.asset_name";
|
asset_name";
|
||||||
|
|
||||||
// run query
|
|
||||||
$assets = $db->db_select($query);
|
$assets = $db->db_select($query);
|
||||||
$resultcounter += count($assets);
|
$resultcounter += count($assets);
|
||||||
$smarty->assign("assets", $assets);
|
$smarty->assign("assets", $assets);
|
||||||
|
|
||||||
// setup location
|
// location
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
location.location_id AS id,
|
location_id AS id,
|
||||||
location.location_name AS name
|
location_name AS name
|
||||||
FROM
|
FROM
|
||||||
location
|
location
|
||||||
WHERE
|
WHERE
|
||||||
location.location_name LIKE '" . $needle . "'
|
location_name LIKE '" . $needle . "'
|
||||||
OR location.location_info LIKE '" . $needle . "'
|
OR location_info LIKE '" . $needle . "'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
location.location_name";
|
location_name";
|
||||||
|
|
||||||
// run query
|
|
||||||
$locations = $db->db_select($query);
|
$locations = $db->db_select($query);
|
||||||
$resultcounter += count($locations);
|
$resultcounter += count($locations);
|
||||||
$smarty->assign("locations", $locations);
|
$smarty->assign("locations", $locations);
|
||||||
|
|
||||||
// setup node
|
// node
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
node.node_id AS id,
|
node_id AS id,
|
||||||
node.node_ip AS ip
|
node_ip AS ip
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.node_ip LIKE '" . $needle . "'
|
node_ip LIKE '" . $needle . "'
|
||||||
OR node.node_mac LIKE '" . $needle . "'
|
OR node_mac LIKE '" . $needle . "'
|
||||||
OR node.node_dns1 LIKE '" . $needle . "'
|
OR node_dns1 LIKE '" . $needle . "'
|
||||||
OR node.node_dns2 LIKE '" . $needle . "'
|
OR node_dns2 LIKE '" . $needle . "'
|
||||||
OR node.node_info LIKE '" . $needle . "'
|
OR node_info LIKE '" . $needle . "'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
node.node_ip";
|
node_ip";
|
||||||
|
|
||||||
// run query
|
|
||||||
$nodes = $db->db_select($query);
|
$nodes = $db->db_select($query);
|
||||||
$resultcounter += count($nodes);
|
$resultcounter += count($nodes);
|
||||||
$smarty->assign("nodes", $nodes);
|
$smarty->assign("nodes", $nodes);
|
||||||
|
|
||||||
// setup subnet
|
// subnet
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
subnet.subnet_id AS id,
|
subnet_id AS id,
|
||||||
subnet.subnet_address AS address
|
subnet_address AS address
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_address LIKE '" . $needle . "'
|
subnet_address LIKE '" . $needle . "'
|
||||||
OR subnet.subnet_info LIKE '" . $needle . "'
|
OR subnet_info LIKE '" . $needle . "'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
subnet.subnet_address";
|
subnet_address";
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$subnets = $db->db_select($query);
|
$subnets = $db->db_select($query);
|
||||||
$resultcounter += count($subnets);
|
$resultcounter += count($subnets);
|
||||||
$smarty->assign("subnets", $subnets);
|
$smarty->assign("subnets", $subnets);
|
||||||
|
|
||||||
// setup vlan
|
// vlan
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
vlan.vlan_id AS id,
|
vlan_id AS id,
|
||||||
vlan.vlan_name AS name
|
vlan_name AS name
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_name LIKE '" . $needle . "'
|
vlan_name LIKE '" . $needle . "'
|
||||||
OR vlan.vlan_info LIKE '" . $needle . "'
|
OR vlan_info LIKE '" . $needle . "'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_name";
|
vlan_name";
|
||||||
|
|
||||||
// run query
|
|
||||||
$vlans = $db->db_select($query);
|
$vlans = $db->db_select($query);
|
||||||
$resultcounter += count($vlans);
|
$resultcounter += count($vlans);
|
||||||
$smarty->assign("vlans", $vlans);
|
$smarty->assign("vlans", $vlans);
|
||||||
|
|
||||||
// setup zone
|
// setup zone
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
$query = "SELECT
|
||||||
zone_id AS id,
|
zone_id AS id,
|
||||||
zone_origin AS origin
|
zone_origin AS origin
|
||||||
@@ -160,19 +131,15 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
zone_origin";
|
zone_origin";
|
||||||
|
|
||||||
// run query
|
|
||||||
$zones = $db->db_select($query);
|
$zones = $db->db_select($query);
|
||||||
$resultcounter += count($zones);
|
$resultcounter += count($zones);
|
||||||
$smarty->assign("zones", $zones);
|
$smarty->assign("zones", $zones);
|
||||||
|
|
||||||
// grand totals
|
// grand totals
|
||||||
$smarty->assign("resultcounter", $resultcounter);
|
$smarty->assign("resultcounter", $resultcounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// end page
|
$smarty->display("search.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("search.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
547
submit.php
547
submit.php
File diff suppressed because it is too large
Load Diff
58
subnet.php
58
subnet.php
@@ -1,38 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$query = "SELECT
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
s.subnet_id,
|
s.subnet_id,
|
||||||
s.subnet_address,
|
s.subnet_address,
|
||||||
s.subnet_mask,
|
s.subnet_mask,
|
||||||
@@ -41,24 +19,16 @@
|
|||||||
CHAR_LENGTH(s.subnet_info) AS subnet_length,
|
CHAR_LENGTH(s.subnet_info) AS subnet_length,
|
||||||
COUNT(node.subnet_id) AS node_counter
|
COUNT(node.subnet_id) AS node_counter
|
||||||
FROM
|
FROM
|
||||||
subnet AS s
|
subnet AS s LEFT JOIN node USING (subnet_id)
|
||||||
LEFT JOIN
|
|
||||||
node
|
|
||||||
ON
|
|
||||||
node.subnet_id=s.subnet_id
|
|
||||||
GROUP BY
|
GROUP BY
|
||||||
s.subnet_id
|
s.subnet_id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(s.subnet_address)";
|
INET_ATON(s.subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
|
||||||
$smarty->assign("subnets", $subnets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("subnets", $subnets);
|
||||||
// output
|
$smarty->display("subnet.tpl");
|
||||||
$smarty->display("subnet.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,61 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
if((isset($_GET['vlan_id'])) ? $vlan_id = sanitize($_GET['vlan_id']) : $vlan_id = "");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
vlan_id,
|
||||||
include("includes.php");
|
vlan_number,
|
||||||
|
vlan_name
|
||||||
// get id
|
|
||||||
if((isset($_GET['vlan_id'])) ? $vlan_id = sanitize($_GET['vlan_id']) : $vlan_id = "");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_id AS vlan_id,
|
|
||||||
vlan.vlan_number AS vlan_number,
|
|
||||||
vlan.vlan_name AS vlan_name
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_name";
|
vlan_name";
|
||||||
|
|
||||||
// run query
|
$vlans = $db->db_select($query);
|
||||||
$vlans = $db->db_select($query);
|
$vlan_options[0] = $lang['lang_option_none'];
|
||||||
$vlan_options[0] = $lang['lang_option_none'];
|
foreach ($vlans as $vlan) {
|
||||||
foreach ($vlans as $vlan) {
|
|
||||||
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
|
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("vlan_options", $vlan_options);
|
$smarty->assign("vlan_options", $vlan_options);
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetadd.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,76 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// subnet
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
subnet_address,
|
||||||
|
subnet_mask
|
||||||
// get id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
|
||||||
|
|
||||||
// setup node
|
// node
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
node_id,
|
||||||
node.node_id AS node_id,
|
node_ip
|
||||||
node.node_ip AS node_ip
|
|
||||||
FROM
|
FROM
|
||||||
node
|
node
|
||||||
WHERE
|
WHERE
|
||||||
node.subnet_id=" . $subnet_id . "
|
subnet_id=" . $subnet_id . "
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(node.node_ip)";
|
INET_ATON(node_ip)";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
|
||||||
$smarty->assign("nodes", $nodes);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("nodes", $nodes);
|
||||||
// output
|
$smarty->display("subnetdel.tpl");
|
||||||
$smarty->display("subnetdel.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,41 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet_address,
|
subnet_address,
|
||||||
subnet_mask,
|
subnet_mask,
|
||||||
protocol_version,
|
protocol_version,
|
||||||
@@ -48,23 +26,18 @@
|
|||||||
WHERE
|
WHERE
|
||||||
subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_proto_vers", $subnet[0]['protocol_version']);
|
||||||
$smarty->assign("subnet_proto_vers", $subnet[0]['protocol_version']);
|
$smarty->assign("subnet_dhcpstart", $subnet[0]['subnet_dhcp_start']);
|
||||||
$smarty->assign("subnet_dhcpstart", $subnet[0]['subnet_dhcp_start']);
|
$smarty->assign("subnet_dhcpend", $subnet[0]['subnet_dhcp_end']);
|
||||||
$smarty->assign("subnet_dhcpend", $subnet[0]['subnet_dhcp_end']);
|
$smarty->assign("subnet_ntp_server", $subnet[0]['ntp_server']);
|
||||||
$smarty->assign("subnet_ntp_server", $subnet[0]['ntp_server']);
|
$smarty->assign("subnet_info", $subnet[0]['subnet_info']);
|
||||||
$smarty->assign("subnet_info", $subnet[0]['subnet_info']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,63 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
subnet_address,
|
||||||
include("includes.php");
|
subnet_mask
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// start parent
|
$smarty->assign("location_options", $db->options_location());
|
||||||
// build query
|
$smarty->display("subnetlocationadd.tpl");
|
||||||
$smarty->assign("location_options", $db->options_location());
|
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("subnetlocationadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,82 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// subnet
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
subnet_address,
|
||||||
|
subnet_mask
|
||||||
// get ip and id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$subnet = $db->db_select($query);
|
$subnet = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// setup location
|
// location
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
l.location_id,
|
||||||
location.location_id AS location_id,
|
l.location_name
|
||||||
location.location_name AS location_name
|
|
||||||
FROM
|
FROM
|
||||||
subnetlocation,
|
subnetlocation AS s LEFT JOIN location USING (location_id)
|
||||||
location
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetlocation.subnet_id=" . $subnet_id . "
|
s.subnet_id=" . $subnet_id . "
|
||||||
AND location.location_id=subnetlocation.location_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
location.location_name";
|
l.location_name";
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$records = $db->db_select($query);
|
$records = $db->db_select($query);
|
||||||
$locations = array();
|
$locations = array();
|
||||||
foreach ($records as $rec) {
|
foreach ($records as $rec) {
|
||||||
$locations[$rec['location_id']] = $rec['location_name'];
|
$locations[$rec['location_id']] = $rec['location_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("location_options", $locations);
|
$smarty->assign("location_options", $locations);
|
||||||
|
|
||||||
|
$smarty->display("subnetlocationdel.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("subnetlocationdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,59 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
subnet_address,
|
||||||
include("includes.php");
|
subnet_mask
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$subnet = $db->db_select($query);
|
$subnet = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetlocationedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetlocationedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
269
subnetview.php
269
subnetview.php
@@ -1,110 +1,83 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
if(isset($_GET['page'])) {
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// get page
|
|
||||||
if(isset($_GET['page'])) {
|
|
||||||
$page = sanitize($_GET['page']);
|
$page = sanitize($_GET['page']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// start output
|
$smarty->assign("scripts",'changetext.js');
|
||||||
$smarty->assign("scripts",'changetext.js');
|
include("header.php");
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
// subnet
|
||||||
$smarty->assign($lang);
|
$query = "SELECT
|
||||||
|
s.subnet_address,
|
||||||
// setup subnet
|
s.subnet_mask,
|
||||||
// build query
|
s.subnet_dhcp_start,
|
||||||
$query = "SELECT
|
s.subnet_dhcp_end,
|
||||||
subnet.subnet_address,
|
s.subnet_info,
|
||||||
subnet.subnet_mask,
|
s.protocol_version,
|
||||||
subnet.subnet_dhcp_start,
|
s.ntp_server,
|
||||||
subnet.subnet_dhcp_end,
|
|
||||||
subnet.subnet_info,
|
|
||||||
subnet.protocol_version,
|
|
||||||
subnet.ntp_server,
|
|
||||||
COUNT(node.subnet_id) AS node_counter
|
COUNT(node.subnet_id) AS node_counter
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet AS s LEFT JOIN node USING (subnet_id)
|
||||||
LEFT JOIN
|
|
||||||
node
|
|
||||||
ON
|
|
||||||
node.subnet_id=subnet.subnet_id
|
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id . "
|
s.subnet_id=" . $subnet_id . "
|
||||||
GROUP BY
|
GROUP BY
|
||||||
subnet.subnet_id";
|
s.subnet_id";
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
// set needed variables
|
// set needed variables
|
||||||
$subnet_address = $subnet[0]['subnet_address'];
|
$subnet_address = $subnet[0]['subnet_address'];
|
||||||
$subnet_mask = $subnet[0]['subnet_mask'];
|
$subnet_mask = $subnet[0]['subnet_mask'];
|
||||||
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start'];
|
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start'];
|
||||||
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end'];
|
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end'];
|
||||||
$subnet_proto_vers = $subnet[0]['protocol_version'];
|
$subnet_proto_vers = $subnet[0]['protocol_version'];
|
||||||
$subnet_ntp_server = $subnet[0]['ntp_server'];
|
$subnet_ntp_server = $subnet[0]['ntp_server'];
|
||||||
|
|
||||||
// set counters
|
// set counters
|
||||||
$host_counter = pow(2,(32-$subnet_mask));
|
$host_counter = pow(2,(32-$subnet_mask));
|
||||||
$node_counter = $subnet[0]['node_counter'];
|
$node_counter = $subnet[0]['node_counter'];
|
||||||
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1);
|
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1);
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_address", $subnet_address);
|
||||||
$smarty->assign("subnet_address", $subnet_address);
|
$smarty->assign("subnet_mask", $subnet_mask);
|
||||||
$smarty->assign("subnet_mask", $subnet_mask);
|
$smarty->assign("subnet_dhcpstart", $subnet_dhcpstart);
|
||||||
$smarty->assign("subnet_dhcpstart", $subnet_dhcpstart);
|
$smarty->assign("subnet_dhcpend", $subnet_dhcpend);
|
||||||
$smarty->assign("subnet_dhcpend", $subnet_dhcpend);
|
$smarty->assign("subnet_info", nl2br($subnet[0]['subnet_info']));
|
||||||
$smarty->assign("subnet_info", nl2br($subnet[0]['subnet_info']));
|
$smarty->assign("subnet_proto_vers", $subnet_proto_vers);
|
||||||
$smarty->assign("subnet_proto_vers", $subnet_proto_vers);
|
$smarty->assign("subnet_ntp_server", $subnet_ntp_server);
|
||||||
$smarty->assign("subnet_ntp_server", $subnet_ntp_server);
|
$smarty->assign("node_counter", $node_counter);
|
||||||
$smarty->assign("node_counter", $node_counter);
|
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage);
|
||||||
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage);
|
$smarty->assign("config_color_unused", $config_color_unused);
|
||||||
$smarty->assign("config_color_unused", $config_color_unused);
|
$smarty->assign("host_counter", $host_counter-2);
|
||||||
$smarty->assign("host_counter", $host_counter-2);
|
$smarty->assign("free_counter", (($host_counter-2)-$node_counter));
|
||||||
$smarty->assign("free_counter", (($host_counter-2)-$node_counter));
|
|
||||||
|
|
||||||
// setup subnet
|
// subnet
|
||||||
// split up the range
|
|
||||||
$iprange = explode('.', $subnet_address);
|
|
||||||
$iprange1 = $iprange[0];
|
|
||||||
$iprange2 = $iprange[1];
|
|
||||||
$iprange3 = $iprange[2];
|
|
||||||
$iprange4 = $iprange[3];
|
|
||||||
|
|
||||||
// create empty subnet-array
|
// split up the range
|
||||||
$subnet = array();
|
$iprange = explode('.', $subnet_address);
|
||||||
|
$iprange1 = $iprange[0];
|
||||||
|
$iprange2 = $iprange[1];
|
||||||
|
$iprange3 = $iprange[2];
|
||||||
|
$iprange4 = $iprange[3];
|
||||||
|
|
||||||
// determine range (Class A/B/C)
|
// create empty subnet-array
|
||||||
if ($subnet_mask>=24) {
|
$subnet = array();
|
||||||
|
|
||||||
|
// determine range (Class A/B/C)
|
||||||
|
if ($subnet_mask>=24) {
|
||||||
// Class C
|
// Class C
|
||||||
// fill subnet-array with addresses we want to see
|
// fill subnet-array with addresses we want to see
|
||||||
for($i=0;$i<$host_counter;$i++) {
|
for($i=0;$i<$host_counter;$i++) {
|
||||||
@@ -135,7 +108,7 @@
|
|||||||
|
|
||||||
// set displayed nodes
|
// set displayed nodes
|
||||||
$nodes_displayed = $host_counter;
|
$nodes_displayed = $host_counter;
|
||||||
} else if ($subnet_mask>=16) {
|
} else if ($subnet_mask>=16) {
|
||||||
// Class B
|
// Class B
|
||||||
// which part do we want to see?
|
// which part do we want to see?
|
||||||
if((empty($page)) ? $page=$subnet_address : $page=$page);
|
if((empty($page)) ? $page=$subnet_address : $page=$page);
|
||||||
@@ -186,7 +159,7 @@
|
|||||||
|
|
||||||
// set displayed nodes
|
// set displayed nodes
|
||||||
$nodes_displayed = 256;
|
$nodes_displayed = 256;
|
||||||
} else {
|
} else {
|
||||||
// Class A
|
// Class A
|
||||||
// which part do we want to see?
|
// which part do we want to see?
|
||||||
if((empty($page)) ? $page=$subnet_address : $page=$page);
|
if((empty($page)) ? $page=$subnet_address : $page=$page);
|
||||||
@@ -211,7 +184,7 @@
|
|||||||
$smarty->assign("iprange2", $iprange2);
|
$smarty->assign("iprange2", $iprange2);
|
||||||
|
|
||||||
// loop addresses in range 2
|
// loop addresses in range 2
|
||||||
for($i=$iprange2;$i<(pow(2,(24-$subnet_mask))/256);$i++) {
|
for ($i=$iprange2; $i<(pow(2,(24-$subnet_mask))/256); $i++) {
|
||||||
// send to tpl
|
// send to tpl
|
||||||
$smarty->assign("iprange1", $iprange1);
|
$smarty->assign("iprange1", $iprange1);
|
||||||
$smarty->assign("iprange2", $i);
|
$smarty->assign("iprange2", $i);
|
||||||
@@ -262,11 +235,10 @@
|
|||||||
|
|
||||||
// set displayed nodes
|
// set displayed nodes
|
||||||
$nodes_displayed = 256;
|
$nodes_displayed = 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get nodes for this subnetview and implement the values into the array
|
// get nodes for this subnetview and implement the values into the array
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
|
||||||
asset.asset_name,
|
asset.asset_name,
|
||||||
assetclassgroup.assetclassgroup_color,
|
assetclassgroup.assetclassgroup_color,
|
||||||
node.node_id,
|
node.node_id,
|
||||||
@@ -283,56 +255,51 @@
|
|||||||
AND assetclass.assetclass_id=asset.assetclass_id
|
AND assetclass.assetclass_id=asset.assetclass_id
|
||||||
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
|
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
|
||||||
|
|
||||||
// run query
|
$nodes = $db->db_select($query);
|
||||||
$nodes = $db->db_select($query);
|
|
||||||
|
|
||||||
// count results
|
$node_counter = count($nodes);
|
||||||
$node_counter = count($nodes);
|
if ($node_counter>0) {
|
||||||
|
|
||||||
// any nodes?
|
|
||||||
if ($node_counter>0) {
|
|
||||||
// get objects
|
// get objects
|
||||||
foreach($nodes AS $node) {
|
foreach($nodes AS $node) {
|
||||||
// add node-values to ip in subnet-array
|
// add node-values to ip in subnet-array
|
||||||
$subnet[$node['node_ip']] = $node;
|
$subnet[$node['node_ip']] = $node;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// replace ip's in subnet-array (if necessary)
|
// replace ip's in subnet-array (if necessary)
|
||||||
// check for subnet address
|
// check for subnet address
|
||||||
if(array_key_exists($subnet_address, $subnet)) {
|
if(array_key_exists($subnet_address, $subnet)) {
|
||||||
// replace
|
// replace
|
||||||
$subnet[$subnet_address] = array("subnet_address");
|
$subnet[$subnet_address] = array("subnet_address");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for broadcast address
|
// check for broadcast address
|
||||||
if(array_key_exists($broadcast_address, $subnet)) {
|
if(array_key_exists($broadcast_address, $subnet)) {
|
||||||
// replace
|
// replace
|
||||||
$subnet[$broadcast_address] = array("broadcast_address");
|
$subnet[$broadcast_address] = array("broadcast_address");
|
||||||
}
|
}
|
||||||
|
|
||||||
$dhcpstart = 0;
|
$dhcpstart = 0;
|
||||||
if ($subnet_dhcpstart && $subnet_dhcpend) {
|
if ($subnet_dhcpstart && $subnet_dhcpend) {
|
||||||
$dhcpstart = ip2long($subnet_dhcpstart);
|
$dhcpstart = ip2long($subnet_dhcpstart);
|
||||||
$dhcpend = ip2long($subnet_dhcpend);
|
$dhcpend = ip2long($subnet_dhcpend);
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop subnet-array and send to template
|
// loop subnet-array and send to template
|
||||||
// start counter
|
// start counter
|
||||||
// $i=1;
|
// $i=1;
|
||||||
// loop subnet-array
|
// loop subnet-array
|
||||||
foreach($subnet AS $node_ip => $node) {
|
foreach ($subnet AS $node_ip => $node) {
|
||||||
|
|
||||||
// make new line?
|
// make new line?
|
||||||
// if(($i%$_SESSION['suser_imagecount']==0 && $i!=$nodes_displayed) ? $tr="</tr><tr>" : $tr="");
|
// if(($i%$_SESSION['suser_imagecount']==0 && $i!=$nodes_displayed) ? $tr="</tr><tr>" : $tr="");
|
||||||
|
|
||||||
// check if node-ip in DHCP-area
|
// check if node-ip in DHCP-area
|
||||||
$subnet[$node_ip]["dynamic"] = False;
|
$subnet[$node_ip]["dynamic"] = false;
|
||||||
if ($dhcpstart > 0) {
|
if ($dhcpstart > 0) {
|
||||||
$ipval = ip2long($node_ip);
|
$ipval = ip2long($node_ip);
|
||||||
if (($ipval >= $dhcpstart) and ($ipval <= $dhcpend)) {
|
if (($ipval >= $dhcpstart) and ($ipval <= $dhcpend)) {
|
||||||
$subnet[$node_ip]["dynamic"] = True;
|
$subnet[$node_ip]["dynamic"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +313,6 @@
|
|||||||
} else {
|
} else {
|
||||||
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_unused;
|
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_unused;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (array_key_exists(0, $node) && $node[0]=="subnet_address") {
|
} else if (array_key_exists(0, $node) && $node[0]=="subnet_address") {
|
||||||
// subnet address to tpl
|
// subnet address to tpl
|
||||||
$subnet[$node_ip]["url"] = "";
|
$subnet[$node_ip]["url"] = "";
|
||||||
@@ -364,17 +330,16 @@
|
|||||||
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color'];
|
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// update counter
|
// update counter
|
||||||
// $i++;
|
// $i++;
|
||||||
}
|
|
||||||
|
|
||||||
$smarty->assign("subnet", $subnet);
|
} // foreach
|
||||||
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']);
|
|
||||||
|
|
||||||
// setup vlan
|
$smarty->assign("subnet", $subnet);
|
||||||
// build query
|
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']);
|
||||||
$query = "SELECT
|
|
||||||
|
// vlan
|
||||||
|
$query = "SELECT
|
||||||
vlan.vlan_id AS vlan_id,
|
vlan.vlan_id AS vlan_id,
|
||||||
vlan.vlan_name AS vlan_name,
|
vlan.vlan_name AS vlan_name,
|
||||||
vlan.vlan_number AS vlan_number
|
vlan.vlan_number AS vlan_number
|
||||||
@@ -387,33 +352,26 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_name";
|
vlan.vlan_name";
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$vlans = $db->db_select($query);
|
$vlans = $db->db_select($query);
|
||||||
$smarty->assign("vlans", $vlans);
|
$smarty->assign("vlans", $vlans);
|
||||||
|
|
||||||
// setup location
|
// location
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
l.location_id,
|
||||||
location.location_id,
|
l.location_name
|
||||||
location.location_name
|
|
||||||
FROM
|
FROM
|
||||||
location
|
location AS l LEFT JOIN subnetlocation AS s USING (location_id)
|
||||||
LEFT JOIN
|
|
||||||
subnetlocation
|
|
||||||
ON
|
|
||||||
subnetlocation.location_id=location.location_id
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetlocation.subnet_id=". $subnet_id . "
|
s.subnet_id=". $subnet_id . "
|
||||||
ORDER BY
|
ORDER BY
|
||||||
location.location_name";
|
l.location_name";
|
||||||
|
|
||||||
// run query
|
$locations = $db->db_select($query);
|
||||||
$locations = $db->db_select($query);
|
$smarty->assign("locations", $locations);
|
||||||
$smarty->assign("locations", $locations);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
// assetclassgroup
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
|
||||||
assetclassgroup_id AS id,
|
assetclassgroup_id AS id,
|
||||||
assetclassgroup_name AS name,
|
assetclassgroup_name AS name,
|
||||||
assetclassgroup_color AS color,
|
assetclassgroup_color AS color,
|
||||||
@@ -427,14 +385,11 @@
|
|||||||
GROUP BY assetclass_id
|
GROUP BY assetclass_id
|
||||||
ORDER BY counter DESC";
|
ORDER BY counter DESC";
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$assetclassgroups = $db->db_select($query);
|
$assetclassgroups = $db->db_select($query);
|
||||||
$smarty->assign("assetclassgroups", $assetclassgroups);
|
$smarty->assign("assetclassgroups", $assetclassgroups);
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetview.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,65 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get ip and id
|
// subnet
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
// build query
|
||||||
|
$query = "SELECT
|
||||||
// start output
|
subnet_address,
|
||||||
include("header.php");
|
subnet_mask
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$subnet = $db->db_select($query);
|
$subnet = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// setup vlan
|
// vlan
|
||||||
// build query
|
$query = " SELECT
|
||||||
$query = " SELECT
|
vlan_id,
|
||||||
vlan.vlan_id AS vlan_id,
|
vlan_number,
|
||||||
vlan.vlan_number AS vlan_number,
|
vlan_name
|
||||||
vlan.vlan_name AS vlan_name
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id NOT IN (
|
vlan_id NOT IN (
|
||||||
SELECT
|
SELECT
|
||||||
vlan_id
|
vlan_id
|
||||||
FROM
|
FROM
|
||||||
@@ -68,22 +48,15 @@
|
|||||||
subnet_id=" . $subnet_id . "
|
subnet_id=" . $subnet_id . "
|
||||||
)
|
)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_number";
|
vlan_number";
|
||||||
|
|
||||||
// run query
|
$vlans = $db->db_select($query);
|
||||||
$vlans = $db->db_select($query);
|
foreach ($vlans as $vlan) {
|
||||||
foreach ($vlans as $vlan) {
|
|
||||||
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
|
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
|
||||||
}
|
}
|
||||||
$smarty->assign("vlan_options", $vlan_options);
|
$smarty->assign("vlan_options", $vlan_options);
|
||||||
|
|
||||||
// $smarty->assign("vlans", $vlans);
|
$smarty->display("subnetvlanadd.tpl");
|
||||||
|
|
||||||
|
include("footer.php");
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("subnetvlanadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,78 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// subnet
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
subnet_address,
|
||||||
|
subnet_mask
|
||||||
// get ip and id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$subnet = $db->db_select($query);
|
$subnet = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// setup vlan
|
// vlan
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
v.vlan_id,
|
||||||
vlan.vlan_id AS vlan_id,
|
v.vlan_number,
|
||||||
vlan.vlan_number AS vlan_number,
|
v.vlan_name
|
||||||
vlan.vlan_name AS vlan_name
|
|
||||||
FROM
|
FROM
|
||||||
subnetvlan,
|
subnetvlan AS s LEFT JOIN vlan AS v USING (vlan_id)
|
||||||
vlan
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetvlan.subnet_id=" . $subnet_id . "
|
s.subnet_id=" . $subnet_id . "
|
||||||
AND vlan.vlan_id=subnetvlan.vlan_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_number";
|
v.vlan_number";
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$vlans = $db->db_select($query);
|
$vlans = $db->db_select($query);
|
||||||
$smarty->assign("vlans", $vlans);
|
$smarty->assign("vlans", $vlans);
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetvlandel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetvlandel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,59 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$subnet_id = sanitize($_GET['subnet_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
subnet_address,
|
||||||
include("includes.php");
|
subnet_mask
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$subnet_id = sanitize($_GET['subnet_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup subnet
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
subnet.subnet_address AS subnet_address,
|
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id=" . $subnet_id;
|
subnet_id=" . $subnet_id;
|
||||||
|
|
||||||
// run query
|
$subnet = $db->db_select($query);
|
||||||
$subnet = $db->db_select($query);
|
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id);
|
$smarty->assign("subnet_id", $subnet_id);
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
|
||||||
|
|
||||||
// end page
|
$smarty->display("subnetvlanedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("subnetvlanedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -15,6 +15,14 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label">
|
||||||
|
{$lang_about_projectpage}
|
||||||
|
</td>
|
||||||
|
<td class="value">
|
||||||
|
<a href="https://git.piratenpartei-sh.de/thooge/ipreg">https://git.piratenpartei-sh.de/thooge/ipreg</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">
|
<td class="label">
|
||||||
{$lang_about_sfprojectpage}
|
{$lang_about_sfprojectpage}
|
||||||
@@ -75,6 +83,14 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label">
|
||||||
|
{$lang_about_changelog_v08}
|
||||||
|
</td>
|
||||||
|
<td class="value">
|
||||||
|
{$lang_about_changelog_v08_ext}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">
|
<td class="label">
|
||||||
{$lang_about_changelog_v07}
|
{$lang_about_changelog_v07}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{foreachelse}
|
{foreachelse}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="3">
|
||||||
{$lang_asset_none}
|
{$lang_asset_none}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -24,8 +24,15 @@
|
|||||||
<a href="assetclassview.php?assetclass_id={$assetclass.assetclass_id}">{$assetclass.assetclass_name}</a>
|
<a href="assetclassview.php?assetclass_id={$assetclass.assetclass_id}">{$assetclass.assetclass_name}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
|
<img src="image.php?color={$assetclass.assetclassgroup_color}" alt="#{$assetclass.assetclassgroup_color}">
|
||||||
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclass.assetclassgroup_id}">{$assetclass.assetclassgroup_name}</a>
|
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclass.assetclassgroup_id}">{$assetclass.assetclassgroup_name}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
{$lang_assetclass_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -22,5 +22,11 @@
|
|||||||
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup.assetclassgroup_id}">{$assetclassgroup.assetclassgroup_name}</a>
|
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup.assetclassgroup_id}">{$assetclassgroup.assetclassgroup_name}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{$lang_assetclassgroup_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
{$lang_assetclassgroup_name}
|
{$lang_assetclassgroup_name}
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
|
<img src="image.php?color={$assetclassgroup_color}" alt="#{$assetclassgroup_color}">
|
||||||
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a><br>
|
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a><br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -18,8 +18,14 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
{if $locations}
|
||||||
<td class="value">
|
<td class="value">
|
||||||
{treelist tree=$locations}
|
{treelist tree=$locations}
|
||||||
</td>
|
</td>
|
||||||
|
{else}
|
||||||
|
<td class="value">
|
||||||
|
{$lang_location_none}
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
<table class="title">
|
<table class="title">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="header">
|
<td class="header">
|
||||||
{lang_nat}
|
{$lang_nat}
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a>
|
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a>
|
||||||
|
{if $nat_options}
|
||||||
<input type="image" src="image.php?icon=save" alt="{$lang_submit}">
|
<input type="image" src="image.php?icon=save" alt="{$lang_submit}">
|
||||||
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -43,11 +45,17 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
{if $nat_options}
|
||||||
<td class="label">
|
<td class="label">
|
||||||
{$lang_node}
|
{$lang_node}
|
||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
{html_options name=node_id_int options=$node_id_int_options}
|
{html_options name=nat_ext options=$nat_options}
|
||||||
</td>
|
</td>
|
||||||
|
{else}
|
||||||
|
<td colspan="2">
|
||||||
|
No NAT rule to delete
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -34,5 +34,11 @@
|
|||||||
{$node.asset_info}
|
{$node.asset_info}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
{$lang_node_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
@@ -131,7 +131,13 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="value">
|
<td class="value">
|
||||||
{foreach item=rule from=$natrules}
|
{foreach item=rule from=$natrules}
|
||||||
<a href="nodeview.php?node_id={$rule.nat_node_id}">{$rule.nat_node_ip}</a>/<a href="assetview.php?asset_id={$rule.nat_asset_id}">{$rule.nat_asset_name}</a> ({$rule.nat_type})<br />
|
{if $rule.node_id_int eq $node.node_id}
|
||||||
|
<img src="images/arrow_left.png" alt="incoming" title="coming from">
|
||||||
|
<a href="nodeview.php?node_id={$rule.node_id_ext}">{$rule.node_ip_ext}</a>/<a href="assetview.php?asset_id={$rule.asset_id_ext}">{$rule.asset_name_ext}</a> ({$rule.nat_type})<br />
|
||||||
|
{else}
|
||||||
|
<img src="images/arrow_right.png" alt="outgoing" title="forwarding to">
|
||||||
|
<a href="nodeview.php?node_id={$rule.node_id_int}">{$rule.node_ip_int}</a>/<a href="assetview.php?asset_id={$rule.asset_id_int}">{$rule.asset_name_int}</a> ({$rule.nat_type})<br />
|
||||||
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -33,5 +33,11 @@
|
|||||||
{$subnet.subnet_info}
|
{$subnet.subnet_info}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
{$lang_subnet_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="header">
|
<td class="header">
|
||||||
<img class="icon" src="images/user.png" alt="" />
|
<img class="icon" src="images/user.png" alt="" />
|
||||||
{$lang_users} ({$user|@count})
|
{$lang_users} ({$users|@count})
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<a href="useradd.php"><img src="images/user_add.png" alt="{$lang_user_add}" /></a>
|
<a href="useradd.php"><img src="images/user_add.png" alt="{$lang_user_add}" /></a>
|
||||||
|
|||||||
@@ -33,5 +33,11 @@
|
|||||||
{$vlan.vlan_info}
|
{$vlan.vlan_info}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
{$lang_vlan_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -34,5 +34,11 @@
|
|||||||
{$zone.zone_serial}
|
{$zone.zone_serial}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{foreachelse}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">
|
||||||
|
{$lang_zone_none}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
60
user.php
60
user.php
@@ -1,54 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$query = "SELECT
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
user_id,
|
||||||
|
user_name,
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
user_displayname
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup user
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
user.user_id AS user_id,
|
|
||||||
user.user_name AS user_name,
|
|
||||||
user.user_displayname AS user_displayname
|
|
||||||
FROM
|
FROM
|
||||||
user
|
user
|
||||||
ORDER BY
|
ORDER BY
|
||||||
user.user_name";
|
user_name";
|
||||||
|
|
||||||
// run query
|
$users = $db->db_select($query);
|
||||||
$users = $db->db_select($query);
|
|
||||||
$smarty->assign("users", $users);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("users", $users);
|
||||||
// output
|
$smarty->display("user.tpl");
|
||||||
$smarty->display("user.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
43
useradd.php
43
useradd.php
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("useradd.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("useradd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
65
userdel.php
65
userdel.php
@@ -1,58 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$user_id = sanitize($_GET['user_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
user_name
|
||||||
include("includes.php");
|
FROM
|
||||||
|
|
||||||
// get id
|
|
||||||
$user_id = sanitize($_GET['user_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup user
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
user.user_name AS user_name
|
|
||||||
FROM
|
|
||||||
user
|
user
|
||||||
WHERE
|
WHERE
|
||||||
user.user_id=" . $user_id;
|
user_id=" . $user_id;
|
||||||
|
|
||||||
// run query
|
$user = $db->db_select($query);
|
||||||
$user = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("user_id", $user_id);
|
||||||
$smarty->assign("user_id", $user_id);
|
$smarty->assign("user_name", $user[0]['user_name']);
|
||||||
$smarty->assign("user_name", $user[0]['user_name']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("userdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("userdel.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
69
useredit.php
69
useredit.php
@@ -1,60 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$user_id = sanitize($_GET['user_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
user_name,
|
||||||
include("includes.php");
|
user_displayname
|
||||||
|
FROM
|
||||||
// get id
|
|
||||||
$user_id = sanitize($_GET['user_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup user
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
user.user_name AS user_name,
|
|
||||||
user.user_displayname AS user_displayname
|
|
||||||
FROM
|
|
||||||
user
|
user
|
||||||
WHERE
|
WHERE
|
||||||
user.user_id=" . $user_id;
|
user_id=" . $user_id;
|
||||||
|
|
||||||
// run query
|
$user = $db->db_select($query);
|
||||||
$user = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("user_id", $user_id);
|
||||||
$smarty->assign("user_id", $user_id);
|
$smarty->assign("user_name", $user[0]['user_name']);
|
||||||
$smarty->assign("user_name", $user[0]['user_name']);
|
$smarty->assign("user_displayname", $user[0]['user_displayname']);
|
||||||
$smarty->assign("user_displayname", $user[0]['user_displayname']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("useredit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("useredit.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
67
userview.php
67
userview.php
@@ -1,60 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$user_id = sanitize($_GET['user_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
user_name,
|
||||||
include("includes.php");
|
user_displayname
|
||||||
|
|
||||||
// get id
|
|
||||||
$user_id = sanitize($_GET['user_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup user
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
user.user_name AS user_name,
|
|
||||||
user.user_displayname AS user_displayname
|
|
||||||
FROM
|
FROM
|
||||||
user
|
user
|
||||||
WHERE
|
WHERE
|
||||||
user.user_id=" . $user_id;
|
user_id=" . $user_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$user = $db->db_select($query);
|
$user = $db->db_select($query);
|
||||||
|
|
||||||
// send to tpl
|
// send to tpl
|
||||||
$smarty->assign("user_id", $user_id);
|
$smarty->assign("user_id", $user_id);
|
||||||
$smarty->assign("user_name", $user[0]['user_name']);
|
$smarty->assign("user_name", $user[0]['user_name']);
|
||||||
$smarty->assign("user_displayname", $user[0]['user_displayname']);
|
$smarty->assign("user_displayname", $user[0]['user_displayname']);
|
||||||
|
|
||||||
// end page
|
$smarty->display("userview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("userview.tpl");
|
|
||||||
|
|
||||||
// footer
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
62
vlan.php
62
vlan.php
@@ -1,55 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$query = "SELECT
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
vlan_id,
|
||||||
|
vlan_number,
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
vlan_name,
|
||||||
or contact me at wietsew@users.sourceforge.net
|
LEFT(vlan_info, 60) AS vlan_info
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_id AS vlan_id,
|
|
||||||
vlan.vlan_number AS vlan_number,
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
LEFT(vlan.vlan_info, 60) AS vlan_info
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
ORDER BY
|
ORDER BY
|
||||||
vlan.vlan_number";
|
vlan_number";
|
||||||
|
|
||||||
// run query
|
$vlans = $db->db_select($query);
|
||||||
$vlans = $db->db_select($query);
|
|
||||||
$smarty->assign("vlans", $vlans);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("vlans", $vlans);
|
||||||
// output
|
$smarty->display("vlan.tpl");
|
||||||
$smarty->display("vlan.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
43
vlanadd.php
43
vlanadd.php
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("vlanadd.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("vlanadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
70
vlandel.php
70
vlandel.php
@@ -1,60 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
vlan_name,
|
||||||
include("includes.php");
|
vlan_number
|
||||||
|
FROM
|
||||||
// get id
|
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
vlan.vlan_number AS vlan_number
|
|
||||||
FROM
|
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
$vlan = $db->db_select($query);
|
||||||
$vlan = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
$smarty->display("vlandel.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("vlandel.tpl");
|
|
||||||
|
|
||||||
// footer
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
73
vlanedit.php
73
vlanedit.php
@@ -1,62 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
// setup vlan
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
vlan_name,
|
||||||
vlan.vlan_name AS vlan_name,
|
vlan_number,
|
||||||
vlan.vlan_number AS vlan_number,
|
vlan_info
|
||||||
vlan.vlan_info AS vlan_info
|
FROM
|
||||||
FROM
|
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
$vlan = $db->db_select($query);
|
||||||
$vlan = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
$smarty->assign("vlan_info", $vlan[0]['vlan_info']);
|
||||||
$smarty->assign("vlan_info", $vlan[0]['vlan_info']);
|
$smarty->display("vlanedit.tpl");
|
||||||
|
|
||||||
// end page
|
include("footer.php");
|
||||||
// output
|
|
||||||
$smarty->display("vlanedit.tpl");
|
|
||||||
|
|
||||||
// footer
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,65 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
// vlan
|
||||||
*****************************************************************************/
|
$query = "SELECT
|
||||||
|
vlan_name,
|
||||||
// start page
|
vlan_number
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
vlan.vlan_number AS vlan_number
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$vlan = $db->db_select($query);
|
$vlan = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
|
|
||||||
// setup subnet
|
// subnet
|
||||||
// build query
|
$query = " SELECT
|
||||||
$query = " SELECT
|
subnet_id,
|
||||||
subnet.subnet_id AS subnet_id,
|
subnet_address,
|
||||||
subnet.subnet_address AS subnet_address,
|
subnet_mask
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnet
|
subnet
|
||||||
WHERE
|
WHERE
|
||||||
subnet.subnet_id NOT IN (
|
subnet_id NOT IN (
|
||||||
SELECT
|
SELECT
|
||||||
subnet_id
|
subnet_id
|
||||||
FROM
|
FROM
|
||||||
@@ -68,19 +45,15 @@
|
|||||||
vlan_id=" . $vlan_id . "
|
vlan_id=" . $vlan_id . "
|
||||||
)
|
)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(subnet.subnet_address)";
|
INET_ATON(subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
foreach ($subnets as $subnet) {
|
||||||
foreach ($subnets as $subnet) {
|
|
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask'];
|
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask'];
|
||||||
}
|
}
|
||||||
$smarty->assign("subnet_options", $subnet_options);
|
$smarty->assign("subnet_options", $subnet_options);
|
||||||
|
|
||||||
// end page
|
$smarty->display("vlansubnetadd.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("vlansubnetadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,81 +1,53 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// vlan
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
vlan_name,
|
||||||
|
vlan_number
|
||||||
// get ip and id
|
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
vlan.vlan_number AS vlan_number
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
// run query
|
||||||
$vlan = $db->db_select($query);
|
$vlan = $db->db_select($query);
|
||||||
|
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
|
|
||||||
// setup subnet
|
// setup subnet
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
s.subnet_id,
|
||||||
subnet.subnet_id AS subnet_id,
|
s.subnet_address,
|
||||||
subnet.subnet_address AS subnet_address,
|
s.subnet_mask
|
||||||
subnet.subnet_mask AS subnet_mask
|
|
||||||
FROM
|
FROM
|
||||||
subnetvlan,
|
subnetvlan AS v LEFT JOIN subnet AS s USING(subnet_id)
|
||||||
subnet
|
|
||||||
WHERE
|
WHERE
|
||||||
subnetvlan.vlan_id=" . $vlan_id . "
|
v.vlan_id=" . $vlan_id . "
|
||||||
AND subnet.subnet_id=subnetvlan.subnet_id
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
INET_ATON(subnet.subnet_address)";
|
INET_ATON(s.subnet_address)";
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
foreach ($subnets as $subnet) {
|
||||||
foreach ($subnets as $subnet) {
|
|
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask'];
|
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask'];
|
||||||
}
|
}
|
||||||
$smarty->assign("subnet_options", $subnet_options);
|
$smarty->assign("subnet_options", $subnet_options);
|
||||||
|
|
||||||
// end page
|
$smarty->display("vlansubnetdel.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("vlansubnetdel.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
@@ -1,60 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT
|
||||||
// includes
|
vlan_name,
|
||||||
include("includes.php");
|
vlan_number
|
||||||
|
|
||||||
// get ip and id
|
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
vlan.vlan_number AS vlan_number
|
|
||||||
FROM
|
FROM
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
$vlan = $db->db_select($query);
|
||||||
$vlan = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("vlansubnetedit.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("vlansubnetedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
106
vlanview.php
106
vlanview.php
@@ -1,82 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$vlan_id = sanitize($_GET['vlan_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
// vlan
|
||||||
// includes
|
$query = "SELECT
|
||||||
include("includes.php");
|
vlan_name,
|
||||||
|
vlan_number,
|
||||||
// get id
|
vlan_info
|
||||||
$vlan_id = sanitize($_GET['vlan_id']);
|
FROM
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
vlan.vlan_name AS vlan_name,
|
|
||||||
vlan.vlan_number AS vlan_number,
|
|
||||||
vlan.vlan_info AS vlan_info
|
|
||||||
FROM
|
|
||||||
vlan
|
vlan
|
||||||
WHERE
|
WHERE
|
||||||
vlan.vlan_id=" . $vlan_id;
|
vlan_id=" . $vlan_id;
|
||||||
|
|
||||||
// run query
|
$vlan = $db->db_select($query);
|
||||||
$vlan = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
$smarty->assign("vlan_id", $vlan_id);
|
||||||
$smarty->assign("vlan_id", $vlan_id);
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']);
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']);
|
$smarty->assign("vlan_info", nl2br($vlan[0]['vlan_info']));
|
||||||
$smarty->assign("vlan_info", nl2br($vlan[0]['vlan_info']));
|
|
||||||
|
|
||||||
// setup subnets
|
// subnets
|
||||||
// build query
|
$query = "SELECT
|
||||||
$query = "SELECT
|
s.subnet_id,
|
||||||
subnet.subnet_id,
|
s.subnet_address,
|
||||||
subnet.subnet_address,
|
s.subnet_mask,
|
||||||
subnet.subnet_mask,
|
s.subnet_info
|
||||||
subnet.subnet_info
|
FROM
|
||||||
FROM
|
subnet AS s LEFT JOIN subnetvlan AS v USING (subnet_id)
|
||||||
subnet,
|
WHERE
|
||||||
subnetvlan
|
v.vlan_id=" . $vlan_id . "
|
||||||
WHERE
|
ORDER BY
|
||||||
subnetvlan.vlan_id=" . $vlan_id . "
|
INET_ATON(s.subnet_address)";
|
||||||
AND subnet.subnet_id=subnetvlan.subnet_id
|
|
||||||
ORDER BY
|
|
||||||
INET_ATON(subnet.subnet_address)";
|
|
||||||
|
|
||||||
// run query
|
$subnets = $db->db_select($query);
|
||||||
$subnets = $db->db_select($query);
|
$smarty->assign("subnets", $subnets);
|
||||||
$smarty->assign("subnets", $subnets);
|
|
||||||
|
|
||||||
// end page
|
$smarty->display("vlanview.tpl");
|
||||||
// output
|
|
||||||
$smarty->display("vlanview.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
54
zone.php
54
zone.php
@@ -1,55 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
include("header.php");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
$query = "SELECT
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
zone_id,
|
zone_id,
|
||||||
zone_origin,
|
zone_origin,
|
||||||
zone_soa,
|
zone_soa,
|
||||||
zone_hostmaster,
|
zone_hostmaster,
|
||||||
zone_serial
|
zone_serial
|
||||||
FROM
|
FROM
|
||||||
zone
|
zone
|
||||||
ORDER BY
|
ORDER BY
|
||||||
zone_origin";
|
zone_origin";
|
||||||
|
|
||||||
// run query
|
$zones = $db->db_select($query);
|
||||||
$zones = $db->db_select($query);
|
|
||||||
$smarty->assign("zones", $zones);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("zones", $zones);
|
||||||
// output
|
$smarty->display("zone.tpl");
|
||||||
$smarty->display("zone.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
43
zoneadd.php
43
zoneadd.php
@@ -1,39 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
include("header.php");
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$smarty->display("zoneadd.tpl");
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("footer.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("zoneadd.tpl");
|
|
||||||
|
|
||||||
// end output
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
57
zonedel.php
57
zonedel.php
@@ -1,52 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$zone_id = sanitize($_GET['zone_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
$query = "SELECT zone_id, zone_origin, zone_serial FROM zone WHERE zone_id=" . $zone_id;
|
||||||
// includes
|
$zone = $db->db_select($query);
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
$smarty->assign("zone", $zone[0]);
|
||||||
$zone_id = sanitize($_GET['zone_id']);
|
$smarty->display("zonedel.tpl");
|
||||||
|
|
||||||
// start output
|
include("footer.php");
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup vlan
|
|
||||||
// build query
|
|
||||||
$query = "SELECT zone_id, zone_origin, zone_serial FROM zone WHERE zone_id=" . $zone_id;
|
|
||||||
|
|
||||||
// run query
|
|
||||||
$zone = $db->db_select($query);
|
|
||||||
|
|
||||||
// send to tpl
|
|
||||||
$smarty->assign("zone", $zone[0]);
|
|
||||||
|
|
||||||
// end page
|
|
||||||
// output
|
|
||||||
$smarty->display("zonedel.tpl");
|
|
||||||
|
|
||||||
// footer
|
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
59
zoneedit.php
59
zoneedit.php
@@ -1,57 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
IP Reg, a PHP/MySQL IPAM tool
|
IP Reg, a PHP/MySQL IPAM tool
|
||||||
Copyright (C) 2007-2009 Wietse Warendorff
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||||
|
Copyright (C) 2011-2023 Thomas Hooge
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
it under the terms of the GNU General Public License as published by
|
*****************************************************************************/
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
include("includes.php");
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
$zone_id = sanitize($_GET['zone_id']);
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg,
|
include("header.php");
|
||||||
or contact me at wietsew@users.sourceforge.net
|
$query = "SELECT
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
// start page
|
|
||||||
// includes
|
|
||||||
include("includes.php");
|
|
||||||
|
|
||||||
// get id
|
|
||||||
$zone_id = sanitize($_GET['zone_id']);
|
|
||||||
|
|
||||||
// start output
|
|
||||||
include("header.php");
|
|
||||||
|
|
||||||
// set language variables
|
|
||||||
$smarty->assign($lang);
|
|
||||||
|
|
||||||
// setup assetclassgroup
|
|
||||||
// build query
|
|
||||||
$query = "SELECT
|
|
||||||
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default,
|
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default,
|
||||||
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial,
|
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial,
|
||||||
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info
|
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info
|
||||||
FROM
|
FROM
|
||||||
zone
|
zone
|
||||||
WHERE
|
WHERE
|
||||||
zone_id=" . $zone_id;
|
zone_id=" . $zone_id;
|
||||||
|
|
||||||
// run query
|
$zone = $db->db_select($query);
|
||||||
$zone = $db->db_select($query);
|
|
||||||
$smarty->assign("zone", $zone[0]);
|
|
||||||
|
|
||||||
// end page
|
$smarty->assign("zone", $zone[0]);
|
||||||
// output
|
$smarty->display("zoneedit.tpl");
|
||||||
$smarty->display("zoneedit.tpl");
|
|
||||||
|
|
||||||
// end output
|
include("footer.php");
|
||||||
include("footer.php");
|
|
||||||
?>
|
?>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user