@ -1,76 +0,0 @@ |
|||||||
<?php |
|
||||||
/***************************************************************************** |
|
||||||
IP Reg, a PHP/MySQL IPAM tool |
|
||||||
Copyright (C) 2008 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 |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get asset_id, ip or subnet_id |
|
||||||
if((isset($_GET['asset_id'])) ? $asset_id = $_GET['asset_id'] : $asset_id = ""); |
|
||||||
if((isset($_GET['ip'])) ? $ip = $_GET['ip'] : $ip = ""); |
|
||||||
if((isset($_GET['subnet_id'])) ? $subnet_id = $_GET['subnet_id'] : $subnet_id = ""); |
|
||||||
|
|
||||||
// check authorisation |
|
||||||
$auth = auth("assigniptoasset", $config_auth_assigniptoasset, 0); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set template |
|
||||||
$tp = new Template("tpl/assigniptoasset.tpl"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$tp->setvars($lang); |
|
||||||
|
|
||||||
// set variables |
|
||||||
$tp->set("asset_id", $asset_id); |
|
||||||
$tp->set("ip", $ip); |
|
||||||
$tp->set("subnet_id", $subnet_id); |
|
||||||
$tp->set("config_dns1suffix", $config_dns1suffix); |
|
||||||
$tp->set("config_dns2suffix", $config_dns2suffix); |
|
||||||
|
|
||||||
// get asset info |
|
||||||
$result = mysql_query("SELECT asset_id, asset_name FROM asset ORDER BY asset_name") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->asset_id==$asset_id) ? $tp->set("asset_selected", "selected") : $tp->set("asset_selected", "")); |
|
||||||
$tp->set("asset_id", $row->asset_id); |
|
||||||
$tp->set("asset_name", $row->asset_name); |
|
||||||
$tp->parse("assetrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset")); |
|
||||||
|
|
||||||
// get subnet info |
|
||||||
$result = mysql_query("SELECT subnet_id, subnet_address, subnet_mask FROM subnet ORDER BY INET_ATON(subnet_address)") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->subnet_id==$subnet_id) ? $tp->set("subnet_selected", "selected") : $tp->set("subnet_selected", "")); |
|
||||||
$tp->set("subnet_id", $row->subnet_id); |
|
||||||
$tp->set("subnet_address", $row->subnet_address); |
|
||||||
$tp->set("subnet_mask", $row->subnet_mask); |
|
||||||
$tp->parse("subnetrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("subnet") : $tp->hide("subnet")); |
|
||||||
|
|
||||||
// output |
|
||||||
$tp->parse(); |
|
||||||
$tp->spit(); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
|
@ -1,65 +0,0 @@ |
|||||||
<?php |
|
||||||
/***************************************************************************** |
|
||||||
IP Reg, a PHP/MySQL IPAM tool |
|
||||||
Copyright (C) 2008 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 |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// get id |
|
||||||
if((isset($_GET['location_id'])) ? $location_id = $_GET['location_id'] : $location_id = ""); |
|
||||||
if((isset($_GET['subnet_id'])) ? $subnet_id = $_GET['subnet_id'] : $subnet_id = ""); |
|
||||||
|
|
||||||
// set template |
|
||||||
$tp = new Template("tpl/assignlocationtosubnet.tpl"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$tp->setvars($lang); |
|
||||||
|
|
||||||
// get location info |
|
||||||
$result = mysql_query("SELECT location_id, location_name FROM location ORDER BY location_name"); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->location_id==$location_id) ? $tp->set("selected", "selected") : $tp->set("selected", "")); |
|
||||||
$tp->set("location_id", $row->location_id); |
|
||||||
$tp->set("location_name", $row->location_name); |
|
||||||
$tp->parse("locationrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("location") : $tp->hide("location")); |
|
||||||
|
|
||||||
// get subnet info |
|
||||||
$result = mysql_query("SELECT subnet_id, subnet_address, subnet_mask FROM subnet ORDER BY INET_ATON(subnet_address)") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->subnet_id==$subnet_id) ? $tp->set("selected", "selected") : $tp->set("selected", "")); |
|
||||||
$tp->set("subnet_id", $row->subnet_id); |
|
||||||
$tp->set("subnet_address", $row->subnet_address); |
|
||||||
$tp->set("subnet_mask", $row->subnet_mask); |
|
||||||
$tp->parse("subnetrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("subnet") : $tp->hide("subnet")); |
|
||||||
|
|
||||||
// output |
|
||||||
$tp->parse(); |
|
||||||
$tp->spit(); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
|
@ -0,0 +1,133 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get id |
||||||
|
$asset_id = sanitize($_GET['asset_id']); |
||||||
|
$node_ip = sanitize($_GET['node_ip']); |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/assignnodetoasset.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// to tpl |
||||||
|
$tp->set("node_ip", $node_ip); |
||||||
|
|
||||||
|
// setup asset |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
asset.asset_id AS asset_id, |
||||||
|
asset.asset_name AS asset_name |
||||||
|
FROM |
||||||
|
asset |
||||||
|
ORDER BY |
||||||
|
asset.asset_name"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$assets = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$asset_counter = count($assets); |
||||||
|
|
||||||
|
// any assets? |
||||||
|
if ($asset_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($assets AS $asset) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("asset_id", $asset['asset_id']); |
||||||
|
$tp->set("asset_name", $asset['asset_name']); |
||||||
|
|
||||||
|
if($asset['asset_id']==$asset_id) { |
||||||
|
$tp->set("asset_selected", "selected"); |
||||||
|
} else { |
||||||
|
$tp->set("asset_selected", ""); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("asset_row"); |
||||||
|
} |
||||||
|
// parse block |
||||||
|
$tp->parse("asset_table"); |
||||||
|
} else { |
||||||
|
// parse block |
||||||
|
$tp->hide("asset_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_id AS subnet_id, |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
ORDER BY |
||||||
|
INET_ATON(subnet.subnet_address)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnets = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$subnet_counter = count($subnets); |
||||||
|
|
||||||
|
// any subnets? |
||||||
|
if ($subnet_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($subnets AS $subnet) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("subnet_id", $subnet['subnet_id']); |
||||||
|
$tp->set("subnet_address", $subnet['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet['subnet_mask']); |
||||||
|
|
||||||
|
if($subnet['subnet_id']==$subnet_id) { |
||||||
|
$tp->set("subnet_selected", "selected"); |
||||||
|
} else { |
||||||
|
$tp->set("subnet_selected", ""); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("subnet_row"); |
||||||
|
} |
||||||
|
// parse block |
||||||
|
$tp->parse("subnet_table"); |
||||||
|
} else { |
||||||
|
// parse block |
||||||
|
$tp->hide("subnet_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -1,66 +0,0 @@ |
|||||||
<?php |
|
||||||
/***************************************************************************** |
|
||||||
IP Reg, a PHP/MySQL IPAM tool |
|
||||||
Copyright (C) 2008 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 |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set template |
|
||||||
$tp = new Template("tpl/assignvlantosubnet.tpl"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$tp->setvars($lang); |
|
||||||
|
|
||||||
// get id |
|
||||||
if((isset($_GET['vlan_id'])) ? $vlan_id = $_GET['vlan_id'] : $vlan_id = ""); |
|
||||||
if((isset($_GET['subnet_id'])) ? $subnet_id = $_GET['subnet_id'] : $subnet_id = ""); |
|
||||||
|
|
||||||
// get vlan info |
|
||||||
$result = mysql_query("SELECT vlan_id, vlan_number, vlan_name FROM vlan ORDER BY vlan_number") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->vlan_id==$vlan_id) ? $tp->set("selected", "selected") : $tp->set("selected", "")); |
|
||||||
$tp->set("vlan_id", $row->vlan_id); |
|
||||||
$tp->set("vlan_name", $row->vlan_name); |
|
||||||
$tp->set("vlan_number", $row->vlan_number); |
|
||||||
$tp->parse("vlanrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("vlan") : $tp->hide("vlan")); |
|
||||||
|
|
||||||
// get subnet info |
|
||||||
$result = mysql_query("SELECT subnet_id, subnet_address, subnet_mask FROM subnet ORDER BY INET_ATON(subnet_address)") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
if (($row->subnet_id==$subnet_id) ? $tp->set("selected", "selected") : $tp->set("selected", "")); |
|
||||||
$tp->set("subnet_id", $row->subnet_id); |
|
||||||
$tp->set("subnet_address", $row->subnet_address); |
|
||||||
$tp->set("subnet_mask", $row->subnet_mask); |
|
||||||
$tp->parse("subnetrow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("subnet") : $tp->hide("subnet")); |
|
||||||
|
|
||||||
// output |
|
||||||
$tp->parse(); |
|
||||||
$tp->spit(); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
|
@ -1,16 +1,106 @@ |
|||||||
<?php |
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// icon image |
||||||
|
if(isset($_GET['icon'])) { |
||||||
|
// get desired image |
||||||
|
$icon = sanitize($_GET['icon']); |
||||||
|
|
||||||
|
// switch selected |
||||||
|
switch($icon) { |
||||||
|
case ("add") : |
||||||
|
$png = 'page_add'; |
||||||
|
break; |
||||||
|
case ("back") : |
||||||
|
$png = 'control_rewind_blue'; |
||||||
|
break; |
||||||
|
case ("cancel") : |
||||||
|
$png = 'control_rewind_blue'; |
||||||
|
break; |
||||||
|
case ("comment") : |
||||||
|
$png = 'comment'; |
||||||
|
break; |
||||||
|
case ("delete") : |
||||||
|
$png = 'page_delete'; |
||||||
|
break; |
||||||
|
case ("edit") : |
||||||
|
$png = 'page_edit'; |
||||||
|
break; |
||||||
|
case ("error") : |
||||||
|
$png = 'error'; |
||||||
|
break; |
||||||
|
case ("help") : |
||||||
|
$png = 'help'; |
||||||
|
break; |
||||||
|
case ("logo") : |
||||||
|
$png = 'logo'; |
||||||
|
break; |
||||||
|
case ("next") : |
||||||
|
$png = 'control_fastforward_blue'; |
||||||
|
break; |
||||||
|
case ("save") : |
||||||
|
$png = 'page_save'; |
||||||
|
break; |
||||||
|
case ("search") : |
||||||
|
$png = 'magnifier'; |
||||||
|
break; |
||||||
|
} |
||||||
|
|
||||||
|
// get image |
||||||
|
$image = imagecreatefrompng("images/" . $png . ".png"); |
||||||
|
|
||||||
|
// alpha blending |
||||||
|
imagealphablending($image, true); |
||||||
|
|
||||||
|
// save alphablending setting |
||||||
|
imagesavealpha($image, true); |
||||||
|
|
||||||
|
// display image |
||||||
|
header('Content-type: image/png'); |
||||||
|
imagepng($image); |
||||||
|
imagedestroy($image); |
||||||
|
} |
||||||
|
|
||||||
|
// colored block |
||||||
|
if(isset($_GET['color'])) { |
||||||
// get desired color |
// get desired color |
||||||
$color = $_GET['color']; |
$color = sanitize($_GET['color']); |
||||||
|
|
||||||
// create base image |
// create base image |
||||||
$image = imagecreatetruecolor(6, 6); |
$image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']); |
||||||
|
|
||||||
// fill image with color |
// 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 |
// display image |
||||||
header('Content-type: image/png'); |
header('Content-type: image/png'); |
||||||
imagepng($image); |
imagepng($image); |
||||||
imagedestroy($image); |
imagedestroy($image); |
||||||
|
} |
||||||
?> |
?> |
Before Width: | Height: | Size: 141 B |
After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 413 B |
Before Width: | Height: | Size: 151 B |
After Width: | Height: | Size: 736 B |
After Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 666 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 615 B |
Before Width: | Height: | Size: 131 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 774 B |
Before Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 702 B |
@ -1,142 +0,0 @@ |
|||||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
|
||||||
|
|
||||||
CREATE TABLE `asset` ( |
|
||||||
`asset_id` int(10) NOT NULL auto_increment, |
|
||||||
`asset_name` varchar(100) NOT NULL default '', |
|
||||||
`hostname` varchar(100) NOT NULL default '', |
|
||||||
`assetclass_id` int(10) NOT NULL default '0', |
|
||||||
`asset_info` text NOT NULL, |
|
||||||
PRIMARY KEY (`asset_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `asset` (`asset_id`, `asset_name`, `hostname`, `assetclass_id`, `asset_info`) VALUES |
|
||||||
(1, 'TestPC', 'TestPC', 1, 'This is just a test PC'); |
|
||||||
|
|
||||||
CREATE TABLE `assetclass` ( |
|
||||||
`assetclass_id` int(10) NOT NULL auto_increment, |
|
||||||
`assetclassgroup_id` int(10) NOT NULL default '0', |
|
||||||
`assetclass_name` varchar(100) NOT NULL default '', |
|
||||||
PRIMARY KEY (`assetclass_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; |
|
||||||
|
|
||||||
INSERT INTO `assetclass` (`assetclass_id`, `assetclassgroup_id`, `assetclass_name`) VALUES |
|
||||||
(1, 1, 'PC'), |
|
||||||
(2, 2, 'Switch'); |
|
||||||
|
|
||||||
CREATE TABLE `assetclassgroup` ( |
|
||||||
`assetclassgroup_id` int(10) NOT NULL auto_increment, |
|
||||||
`assetclassgroup_name` varchar(100) NOT NULL default '', |
|
||||||
`color` varchar(6) NOT NULL, |
|
||||||
PRIMARY KEY (`assetclassgroup_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; |
|
||||||
|
|
||||||
INSERT INTO `assetclassgroup` (`assetclassgroup_id`, `assetclassgroup_name`, `color`) VALUES |
|
||||||
(1, 'Workstations', '000000'), |
|
||||||
(2, 'Network', 'FF0000'); |
|
||||||
|
|
||||||
CREATE TABLE `location` ( |
|
||||||
`location_id` int(10) NOT NULL auto_increment, |
|
||||||
`location_name` varchar(100) NOT NULL default '', |
|
||||||
`parent` int(1) NOT NULL default '0', |
|
||||||
`location_info` text NOT NULL, |
|
||||||
PRIMARY KEY (`location_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `location` (`location_id`, `location_name`, `parent`, `location_info`) VALUES |
|
||||||
(1, 'Main Office', 0, 'Our Main Office Building'); |
|
||||||
|
|
||||||
CREATE TABLE `node` ( |
|
||||||
`node_id` int(10) NOT NULL auto_increment, |
|
||||||
`ip` varchar(15) NOT NULL default '', |
|
||||||
`mac` varchar(12) NOT NULL default '', |
|
||||||
`dns1` varchar(100) NOT NULL default '', |
|
||||||
`dns2` varchar(100) NOT NULL default '', |
|
||||||
`subnet_id` int(10) NOT NULL default '0', |
|
||||||
`asset_id` int(10) NOT NULL default '0', |
|
||||||
`node_info` text NOT NULL, |
|
||||||
PRIMARY KEY (`node_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `node` (`node_id`, `ip`, `mac`, `dns1`, `dns2`, `subnet_id`, `asset_id`, `node_info`) VALUES |
|
||||||
(1, '192.168.0.1', '', '', '', 1, 1, ''); |
|
||||||
|
|
||||||
CREATE TABLE `subnet` ( |
|
||||||
`subnet_id` int(10) NOT NULL auto_increment, |
|
||||||
`subnet_address` varchar(15) NOT NULL default '', |
|
||||||
`subnet_mask` int(2) NOT NULL default '0', |
|
||||||
`vlan_id` int(10) NOT NULL default '0', |
|
||||||
`subnet_info` text NOT NULL, |
|
||||||
PRIMARY KEY (`subnet_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `subnet` (`subnet_id`, `subnet_address`, `subnet_mask`, `vlan_id`, `subnet_info`) VALUES |
|
||||||
(1, '192.168.0.1', 24, 1, ''); |
|
||||||
|
|
||||||
CREATE TABLE `subnetlocation` ( |
|
||||||
`subnetlocation_id` int(10) NOT NULL auto_increment, |
|
||||||
`subnet_id` int(10) NOT NULL default '0', |
|
||||||
`location_id` int(10) NOT NULL default '0', |
|
||||||
PRIMARY KEY (`subnetlocation_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `subnetlocation` (`subnetlocation_id`, `subnet_id`, `location_id`) VALUES |
|
||||||
(1, 1, 1); |
|
||||||
|
|
||||||
CREATE TABLE `user` ( |
|
||||||
`user_id` int(10) NOT NULL auto_increment, |
|
||||||
`user_name` varchar(100) NOT NULL default '', |
|
||||||
`user_pass` varchar(32) NOT NULL default '', |
|
||||||
`user_level` int(1) NOT NULL default '0', |
|
||||||
`user_displayname` varchar(100) NOT NULL default '', |
|
||||||
`user_mac` varchar(25) NOT NULL default 'xxxxxxxxxxxx', |
|
||||||
`user_lang` varchar(3) NOT NULL default '', |
|
||||||
PRIMARY KEY (`user_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `user` (`user_id`, `user_name`, `user_pass`, `user_level`, `user_displayname`, `user_mac`, `user_lang`) VALUES |
|
||||||
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 2, 'admin', 'xxxxxxxxxxxx', 'en'); |
|
||||||
|
|
||||||
CREATE TABLE `userclass` ( |
|
||||||
`userclass_id` int(10) NOT NULL auto_increment, |
|
||||||
`userclass_name` varchar(100) collate latin1_general_ci NOT NULL, |
|
||||||
PRIMARY KEY (`userclass_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `userclass` (`userclass_id`, `userclass_name`) VALUES |
|
||||||
(1, 'IP Reg Administrators'); |
|
||||||
|
|
||||||
CREATE TABLE `userclassauth` ( |
|
||||||
`userclassauth_id` int(10) NOT NULL auto_increment, |
|
||||||
`ordering` int(3) NOT NULL, |
|
||||||
`userclass_id` int(10) NOT NULL, |
|
||||||
`item` varchar(100) collate latin1_general_ci NOT NULL, |
|
||||||
`id` int(10) NOT NULL, |
|
||||||
`auth` int(1) NOT NULL, |
|
||||||
PRIMARY KEY (`userclassauth_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `userclassauth` (`userclassauth_id`, `ordering`, `userclass_id`, `item`, `id`, `auth`) VALUES |
|
||||||
(1, 1, 1, 'ipreg', 0, 2); |
|
||||||
|
|
||||||
CREATE TABLE `useruserclass` ( |
|
||||||
`useruserclass_id` int(10) NOT NULL auto_increment, |
|
||||||
`user_id` int(10) NOT NULL, |
|
||||||
`userclass_id` int(10) NOT NULL, |
|
||||||
PRIMARY KEY (`useruserclass_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `useruserclass` (`useruserclass_id`, `user_id`, `userclass_id`) VALUES |
|
||||||
(1, 1, 1); |
|
||||||
|
|
||||||
CREATE TABLE `vlan` ( |
|
||||||
`vlan_id` int(10) NOT NULL auto_increment, |
|
||||||
`vlan_number` int(3) NOT NULL default '0', |
|
||||||
`vlan_name` varchar(100) NOT NULL default '', |
|
||||||
`vlan_info` text NOT NULL, |
|
||||||
PRIMARY KEY (`vlan_id`) |
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; |
|
||||||
|
|
||||||
INSERT INTO `vlan` (`vlan_id`, `vlan_number`, `vlan_name`, `vlan_info`) VALUES |
|
||||||
(1, 1, 'VLAN', 'Default VLAN'); |
|
@ -1,18 +1,16 @@ |
|||||||
--- |
IP Reg Installation |
||||||
--- IP Reg 0.4 |
|
||||||
--- http://sourceforge.net/projects/ipreg |
|
||||||
--- |
|
||||||
|
|
||||||
Installation instructions |
1. Create database |
||||||
|
Create a database for IP Reg on your web server, as well as a MySQL user who has all privileges for accessing and modifying it. |
||||||
|
|
||||||
1) Create your MYSQL-database |
2. Run import |
||||||
|
Import the mysql.sql file into your database, which will create the tables and some sample data. |
||||||
|
|
||||||
2) Use install.sql to create the tables and insert the first data |
3. Edit config file |
||||||
|
Open config.php in a text editor and fill in your database details. |
||||||
|
|
||||||
3) Update config.php with your settings |
4. Upload files |
||||||
|
Upload all files and directory's (except the install directory) to your webserver. |
||||||
|
|
||||||
4) Copy all files to your webserver (exclude install directory) |
5. Start using IP Reg |
||||||
|
Start your browser and login to IP Reg with the default username/password: admin/admin |
||||||
5) Start your browser, log in with admin/admin |
|
||||||
|
|
||||||
6) Please report your comments at http://www.newtree.nl/ipreg |
|
@ -0,0 +1,143 @@ |
|||||||
|
CREATE TABLE asset ( |
||||||
|
asset_id int(10) NOT NULL auto_increment, |
||||||
|
asset_name varchar(100) NOT NULL, |
||||||
|
asset_hostname varchar(100) NOT NULL, |
||||||
|
assetclass_id int(10) NOT NULL, |
||||||
|
asset_info text NOT NULL, |
||||||
|
PRIMARY KEY (asset_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO asset (asset_name, assetclass_id) VALUES |
||||||
|
('My Computer', 1), |
||||||
|
('My Server', 2); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE assetclass ( |
||||||
|
assetclass_id int(10) NOT NULL auto_increment, |
||||||
|
assetclassgroup_id int(10) NOT NULL, |
||||||
|
assetclass_name varchar(100) NOT NULL, |
||||||
|
PRIMARY KEY (assetclass_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES |
||||||
|
(1, 'PC'), |
||||||
|
(2, 'Server'); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE assetclassgroup ( |
||||||
|
assetclassgroup_id int(10) NOT NULL auto_increment, |
||||||
|
assetclassgroup_name varchar(100) NOT NULL, |
||||||
|
assetclassgroup_color varchar(6) NOT NULL, |
||||||
|
PRIMARY KEY (assetclassgroup_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES |
||||||
|
('Workstations', 000000); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE location ( |
||||||
|
location_id int(10) NOT NULL auto_increment, |
||||||
|
location_name varchar(100) NOT NULL, |
||||||
|
location_parent int(1) NOT NULL default 0, |
||||||
|
location_info text NOT NULL, |
||||||
|
PRIMARY KEY (location_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO location (location_name, location_parent) VALUES |
||||||
|
('Main Office', 0); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE nat ( |
||||||
|
nat_id int(10) NOT NULL auto_increment, |
||||||
|
nat_type int(1) NOT NULL, |
||||||
|
nat_ext int(10) NOT NULL, |
||||||
|
nat_int int(10) NOT NULL, |
||||||
|
PRIMARY KEY (nat_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE node ( |
||||||
|
node_id int(10) NOT NULL auto_increment, |
||||||
|
node_ip varchar(15) NOT NULL, |
||||||
|
node_mac varchar(12) NOT NULL, |
||||||
|
node_dns1 varchar(100) NOT NULL, |
||||||
|
node_dns2 varchar(100) NOT NULL, |
||||||
|
subnet_id int(10) NOT NULL, |
||||||
|
asset_id int(10) NOT NULL, |
||||||
|
node_info text NOT NULL, |
||||||
|
PRIMARY KEY (node_id) |
||||||
|
) 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 ( |
||||||
|
subnet_id int(10) NOT NULL auto_increment, |
||||||
|
subnet_address varchar(15) NOT NULL, |
||||||
|
subnet_mask int(2) NOT NULL, |
||||||
|
subnet_info text NOT NULL, |
||||||
|
PRIMARY KEY (subnet_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO subnet (subnet_address, subnet_mask) VALUES |
||||||
|
('192.168.0.0', 24); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE subnetlocation ( |
||||||
|
subnetlocation_id int(10) NOT NULL auto_increment, |
||||||
|
subnet_id int(10) NOT NULL, |
||||||
|
location_id int(10) NOT NULL, |
||||||
|
PRIMARY KEY (subnetlocation_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO subnetlocation (subnet_id, location_id) VALUES |
||||||
|
(1, 1); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE subnetvlan ( |
||||||
|
subnetvlan_id int(10) NOT NULL auto_increment, |
||||||
|
subnet_id int(10) NOT NULL, |
||||||
|
vlan_id int(10) NOT NULL, |
||||||
|
PRIMARY KEY (subnetvlan_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE user ( |
||||||
|
user_id int(10) NOT NULL auto_increment, |
||||||
|
user_name varchar(100) NOT NULL, |
||||||
|
user_pass varchar(32) NOT NULL, |
||||||
|
user_displayname varchar(100) NOT NULL, |
||||||
|
user_imagesize int(3) NOT NULL default 6, |
||||||
|
user_imagecount int(3) NOT NULL default 64, |
||||||
|
user_mac varchar(25) NOT NULL default 'xxxxxxxxxxxx', |
||||||
|
user_dateformat varchar(10) NOT NULL default 'd M Y H:i', |
||||||
|
user_dns1suffix varchar(100) NOT NULL, |
||||||
|
user_dns2suffix varchar(100) NOT NULL, |
||||||
|
user_menu_assets varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_assetclasses varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_assetclassgroups varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_locations varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_nodes varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_subnets varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_users varchar(2) NOT NULL default 'on', |
||||||
|
user_menu_vlans varchar(2) NOT NULL default 'on', |
||||||
|
PRIMARY KEY (user_id) |
||||||
|
) 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 |
||||||
|
('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator', 6, 64, 'xxxxxxxxxxxx', 'd M Y H:i', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on'); |
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE vlan ( |
||||||
|
vlan_id int(10) NOT NULL auto_increment, |
||||||
|
vlan_number int(3) NOT NULL, |
||||||
|
vlan_name varchar(100) NOT NULL, |
||||||
|
vlan_info text NOT NULL, |
||||||
|
PRIMARY KEY (vlan_id) |
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ; |
||||||
|
|
||||||
|
INSERT INTO vlan (vlan_number, vlan_name) VALUES |
||||||
|
(1, 'DEFAULT_VLAN'); |
@ -0,0 +1,5 @@ |
|||||||
|
function changelink(optVal){ |
||||||
|
if(optVal=="") |
||||||
|
return false; |
||||||
|
window.location='subnetview.php?subnet_id='+optVal; |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
function changetext(id,newtext) { |
||||||
|
document.getElementById(id).innerHTML=newtext |
||||||
|
} |
@ -0,0 +1,115 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
class User { |
||||||
|
function check_strlen($string) { |
||||||
|
// check length |
||||||
|
if(strlen($string)<1) { |
||||||
|
return FALSE; |
||||||
|
} else { |
||||||
|
return TRUE; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function user_login($user_name, $user_pass) { |
||||||
|
// check user_name length |
||||||
|
if($this->check_strlen($user_name)==FALSE) { |
||||||
|
return FALSE; |
||||||
|
} |
||||||
|
|
||||||
|
// check user_pass length |
||||||
|
if($this->check_strlen($user_pass)==FALSE) { |
||||||
|
return FALSE; |
||||||
|
} |
||||||
|
|
||||||
|
// get user data |
||||||
|
// initiate class |
||||||
|
$db = new Db(); |
||||||
|
|
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
user.user_id, |
||||||
|
user.user_pass, |
||||||
|
user.user_displayname, |
||||||
|
user.user_imagesize, |
||||||
|
user.user_imagecount, |
||||||
|
user.user_mac, |
||||||
|
user.user_dateformat, |
||||||
|
user.user_dns1suffix, |
||||||
|
user.user_dns2suffix, |
||||||
|
user.user_menu_assets, |
||||||
|
user.user_menu_assetclasses, |
||||||
|
user.user_menu_assetclassgroups, |
||||||
|
user.user_menu_locations, |
||||||
|
user.user_menu_nodes, |
||||||
|
user.user_menu_subnets, |
||||||
|
user.user_menu_users, |
||||||
|
user.user_menu_vlans |
||||||
|
FROM |
||||||
|
user |
||||||
|
WHERE |
||||||
|
user.user_name='" . $user_name . "'"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$users = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$user_counter = count($users); |
||||||
|
|
||||||
|
// any users? |
||||||
|
if ($user_counter>0) { |
||||||
|
// compare passwords |
||||||
|
if(!strcmp(md5($user_pass), $users[0]['user_pass'])) { |
||||||
|
// all ok: user is logged in, register session data |
||||||
|
$_SESSION['suser_id'] = $users[0]['user_id']; |
||||||
|
$_SESSION['suser_displayname'] = $users[0]['user_displayname']; |
||||||
|
$_SESSION['suser_imagesize'] = $users[0]['user_imagesize']; |
||||||
|
$_SESSION['suser_imagecount'] = $users[0]['user_imagecount']; |
||||||
|
$_SESSION['suser_mac'] = $users[0]['user_mac']; |
||||||
|
$_SESSION['suser_dateformat'] = $users[0]['user_dateformat']; |
||||||
|
$_SESSION['suser_dns1suffix'] = $users[0]['user_dns1suffix']; |
||||||
|
$_SESSION['suser_dns2suffix'] = $users[0]['user_dns2suffix']; |
||||||
|
$_SESSION['suser_menu_assets'] = $users[0]['user_menu_assets']; |
||||||
|
$_SESSION['suser_menu_assetclasses'] = $users[0]['user_menu_assetclasses']; |
||||||
|
$_SESSION['suser_menu_assetclassgroups'] = $users[0]['user_menu_assetclassgroups']; |
||||||
|
$_SESSION['suser_menu_locations'] = $users[0]['user_menu_locations']; |
||||||
|
$_SESSION['suser_menu_nodes'] = $users[0]['user_menu_nodes']; |
||||||
|
$_SESSION['suser_menu_subnets'] = $users[0]['user_menu_subnets']; |
||||||
|
$_SESSION['suser_menu_users'] = $users[0]['user_menu_users']; |
||||||
|
$_SESSION['suser_menu_vlans'] = $users[0]['user_menu_vlans']; |
||||||
|
} else { |
||||||
|
return FALSE; |
||||||
|
} |
||||||
|
} else { |
||||||
|
return FALSE; |
||||||
|
} |
||||||
|
|
||||||
|
// no errors found, return |
||||||
|
return TRUE; |
||||||
|
} |
||||||
|
|
||||||
|
function user_logout() { |
||||||
|
// clear and destroy session |
||||||
|
$_SESSION = array(); |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,107 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$location_id = sanitize($_GET['location_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/locationsubnetadd.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup location |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
location.location_name AS location_name |
||||||
|
FROM |
||||||
|
location |
||||||
|
WHERE |
||||||
|
location.location_id=" . $location_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$location = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("location_id", $location_id); |
||||||
|
$tp->set("location_name", $location[0]['location_name']); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = " SELECT |
||||||
|
subnet.subnet_id AS subnet_id, |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id NOT IN ( |
||||||
|
SELECT |
||||||
|
subnet_id |
||||||
|
FROM |
||||||
|
subnetlocation |
||||||
|
WHERE |
||||||
|
location_id=" . $location_id . " |
||||||
|
) |
||||||
|
ORDER BY |
||||||
|
INET_ATON(subnet.subnet_address)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnets = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$subnet_counter = count($subnets); |
||||||
|
|
||||||
|
// any locations? |
||||||
|
if ($subnet_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($subnets AS $subnet) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("subnet_id", $subnet['subnet_id']); |
||||||
|
$tp->set("subnet_address", $subnet['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet['subnet_mask']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("subnet_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("subnet_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("subnet_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,102 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$location_id = sanitize($_GET['location_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/locationsubnetdel.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup location |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
location.location_name AS location_name |
||||||
|
FROM |
||||||
|
location |
||||||
|
WHERE |
||||||
|
location.location_id=" . $location_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$location = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("location_id", $location_id); |
||||||
|
$tp->set("location_name", $location[0]['location_name']); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_id AS subnet_id, |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnetlocation, |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnetlocation.location_id=" . $location_id . " |
||||||
|
AND subnet.subnet_id=subnetlocation.subnet_id |
||||||
|
ORDER BY |
||||||
|
INET_ATON(subnet.subnet_address)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnets = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$subnet_counter = count($subnets); |
||||||
|
|
||||||
|
// any locations? |
||||||
|
if ($subnet_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($subnets AS $subnet) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("subnet_id", $subnet['subnet_id']); |
||||||
|
$tp->set("subnet_address", $subnet['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet['subnet_mask']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("subnet_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("subnet_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("subnet_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,111 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$node_id = sanitize($_GET['node_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/natadd.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup node_ext |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
node.node_ip AS node_ip_ext |
||||||
|
FROM |
||||||
|
node |
||||||
|
WHERE |
||||||
|
node.node_id=" . $node_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$node = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("node_id_ext", $node_id); |
||||||
|
$tp->set("node_ip_ext", $node[0]['node_ip_ext']); |
||||||
|
|
||||||
|
// setup node_int |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
asset.asset_name AS asset_name, |
||||||
|
node.node_id AS node_id_int, |
||||||
|
node.node_ip AS node_ip_int |
||||||
|
FROM |
||||||
|
asset, |
||||||
|
node |
||||||
|
WHERE |
||||||
|
node.node_id NOT IN ( |
||||||
|
SELECT |
||||||
|
nat_int |
||||||
|
FROM |
||||||
|
nat |
||||||
|
WHERE |
||||||
|
nat_ext=" . $node_id . " |
||||||
|
) |
||||||
|
AND node.node_id!=" . $node_id . " |
||||||
|
AND asset.asset_id=node.asset_id |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node.node_ip)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$nodes = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$node_counter = count($nodes); |
||||||
|
|
||||||
|
// any nodes? |
||||||
|
if ($node_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($nodes AS $node) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("asset_name", $node['asset_name']); |
||||||
|
|
||||||
|
$tp->set("node_id_int", $node['node_id_int']); |
||||||
|
$tp->set("node_ip_int", $node['node_ip_int']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("node_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("node_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("node_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,105 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$node_id = sanitize($_GET['node_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/natdel.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup node_ext |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
node.node_ip AS node_ip_ext |
||||||
|
FROM |
||||||
|
node |
||||||
|
WHERE |
||||||
|
node.node_id=" . $node_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$node = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("node_id_ext", $node_id); |
||||||
|
$tp->set("node_ip_ext", $node[0]['node_ip_ext']); |
||||||
|
|
||||||
|
// setup node |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
asset.asset_name AS asset_name, |
||||||
|
node.node_id AS node_id_int, |
||||||
|
node.node_ip AS node_ip_int |
||||||
|
FROM |
||||||
|
asset, |
||||||
|
nat, |
||||||
|
node |
||||||
|
WHERE |
||||||
|
nat.nat_ext=" . $node_id . " |
||||||
|
AND node.node_id=nat.nat_int |
||||||
|
AND asset.asset_id=node.asset_id |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node.node_ip)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$nodes = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$node_counter = count($nodes); |
||||||
|
|
||||||
|
// any nodes? |
||||||
|
if ($node_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($nodes AS $node) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("asset_name", $node['asset_name']); |
||||||
|
|
||||||
|
$tp->set("node_id_int", $node['node_id_int']); |
||||||
|
$tp->set("node_ip_int", $node['node_ip_int']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("node_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("node_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("node_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,108 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/node.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// start node |
||||||
|
// setup view |
||||||
|
// subnet |
||||||
|
if(isset($_GET['subnet_id'])) { |
||||||
|
// get id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// build query part |
||||||
|
$subnet_view = "AND node.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// to tpl |
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
} else { |
||||||
|
// to tpl |
||||||
|
$tp->set("subnet_id", ""); |
||||||
|
} |
||||||
|
|
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
asset.asset_id AS asset_id, |
||||||
|
asset.asset_name AS asset_name, |
||||||
|
node.node_id AS node_id, |
||||||
|
node.node_ip AS node_ip |
||||||
|
FROM |
||||||
|
asset, |
||||||
|
node |
||||||
|
WHERE |
||||||
|
asset.asset_id=node.asset_id |
||||||
|
" . $subnet_view . " |
||||||
|
GROUP BY |
||||||
|
node.node_id |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node.node_ip)"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$nodes = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$node_counter = count($nodes); |
||||||
|
|
||||||
|
// counter to tpl |
||||||
|
$tp->set("node_counter", $node_counter); |
||||||
|
|
||||||
|
// any nodes? |
||||||
|
if ($node_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($nodes AS $node) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("asset_id", $node['asset_id']); |
||||||
|
$tp->set("asset_name", $node['asset_name']); |
||||||
|
|
||||||
|
$tp->set("node_id", $node['node_id']); |
||||||
|
$tp->set("node_ip", $node['node_ip']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("node_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("node_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("node_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -1,79 +0,0 @@ |
|||||||
<?php |
|
||||||
/***************************************************************************** |
|
||||||
IP Reg, a PHP/MySQL IPAM tool |
|
||||||
Copyright (C) 2008 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 |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
|
||||||
$subnet_id = $_GET['subnet_id']; |
|
||||||
|
|
||||||
// check authorisation |
|
||||||
$auth = auth("node", $config_auth_nodeview, 0); |
|
||||||
$auth = auth("subnet", $config_auth_subnetview, $subnet_id); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set template |
|
||||||
$tp = new Template("tpl/nodelist.tpl"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$tp->setvars($lang); |
|
||||||
|
|
||||||
// set variables |
|
||||||
$tp->set("subnet_id", $subnet_id); |
|
||||||
|
|
||||||
// set ordering |
|
||||||
if (isset($_GET['order'])) { |
|
||||||
switch($_GET['order']) { |
|
||||||
case ("asset_name") : $order = "a.asset_name"; break; |
|
||||||
case ("hostname") : $order = "a.hostname"; break; |
|
||||||
case ("mac") : $order = "n.mac"; break; |
|
||||||
case ("dns1") : $order = "n.dns1"; break; |
|
||||||
case ("dns2") : $order = "n.dns2"; break; |
|
||||||
default : $order = "INET_ATON(n.ip)"; |
|
||||||
} |
|
||||||
} else { |
|
||||||
$order = "INET_ATON(n.ip)"; |
|
||||||
} |
|
||||||
|
|
||||||
// get node info |
|
||||||
$result = mysql_query("SELECT a.asset_id, a.asset_name, a.hostname, n.node_id, n.ip, n.mac, n.dns1, n.dns2 FROM asset a, node n WHERE n.subnet_id='$subnet_id' AND a.asset_id=n.asset_id ORDER BY $order") or die(mysql_error()); |
|
||||||
for ($i=0;$row=mysql_fetch_object($result);$i++) { |
|
||||||
$tp->set("asset_id", $row->asset_id); |
|
||||||
$tp->set("asset_name", $row->asset_name); |
|
||||||
$tp->set("hostname", $row->hostname); |
|
||||||
$tp->set("node_id", $row->node_id); |
|
||||||
$tp->set("ip", $row->ip); |
|
||||||
$tp->set("mac", write_mac($row->mac)); |
|
||||||
$tp->set("dns1", $row->dns1); |
|
||||||
$tp->set("dns2", $row->dns2); |
|
||||||
$tp->parse("noderow"); |
|
||||||
} |
|
||||||
if (($i>0) ? $tp->parse("node") : $tp->hide("node")); |
|
||||||
|
|
||||||
// output |
|
||||||
$tp->parse(); |
|
||||||
$tp->spit(); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
|
@ -0,0 +1,111 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/optionseditdisplay.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup options |
||||||
|
// set menu checkboxes |
||||||
|
// assets |
||||||
|
if($_SESSION['suser_menu_assets']=='on') { |
||||||
|
$user_menu_assets_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assets_checked = ''; |
||||||
|
} |
||||||
|
// assetclasses |
||||||
|
if($_SESSION['suser_menu_assetclasses']=='on') { |
||||||
|
$user_menu_assetclasses_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assetclasses_checked = ''; |
||||||
|
} |
||||||
|
// assetclassgroups |
||||||
|
if($_SESSION['suser_menu_assetclassgroups']=='on') { |
||||||
|
$user_menu_assetclassgroups_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assetclassgroups_checked = ''; |
||||||
|
} |
||||||
|
// locations |
||||||
|
if($_SESSION['suser_menu_locations']=='on') { |
||||||
|
$user_menu_locations_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_locations_checked = ''; |
||||||
|
} |
||||||
|
// nodes |
||||||
|
if($_SESSION['suser_menu_nodes']=='on') { |
||||||
|
$user_menu_nodes_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_nodes_checked = ''; |
||||||
|
} |
||||||
|
// subnets |
||||||
|
if($_SESSION['suser_menu_subnets']=='on') { |
||||||
|
$user_menu_subnets_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_subnets_checked = ''; |
||||||
|
} |
||||||
|
// users |
||||||
|
if($_SESSION['suser_menu_users']=='on') { |
||||||
|
$user_menu_users_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_users_checked = ''; |
||||||
|
} |
||||||
|
// vlans |
||||||
|
if($_SESSION['suser_menu_vlans']=='on') { |
||||||
|
$user_menu_vlans_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_vlans_checked = ''; |
||||||
|
} |
||||||
|
|
||||||
|
// send to tpl |
||||||
|
$tp->set("user_id", $_SESSION['suser_id']); |
||||||
|
$tp->set("user_imagesize", $_SESSION['suser_imagesize']); |
||||||
|
$tp->set("user_imagecount", $_SESSION['suser_imagecount']); |
||||||
|
$tp->set("user_mac", $_SESSION['suser_mac']); |
||||||
|
$tp->set("user_dateformat", $_SESSION['suser_dateformat']); |
||||||
|
$tp->set("user_dns1suffix", $_SESSION['suser_dns1suffix']); |
||||||
|
$tp->set("user_dns2suffix", $_SESSION['suser_dns2suffix']); |
||||||
|
$tp->set("user_menu_assets_checked", $user_menu_assets_checked); |
||||||
|
$tp->set("user_menu_assetclasses_checked", $user_menu_assetclasses_checked); |
||||||
|
$tp->set("user_menu_assetclassgroups_checked", $user_menu_assetclassgroups_checked); |
||||||
|
$tp->set("user_menu_locations_checked", $user_menu_locations_checked); |
||||||
|
$tp->set("user_menu_nodes_checked", $user_menu_nodes_checked); |
||||||
|
$tp->set("user_menu_subnets_checked", $user_menu_subnets_checked); |
||||||
|
$tp->set("user_menu_users_checked", $user_menu_users_checked); |
||||||
|
$tp->set("user_menu_vlans_checked", $user_menu_vlans_checked); |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,108 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetlocationadd.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// start parent |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
location.location_id AS location_id, |
||||||
|
location.location_name AS location_name, |
||||||
|
location.location_parent AS location_parent |
||||||
|
FROM |
||||||
|
location |
||||||
|
WHERE |
||||||
|
location.location_id NOT IN ( |
||||||
|
SELECT |
||||||
|
location_id |
||||||
|
FROM |
||||||
|
subnetlocation |
||||||
|
WHERE |
||||||
|
subnet_id=" . $subnet_id . " |
||||||
|
) |
||||||
|
ORDER BY |
||||||
|
location.location_name"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$locations = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$location_counter = count($locations); |
||||||
|
|
||||||
|
// any locations? |
||||||
|
if ($location_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($locations AS $location) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("location_id", $location['location_id']); |
||||||
|
$tp->set("location_name", $location['location_name']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("location_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("location_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("location_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,102 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetlocationdel.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// setup location |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
location.location_id AS location_id, |
||||||
|
location.location_name AS location_name |
||||||
|
FROM |
||||||
|
subnetlocation, |
||||||
|
location |
||||||
|
WHERE |
||||||
|
subnetlocation.subnet_id=" . $subnet_id . " |
||||||
|
AND location.location_id=subnetlocation.location_id |
||||||
|
ORDER BY |
||||||
|
location.location_name"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$locations = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$location_counter = count($locations); |
||||||
|
|
||||||
|
// any locations? |
||||||
|
if ($location_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($locations AS $location) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("location_id", $location['location_id']); |
||||||
|
$tp->set("location_name", $location['location_name']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("location_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("location_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("location_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,63 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetlocationedit.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,109 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetvlanadd.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// 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 |
||||||
|
vlan |
||||||
|
WHERE |
||||||
|
vlan.vlan_id NOT IN ( |
||||||
|
SELECT |
||||||
|
vlan_id |
||||||
|
FROM |
||||||
|
subnetvlan |
||||||
|
WHERE |
||||||
|
subnet_id=" . $subnet_id . " |
||||||
|
) |
||||||
|
ORDER BY |
||||||
|
vlan.vlan_number"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$vlans = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$vlan_counter = count($vlans); |
||||||
|
|
||||||
|
// any vlans? |
||||||
|
if ($vlan_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($vlans AS $vlan) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("vlan_id", $vlan['vlan_id']); |
||||||
|
$tp->set("vlan_number", $vlan['vlan_number']); |
||||||
|
$tp->set("vlan_name", $vlan['vlan_name']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("vlan_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("vlan_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("vlan_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,104 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetvlandel.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// 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 |
||||||
|
subnetvlan, |
||||||
|
vlan |
||||||
|
WHERE |
||||||
|
subnetvlan.subnet_id=" . $subnet_id . " |
||||||
|
AND vlan.vlan_id=subnetvlan.vlan_id |
||||||
|
ORDER BY |
||||||
|
vlan.vlan_number"; |
||||||
|
|
||||||
|
// run query |
||||||
|
$vlans = $db->db_select($query); |
||||||
|
|
||||||
|
// count results |
||||||
|
$vlan_counter = count($vlans); |
||||||
|
|
||||||
|
// any vlans? |
||||||
|
if ($vlan_counter>0) { |
||||||
|
// get objects |
||||||
|
foreach($vlans AS $vlan) { |
||||||
|
// send to tpl |
||||||
|
$tp->set("vlan_id", $vlan['vlan_id']); |
||||||
|
$tp->set("vlan_number", $vlan['vlan_number']); |
||||||
|
$tp->set("vlan_name", $vlan['vlan_name']); |
||||||
|
|
||||||
|
// parse row |
||||||
|
$tp->parse("vlan_row"); |
||||||
|
} |
||||||
|
|
||||||
|
// parse block |
||||||
|
$tp->parse("vlan_table"); |
||||||
|
} else { |
||||||
|
// hide block |
||||||
|
$tp->hide("vlan_table"); |
||||||
|
} |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -0,0 +1,63 @@ |
|||||||
|
<?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 |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// start page |
||||||
|
// includes |
||||||
|
include("includes.php"); |
||||||
|
|
||||||
|
// get ip and id |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
|
// start output |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// set template |
||||||
|
$tp = new Template("tpl/subnetvlanedit.tpl", $config_yapter_error); |
||||||
|
|
||||||
|
// set language variables |
||||||
|
$tp->setvars($lang); |
||||||
|
|
||||||
|
// setup subnet |
||||||
|
// build query |
||||||
|
$query = "SELECT |
||||||
|
subnet.subnet_address AS subnet_address, |
||||||
|
subnet.subnet_mask AS subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet.subnet_id=" . $subnet_id; |
||||||
|
|
||||||
|
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
$tp->set("subnet_id", $subnet_id); |
||||||
|
$tp->set("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$tp->set("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
|
// end page |
||||||
|
// output |
||||||
|
$tp->parse(); |
||||||
|
$tp->spit(); |
||||||
|
|
||||||
|
// end output |
||||||
|
include("footer.php"); |
||||||
|
?> |
@ -1,73 +1,118 @@ |
|||||||
<table border="0"> |
<table class="title"> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="header"> |
||||||
<b>IP Reg {config_version}</b> |
{lang_about} |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
</table> |
</table> |
||||||
|
|
||||||
<p> |
<p> |
||||||
|
|
||||||
<table border="0"> |
<table class="info"> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="header"> |
||||||
Sourceforge Project Page: |
{lang_ipreg} {config_version} |
||||||
</td> |
</td> |
||||||
<td> |
<td class="header_right"> |
||||||
|
|
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_sfprojectpage} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
<a href="http://sourceforge.net/projects/ipreg">http://sourceforge.net/projects/ipreg</a> |
<a href="http://sourceforge.net/projects/ipreg">http://sourceforge.net/projects/ipreg</a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="label"> |
||||||
License: |
{lang_about_license} |
||||||
</td> |
</td> |
||||||
<td> |
<td class="value"> |
||||||
<a href="gpl-3.0.txt">GNU General Public License (GPL)</a> |
<a href="gpl-3.0.txt">{lang_about_gpl}</a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
</table> |
|
||||||
|
|
||||||
<p> |
|
||||||
|
|
||||||
<table border="0"> |
|
||||||
<tr> |
<tr> |
||||||
<td width="200"> |
<td class="label"> |
||||||
Yapter Template Engine |
{lang_about_yapter} |
||||||
</td> |
</td> |
||||||
<td> |
<td class="value"> |
||||||
<a href="http://yapter.sourceforge.net/">http://yapter.sourceforge.net</a> |
<a href="http://yapter.sourceforge.net/">http://yapter.sourceforge.net</a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="label"> |
||||||
OWeb2 Images |
{lang_about_iconset} |
||||||
</td> |
</td> |
||||||
<td> |
<td class="value"> |
||||||
<a href="http://www.oweb2.com/free-web20-icons-pack/">http://www.oweb2.com/free-web20-icons-pack</a> |
<a href="http://www.famfamfam.com/lab/icons/silk/">http://www.famfamfam.com/lab/icons/silk/</a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
</table> |
</table> |
||||||
|
|
||||||
<p> |
<p> |
||||||
|
|
||||||
<table border="0"> |
<table class="info"> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="header"> |
||||||
IP Reg, a PHP/MySQL IPAM tool<br> |
{lang_about_ipreg_ext} |
||||||
Copyright (C) 2008 Wietse Warendorff<p> |
</td> |
||||||
|
</tr> |
||||||
This program is free software: you can redistribute it and/or modify<br> |
<tr> |
||||||
it under the terms of the GNU General Public License as published by<br> |
<td class="label"> |
||||||
the Free Software Foundation, either version 3 of the License, or<br> |
{lang_about_license_ext} |
||||||
(at your option) any later version.<p> |
</td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,<br> |
<p> |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of<br> |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br> |
|
||||||
GNU General Public License for more details.<p> |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License<br> |
<table class="info"> |
||||||
along with this program. If not, see http://www.gnu.org/licenses/. |
<tr> |
||||||
|
<td class="header"> |
||||||
|
{lang_about_changelog} |
||||||
|
</td> |
||||||
|
<td class="header_right"> |
||||||
|
|
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_changelog_v05} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
|
{lang_about_changelog_v05_ext} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_changelog_v04} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
|
{lang_about_changelog_v04_ext} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_changelog_v03} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
|
{lang_about_changelog_v03_ext} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_changelog_v02} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
|
{lang_about_changelog_v02_ext} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td class="label"> |
||||||
|
{lang_about_changelog_v01} |
||||||
|
</td> |
||||||
|
<td class="value"> |
||||||
|
{lang_about_changelog_v01_ext} |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
</table> |
</table> |
@ -1,35 +1,49 @@ |
|||||||
<table border="0" width="100%"> |
<table class="title"> |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="header"> |
||||||
<b>{lang_assets}:</b> |
{lang_assets} ({asset_counter}) |
||||||
</td> |
</td> |
||||||
<td align="right"> |
<td align="right"> |
||||||
<a href="assetadd.php"><img src="images/add.gif" border="0" title="{lang_asset_add}"></a> |
<a href="assetadd.php"><img src="image.php?icon=add" alt="{lang_asset_add}"></a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
</table> |
</table> |
||||||
|
|
||||||
<p> |
<p> |
||||||
|
|
||||||
[BLOCK table AS asset] |
[BLOCK letter_table AS letter_table] |
||||||
<table border="0"> |
<table class="submenu"> |
||||||
<tr> |
<tr> |
||||||
<td width="250"> |
[BLOCK letter_row] |
||||||
<b>{lang_asset_name}</b> |
|
||||||
</td> |
|
||||||
<td> |
<td> |
||||||
<b>{lang_assetclass_name}</b> |
<a href="asset.php?asset_letter={asset_letter}">{asset_letter}</a> |
||||||
|
</td> |
||||||
|
[END letter_row] |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
[END letter_table] |
||||||
|
|
||||||
|
<p> |
||||||
|
|
||||||
|
[BLOCK asset_table AS asset_table] |
||||||
|
<table class="info"> |
||||||
|
<tr> |
||||||
|
<td class="header"> |
||||||
|
{lang_asset_name} |
||||||
|
</td> |
||||||
|
<td class="header"> |
||||||
|
{lang_assetclass_name} |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
[BLOCK assetrow] |
[BLOCK asset_row] |
||||||
<tr> |
<tr> |
||||||
<td> |
<td class="label"> |
||||||
<a href="assetview.php?asset_id={asset_id}">{asset_name}</a> |
<a href="assetview.php?asset_id={asset_id}">{asset_name}</a> |
||||||
</td> |
</td> |
||||||
<td> |
<td class="value"> |
||||||
<a href="assetclassview.php?assetclass_id={assetclass_id}">{assetclass_name}</a> |
<a href="assetclassview.php?assetclass_id={assetclass_id}">{assetclass_name}</a> |
||||||
</td> |
</td> |
||||||
</tr> |
</tr> |
||||||
[END assetrow] |
[END asset_row] |
||||||
</table> |
</table> |
||||||
[END table] |
[END asset_table] |