Changes adopted from version 0.4

This commit is contained in:
2023-02-13 09:56:14 +01:00
parent 8d00ee5e1b
commit faf5f368f5
152 changed files with 4971 additions and 1379 deletions

View File

@@ -1,9 +1,37 @@
<?php
include("header.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("subnet", $config_auth_subnetview, $subnet_id);
// start output
include("header.php");
// get page
if(isset($_GET['page'])) {
$page = $_GET['page'];
@@ -136,15 +164,15 @@
if(empty($node)) {
$tp->set("url", 'assigniptonode.php?subnet_id=' . $subnet_id . '&ip='. $ip);
$tp->set("remotetext", $ip);
$tp->set("color", 'grey');
$tp->set("color", $config_color_unused);
} else if ($node[0]=="subnet_address") {
$tp->set("url", "");
$tp->set("remotetext", $ip . '&nbsp;' . $lang['lang_subnet_subnetaddress']);
$tp->set("color", 'cross');
$tp->set("color", $config_color_blocked);
} else if ($node[0]=="broadcast_address") {
$tp->set("url", "");
$tp->set("remotetext", $ip . '&nbsp;' . $lang['lang_subnet_broadcastaddress']);
$tp->set("color", 'cross');
$tp->set("color", $config_color_blocked);
} else {
$tp->set("url", 'nodeview.php?node_id=' . $node['node_id']);
$tp->set("remotetext", $ip . '&nbsp;' . $node['asset_name']);
@@ -175,8 +203,8 @@
}
if (($i>0) ? $tp->parse("location") : $tp->hide("location"));
// get assetclass info
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name, color FROM assetclassgroup ORDER BY assetclassgroup_id") or die(mysql_error());
// get assetclassgroup info
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name, color FROM assetclassgroup ORDER BY assetclassgroup_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
@@ -184,30 +212,7 @@
$tp->parse("assetclassgrouprow");
}
if (($i>0) ? $tp->parse("assetclassgroup") : $tp->hide("assetclassgroup"));
// display options
if($_SESSION['suser_level'] >= $config_userlevel_assignlocationtosubnet) {
$tp->parse("assignlocationtosubnet");
} else {
$tp->hide("assignlocationtosubnet");
}
if($_SESSION['suser_level'] >= $config_userlevel_assignvlantosubnet) {
$tp->set("vlan_id", $vlan_id);
$tp->parse("assignvlantosubnet");
} else {
$tp->hide("assignvlantosubnet");
}
if($_SESSION['suser_level'] >= $config_userlevel_subnetedit) {
$tp->parse("subnetedit");
} else {
$tp->hide("subnetedit");
}
if($_SESSION['suser_level'] >= $config_userlevel_subnetdel) {
$tp->parse("subnetdel");
} else {
$tp->hide("subnetdel");
}
// output
$tp->parse();
$tp->spit();