Merge branch 'pdo'

master
Thomas Hooge 2 years ago
commit 0696a16030
  1. 46
      asset.php
  2. 19
      assetadd.php
  3. 19
      assetclass.php
  4. 2
      assetclassadd.php
  5. 18
      assetclassdel.php
  6. 26
      assetclassedit.php
  7. 18
      assetclassgroup.php
  8. 2
      assetclassgroupadd.php
  9. 20
      assetclassgroupdel.php
  10. 25
      assetclassgroupedit.php
  11. 44
      assetclassgroupview.php
  12. 45
      assetclassview.php
  13. 33
      assetdel.php
  14. 23
      assetedit.php
  15. 50
      assetview.php
  16. 20
      assigniptonode.php
  17. 26
      assignnodetoasset.php
  18. 12
      config.php-sample
  19. 5
      dbconnect.php
  20. 54
      index.php
  21. 2
      install/install.txt
  22. 37
      install/mysql.sql
  23. 4
      install/mysql_sample.sql
  24. 24
      install/upgrade.txt
  25. 4
      lang/de.php
  26. 8
      lang/en.php
  27. 106
      lib.php
  28. 172
      lib/db.class.php
  29. 3
      lib/functions.php
  30. 12
      location.php
  31. 10
      locationadd.php
  32. 15
      locationdel.php
  33. 44
      locationedit.php
  34. 17
      locationsubnetadd.php
  35. 25
      locationsubnetdel.php
  36. 17
      locationsubnetedit.php
  37. 83
      locationview.php
  38. 80
      login.php
  39. 26
      natadd.php
  40. 43
      natdel.php
  41. 15
      natedit.php
  42. 47
      node.php
  43. 4
      nodeadd.php
  44. 19
      nodedel.php
  45. 46
      nodeedit.php
  46. 38
      nodeview.php
  47. 150
      search.php
  48. 971
      submit.php
  49. 21
      subnet.php
  50. 16
      subnetadd.php
  51. 40
      subnetdel.php
  52. 32
      subnetedit.php
  53. 20
      subnetlocationadd.php
  54. 44
      subnetlocationdel.php
  55. 21
      subnetlocationedit.php
  56. 217
      subnetview.php
  57. 47
      subnetvlanadd.php
  58. 41
      subnetvlandel.php
  59. 19
      subnetvlanedit.php
  60. 4
      tpl/asset.tpl
  61. 4
      tpl/assetclassdel.tpl
  62. 6
      tpl/assetclassedit.tpl
  63. 14
      tpl/assetclassgroup.tpl
  64. 12
      tpl/assetclassgroupadd.tpl
  65. 6
      tpl/assetclassgroupdel.tpl
  66. 16
      tpl/assetclassgroupedit.tpl
  67. 21
      tpl/assetclassgroupview.tpl
  68. 12
      tpl/assetclassview.tpl
  69. 12
      tpl/assetedit.tpl
  70. 16
      tpl/assetview.tpl
  71. 4
      tpl/assigniptonode.tpl
  72. 4
      tpl/locationdel.tpl
  73. 8
      tpl/locationedit.tpl
  74. 4
      tpl/locationsubnetadd.tpl
  75. 12
      tpl/locationview.tpl
  76. 8
      tpl/natdel.tpl
  77. 4
      tpl/natedit.tpl
  78. 3
      tpl/node.tpl
  79. 8
      tpl/nodedel.tpl
  80. 18
      tpl/nodeedit.tpl
  81. 28
      tpl/nodeview.tpl
  82. 6
      tpl/subnetdel.tpl
  83. 16
      tpl/subnetedit.tpl
  84. 4
      tpl/subnetlocationadd.tpl
  85. 4
      tpl/subnetlocationdel.tpl
  86. 4
      tpl/subnetlocationedit.tpl
  87. 50
      tpl/subnetview.tpl
  88. 4
      tpl/subnetvlanadd.tpl
  89. 4
      tpl/subnetvlanedit.tpl
  90. 6
      tpl/user.tpl
  91. 4
      tpl/userdel.tpl
  92. 6
      tpl/useredit.tpl
  93. 16
      tpl/userview.tpl
  94. 6
      tpl/vlan.tpl
  95. 4
      tpl/vlandel.tpl
  96. 6
      tpl/vlanedit.tpl
  97. 4
      tpl/vlansubnetadd.tpl
  98. 4
      tpl/vlansubnetedit.tpl
  99. 14
      tpl/vlanview.tpl
  100. 6
      tpl/zone.tpl
  101. Some files were not shown because too many files have changed in this diff Show More

@ -13,41 +13,33 @@ include("header.php");
// create letter links
$query = "SELECT
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
FROM
asset
GROUP BY
asset_letter
ORDER BY
asset_letter";
$alphabet = $db->db_select($query);
$sql = "SELECT DISTINCT SUBSTRING(UPPER(asset_name),1,1) AS asset_letter
FROM asset
ORDER BY asset_letter";
$sth = $dbh->query($sql);
$alphabet = $sth->fetchAll();
$smarty->assign("alphabet", $alphabet);
// setup current letter
// total asset count
$sth = $dbh->query("SELECT COUNT(*) FROM asset");
$smarty->assign("assetcount", $sth->fetchColumn());
// assets for current letter
if (isset($_GET['asset_letter'])) {
$asset_letter = sanitize($_GET['asset_letter']);
} else {
$asset_letter = $alphabet[0]['asset_letter'];
}
$query = "SELECT
a.asset_id,
IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name,
a.asset_info,
c.assetclass_id,
c.assetclass_name
FROM
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE
SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "'
ORDER BY
a.asset_name";
$assets = $db->db_select($query);
$smarty->assign("assets", $assets);
$sql = "SELECT a.asset_id, IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name,
a.asset_info, c.assetclass_id, c.assetclass_name
FROM asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE SUBSTRING(a.asset_name,1,1)=?
ORDER BY a.asset_name";
$sth = $dbh->prepare($sql);
$sth->execute([$asset_letter]);
$smarty->assign("assets", $sth->fetchAll());
$smarty->display("asset.tpl");

@ -13,17 +13,14 @@ if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass
include("header.php");
$query = "SELECT
assetclass_id,
assetclass_name
FROM
assetclass
ORDER BY
assetclass_name";
$assetclasses = $db->db_select($query);
foreach ($assetclasses as $assetclass) {
$assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name'];
$sql = "SELECT assetclass_id, assetclass_name
FROM assetclass
ORDER BY assetclass_name";
$sth = $dbh->query($sql);
$assetclass_options = array();
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$assetclass_options[$rec[0]] = $rec[1];
}
$smarty->assign("assetclass_options", $assetclass_options);

@ -10,20 +10,13 @@ SPDX-License-Identifier: GPL-3.0-or-later
include("includes.php");
include("header.php");
$query = "SELECT
a.assetclass_id,
a.assetclass_name,
g.assetclassgroup_id,
g.assetclassgroup_name,
g.assetclassgroup_color
FROM
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
ORDER BY
a.assetclass_name";
$sql = "SELECT a.assetclass_id, a.assetclass_name, g.assetclassgroup_id,
g.assetclassgroup_name, g.assetclassgroup_color
FROM assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
ORDER BY a.assetclass_name";
$sth = $dbh->query($sql);
$smarty->assign("assetclasses", $sth->fetchAll(PDO::FETCH_ASSOC));
$assetclasses = $db->db_select($query);
$smarty->assign("assetclasses", $assetclasses);
$smarty->display("assetclass.tpl");
include("footer.php");

@ -13,7 +13,7 @@ if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['
include("header.php");
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
$smarty->assign("assetclassgroup_options", db_get_options_assetclassgroup());
$smarty->display("assetclassadd.tpl");
include("footer.php");

@ -13,18 +13,12 @@ $assetclass_id = sanitize($_GET['assetclass_id']);
include("header.php");
$query = "SELECT
assetclass_id,
assetclass_name
FROM
assetclass
WHERE
assetclass_id=" . $assetclass_id;
$assetclass = $db->db_select($query);
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
$sql = "SELECT assetclass_id AS id, assetclass_name AS name
FROM assetclass
WHERE assetclass_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclass_id]);
$smarty->assign("assetclass", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("assetclassdel.tpl");

@ -12,22 +12,16 @@ include("includes.php");
$assetclass_id = sanitize($_GET['assetclass_id']);
include("header.php");
$query = "SELECT
assetclass_id,
assetclass_name,
assetclassgroup_id
FROM
assetclass
WHERE
assetclass_id=" . $assetclass_id;
$assetclass = $db->db_select($query);
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
$sql = "SELECT assetclass_id AS id, assetclass_name AS name,
assetclassgroup_id AS group_id
FROM assetclass
WHERE assetclass_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclass_id]);
$smarty->assign("assetclass", $sth->fetch(PDO::FETCH_OBJ));
$smarty->assign("assetclassgroup_options", db_get_options_assetclass());
$smarty->display("assetclassedit.tpl");

@ -8,21 +8,15 @@ SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
include("includes.php");
include("header.php");
$query = "SELECT
assetclassgroup_id,
assetclassgroup_name,
assetclassgroup_color
FROM
assetclassgroup
ORDER BY
assetclassgroup_name";
$assetclassgroups = $db->db_select($query);
$sql = "SELECT assetclassgroup_id AS id, assetclassgroup_name AS name,
assetclassgroup_color AS color, assetclassgroup_description AS description
FROM assetclassgroup
ORDER BY assetclassgroup_name";
$sth = $dbh->query($sql);
$smarty->assign('assetclassgroups', $sth->fetchAll(PDO::FETCH_ASSOC));
$smarty->assign("assetclassgroups", $assetclassgroups);
$smarty->display("assetclassgroup.tpl");
include("footer.php");

@ -8,6 +8,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
include("includes.php");
$smarty->assign("scripts", 'jscolor.js');
include("header.php");
$smarty->display("assetclassgroupadd.tpl");

@ -13,20 +13,12 @@ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
include("header.php");
$smarty->assign($lang);
$query = "SELECT
assetclassgroup_id,
assetclassgroup_name
FROM
assetclassgroup
WHERE
assetclassgroup_id=" . $assetclassgroup_id;
$assetclassgroup = $db->db_select($query);
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
$sql = "SELECT assetclassgroup_id AS id, assetclassgroup_name AS name
FROM assetclassgroup
WHERE assetclassgroup_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclassgroup_id]);
$smarty->assign("assetclassgroup", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("assetclassgroupdel.tpl");

@ -14,22 +14,15 @@ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
$smarty->assign("scripts", 'jscolor.js');
include("header.php");
$smarty->assign($lang);
$query = "SELECT
assetclassgroup_id,
assetclassgroup_name,
assetclassgroup_color
FROM
assetclassgroup
WHERE
assetclassgroup_id=" . $assetclassgroup_id;
$assetclassgroup = $db->db_select($query);
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
$sql = "SELECT assetclassgroup_id AS id, assetclassgroup_name AS name,
assetclassgroup_color AS color,
assetclassgroup_description AS description
FROM assetclassgroup
WHERE assetclassgroup_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclassgroup_id]);
$smarty->assign("assetclassgroup", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("assetclassgroupedit.tpl");

@ -13,33 +13,23 @@ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
include("header.php");
$query = "SELECT
assetclassgroup_id,
assetclassgroup_name,
assetclassgroup_color
FROM
assetclassgroup
WHERE
assetclassgroup_id=" . $assetclassgroup_id;
$assetclassgroup = $db->db_select($query);
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
$query = "SELECT
assetclass_id,
assetclass_name
FROM
assetclass
WHERE
assetclassgroup_id=" . $assetclassgroup_id . "
ORDER BY
assetclass_name";
$assetclasses = $db->db_select($query);
$smarty->assign("assetclasses", $assetclasses);
$sql = "SELECT assetclassgroup_id AS id,
assetclassgroup_name AS name,
assetclassgroup_color AS color,
assetclassgroup_description AS description
FROM assetclassgroup
WHERE assetclassgroup_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclassgroup_id]);
$smarty->assign("assetclassgroup", $sth->fetch(PDO::FETCH_OBJ));
$sql = "SELECT assetclass_id, assetclass_name
FROM assetclass
WHERE assetclassgroup_id=?
ORDER BY assetclass_name";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclassgroup_id]);
$smarty->assign("assetclasses", $sth->fetchAll(PDO::FETCH_ASSOC));
$smarty->display("assetclassgroupview.tpl");

@ -13,37 +13,22 @@ $assetclass_id = sanitize($_GET['assetclass_id']);
include("header.php");
$query = "SELECT
a.assetclass_id, a.assetclass_name,
g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color
FROM
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
WHERE
a.assetclass_id=" . $assetclass_id;
$assetclass = $db->db_select($query);
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
$smarty->assign("assetclass_selected", "");
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
$smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']);
$query = "SELECT
asset_id,
asset_name,
$sql = "SELECT a.assetclass_id, a.assetclass_name, g.assetclassgroup_id,
g.assetclassgroup_name, g.assetclassgroup_color
FROM assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
WHERE a.assetclass_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclass_id]);
$smarty->assign("assetclass", $sth->fetch(PDO::FETCH_OBJ));
$sql = "SELECT asset_id, asset_name,
CONCAT(LEFT(asset_info, 80), IF(CHAR_LENGTH(asset_info)>80,'...','')) AS asset_info
FROM
asset
WHERE
assetclass_id='" . $assetclass_id . "'
ORDER BY
asset_name";
$assets = $db->db_select($query);
$smarty->assign("assets", $assets);
FROM asset
WHERE assetclass_id=?
ORDER BY asset_name";
$sth = $dbh->prepare($sql);
$sth->execute([$assetclass_id]);
$smarty->assign("assets", $sth->fetchAll(PDO::FETCH_ASSOC));
$smarty->display("assetclassview.tpl");

@ -13,30 +13,17 @@ $asset_id = sanitize($_GET['asset_id']);
include("header.php");
$query = "SELECT
asset_name
FROM
asset
WHERE
asset_id=" . $asset_id;
$asset = $db->db_select($query);
// asset to delete
$sth = $dbh->prepare("SELECT asset_name FROM asset WHERE asset_id=?");
$sth->execute([$asset_id]);
$smarty->assign("asset_id", $asset_id);
$smarty->assign("asset_name", $asset[0]['asset_name']);
$query = "SELECT
node_id,
node_ip
FROM
node
WHERE
asset_id=" . $asset_id . "
ORDER BY
INET_ATON(node_ip)";
$nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
$smarty->assign("asset_name", $sth->fetchColumn());
// nodes to delete
$sql = "SELECT node_id, node_ip FROM node WHERE asset_id=? ORDER BY INET_ATON(node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute([$asset_id]);
$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC));
$smarty->display("assetdel.tpl");

@ -13,21 +13,14 @@ $asset_id = sanitize($_GET['asset_id']);
include("header.php");
$query = "SELECT
asset_id,
asset_name,
asset_hostname,
asset_info,
assetclass_id
FROM
asset
WHERE
asset_id=" . $asset_id;
$asset = $db->db_select($query);
$smarty->assign("asset", $asset[0]);
$smarty->assign("assetclass_options", $db->options_assetclass());
$sql = "SELECT asset_id, asset_name, asset_hostname, asset_info, assetclass_id
FROM asset
WHERE asset_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$asset_id]);
$smarty->assign("asset", $sth->fetch(PDO::FETCH_OBJ));
$smarty->assign("assetclass_options", db_get_options_assetclass());
$smarty->display("assetedit.tpl");

@ -13,40 +13,22 @@ $asset_id = sanitize($_GET['asset_id']);
include("header.php");
$query = "SELECT
a.asset_name,
a.asset_hostname,
a.asset_info,
c.assetclass_id,
c.assetclass_name
FROM
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE
a.asset_id=" . $asset_id;
$asset = $db->db_select($query);
$smarty->assign("asset_id", $asset_id);
$smarty->assign("asset_name", $asset[0]['asset_name']);
$smarty->assign("asset_hostname", $asset[0]['asset_hostname']);
$smarty->assign("asset_info", nl2br($asset[0]['asset_info']));
$smarty->assign("assetclass_id", $asset[0]['assetclass_id']);
$smarty->assign("assetclass_name", $asset[0]['assetclass_name']);
$query = "SELECT
node_id,
node_ip,
LEFT(node_info, 40) as node_info
FROM
node
WHERE
asset_id=" . $asset_id . "
ORDER BY
INET_ATON(node_ip)";
$nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
$sql = "SELECT a.asset_id, a.asset_name, a.asset_hostname, a.asset_info,
c.assetclass_id, c.assetclass_name
FROM asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE a.asset_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$asset_id]);
$asset = $sth->fetch(PDO::FETCH_OBJ);
$smarty->assign("asset", $asset);
$sql = "SELECT node_id, node_ip, LEFT(node_info, 40) as node_info
FROM node
WHERE asset_id=?
ORDER BY INET_ATON(node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute([$asset_id]);
$smarty->assign("nodes", $sth->fetchAll(PDO::FETCH_ASSOC));
$smarty->display("assetview.tpl");

@ -14,19 +14,13 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
$smarty->assign("node_ip", $node_ip);
$smarty->display("assigniptonode.tpl");

@ -19,30 +19,8 @@ $smarty->assign("node_ip", $node_ip);
$smarty->assign("asset_id", $asset_id);
$smarty->assign("subnet_id", $subnet_id);
$query = "SELECT
asset_id,
asset_name
FROM
asset
ORDER BY
asset_name";
$assets = $db->db_select($query);
foreach ($assets as $asset) {
$asset_options[$asset['asset_id']] = $asset['asset_name'];
}
$smarty->assign("asset_options", $asset_options);
$query = "SELECT subnet_id,
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
FROM subnet
ORDER BY INET_ATON(subnet_address)";
$subnets = $db->db_select($query);
foreach ($subnets as $subnet) {
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_name'];
}
$smarty->assign("subnet_options", $subnet_options);
$smarty->assign("asset_options", db_get_options_asset());
$smarty->assign("subnet_options", db_get_options_subnet());
$smarty->display("assignnodetoasset.tpl");

@ -21,4 +21,16 @@ $config_color_dynamic = 'e0e0e0';
// language
$config_lang_default = 'en';
// auth
$config_auth_ldap = false;
$config_ldap_host = array('localhost', 'otherhost.example.com');
$config_ldap_port = 389;
$config_ldap_v3 = true;
$config_ldap_base_dn = 'ou=organizationalunit,dc=example,dc=com';
$config_ldap_login_attr = 'uid';
// ldap search user
$config_ldap_bind_dn = 'cn=dummy,ou=organizationalunit,dc=example,dc=com';
$config_ldap_bind_pass = 'secret';
?>

@ -7,7 +7,8 @@ Copyright (C) 2011-2023 Thomas Hooge
SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
$dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password);
mysqli_select_db($dblink, $config_mysql_dbname);
$dbh = new PDO("mysql:host=$config_mysql_host;dbname=$config_mysql_dbname;charset=utf8", $config_mysql_username, $config_mysql_password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
?>

@ -11,57 +11,31 @@ include("includes.php");
include("header.php");
// asset
$query = "SELECT
COUNT(asset_id) AS asset_counter
FROM
asset";
// Statistics
$assets = $db->db_select($query);
$smarty->assign("asset_counter", $assets[0]['asset_counter']);
// asset
$sth = $dbh->query("SELECT COUNT(asset_id) AS asset_counter FROM asset");
$smarty->assign("asset_counter", $sth->fetchColumn());
// location
$query = "SELECT
COUNT(location_id) AS location_counter
FROM
location";
$locations = $db->db_select($query);
$smarty->assign("location_counter", $locations[0]['location_counter']);
$sth = $dbh->query("SELECT COUNT(location_id) AS location_counter FROM location");
$smarty->assign("location_counter", $sth->fetchColumn());
// node
$query = "SELECT
COUNT(node_id) AS node_counter
FROM
node";
$nodes = $db->db_select($query);
$smarty->assign("node_counter", $nodes[0]['node_counter']);
$sth = $dbh->query("SELECT COUNT(node_id) AS node_counter FROM node");
$smarty->assign("node_counter", $sth->fetchColumn());
// subnet
$query = "SELECT
COUNT(subnet_id) AS subnet_counter
FROM
subnet";
$subnets = $db->db_select($query);
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']);
$sth = $dbh->query("SELECT COUNT(subnet_id) AS subnet_counter FROM subnet");
$smarty->assign("subnet_counter", $sth->fetchColumn());
// vlan
$query = "SELECT
COUNT(vlan_id) AS vlan_counter
FROM
vlan";
$vlans = $db->db_select($query);
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']);
$sth = $dbh->query("SELECT COUNT(vlan_id) AS vlan_counter FROM vlan");
$smarty->assign("vlan_counter", $sth->fetchColumn());
// zone
$query = "SELECT
COUNT(zone_id) AS zone_counter
FROM
zone";
$zones = $db->db_select($query);
$smarty->assign("zone_counter", $zones[0]['zone_counter']);
$sth = $dbh->query("SELECT COUNT(zone_id) AS zone_counter FROM zone");
$smarty->assign("zone_counter", $sth->fetchColumn());
$smarty->display("index.tpl");

@ -1,6 +1,8 @@
IP Reg Installation
1. Install requirements
Minimum PHP version is 7.4, we are using arrow functions introduced
in that version.
IP Reg version 0.6 and up depends on smarty template engine.
In Debian install it with: "apt-get install smarty3".
The PHP-GD module is also required: "apt-get install php-gd".

@ -4,6 +4,9 @@ CREATE TABLE asset (
asset_hostname varchar(100) DEFAULT NULL,
assetclass_id int(10) NOT NULL,
asset_info text DEFAULT NULL,
asset_intf smallint(5) UNSIGNED NOT NULL DEFAULT 1,
asset_location int(10) DEFAULT NULL,
asset_type enum ('active','passive') NOT NULL DEFAULT 'active',
PRIMARY KEY (asset_id),
INDEX ix_asset_name (asset_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -20,16 +23,44 @@ CREATE TABLE assetclassgroup (
assetclassgroup_id int(10) NOT NULL AUTO_INCREMENT,
assetclassgroup_name varchar(100) NOT NULL,
assetclassgroup_color varchar(6) NOT NULL DEFAULT '000000',
assetclassgroup_description varchar(100) DEFAULT NULL,
PRIMARY KEY (assetclassgroup_id),
INDEX ix_assetclassgroup_name (assetclassgroup_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- WIP
CREATE TABLE cable (
cable_id int(10) NOT NULL AUTO_INCREMENT,
cable_description varchar(100) NOT NULL,
cable_from_id int(10) DEFAULT NULL,
cable_to_id int(10) DEFAULT NULL,
cable_length smallint(5) UNSIGNED DEFAULT NULL,
cable_links smallint(5) UNSIGNED DEFAULT 1,
cable_type enum('copper','fibre','laser','radio') DEFAULT NULL,
cable_info text DEFAULT NULL,
PRIMARY KEY (cable_id),
UNIQUE INDEX ix_cable_description (cable_description)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- WIP
-- Reference to external systems
CREATE TABLE extlink (
extlink_id int(10) NOT NULL AUTO_INCREMENT,
asset_id int(10) NOT NULL,
extlink_type enum('cdb','zabbix', 'topdesk') NOT NULL DEFAULT 'cdb',
extlink_refid int(10) DEFAULT NULL,
extlink_uid varchar(65) DEFAULT NULL,
PRIMARY KEY (extlink_id),
INDEX ix_extlink_asset_id (asset_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE location (
location_id int(10) NOT NULL AUTO_INCREMENT,
location_name varchar(100) NOT NULL,
location_parent int(10) NOT NULL DEFAULT 0,
location_info text DEFAULT NULL,
location_sort int(11) NOT NULL DEFAULT 0,
location_type enum('location', 'building','room','rack') NOT NULL DEFAULT 'location',
location_sort smallint(6) NOT NULL DEFAULT 0,
PRIMARY KEY (location_id),
INDEX ix_location_sort (location_sort),
INDEX ix_location_name (location_name)
@ -40,6 +71,9 @@ CREATE TABLE nat (
nat_type int(1) NOT NULL,
nat_ext int(10) NOT NULL,
nat_int int(10) NOT NULL,
nat_ext_port smallint(5) UNSIGNED DEFAULT NULL,
nat_int_port smallint(5) UNSIGNED DEFAULT NULL,
nat_description varchar(100) DEFAULT NULL,
PRIMARY KEY (nat_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -85,6 +119,7 @@ CREATE TABLE subnetvlan (
CREATE TABLE user (
user_id int(10) NOT NULL AUTO_INCREMENT,
user_realm enum ('local','ldap') NOT NULL DEFAULT 'local',
user_name varchar(100) NOT NULL,
user_pass binary(60) NOT NULL,
user_displayname varchar(100) NOT NULL,

@ -49,6 +49,10 @@ INSERT INTO subnetlocation (subnet_id, location_id) VALUES
INSERT INTO subnetvlan (subnet_id, vlan_id) VALUES
(1, 1);
INSERT INTO user (user_name, user_pass, user_displayname) VALUES
('alice', '$2y$10$CTq04qodeKZBgeuShC3E..cEzfh.SDlaoOEUWcCXXHPDvXJ51nGdq', 'Alice'),
('bob', '$2y$10$hl4NN4lOyuz7KN0ZjLHbOuCqGi08GVaTvl/RiMcL1mbFqGmtzDN76', 'Bob');
INSERT INTO vlan (vlan_number, vlan_name) VALUES
(1, 'DEFAULT_VLAN');

@ -0,0 +1,24 @@
IP Reg Upgrading
This version has still not reached version 1.0 (feature complete).
As such, there may be changes at any time.
There is no database upgrade logic so the database structure has
to be compared manually.
1. Check and upgrade database schema
Compare current database schema with the contents of the database
creation script "mysql.sql".
Create missing objects in your current database.
2. Install new version
Install the new application in a new location.
Copy the configuration file "config.php" to new installation.
Compare the configuration to the sample config.
There may be additional settings that you want to customize.
3. Switch to new version
Rename the old an new directory.
4. Done
If everything works fine you could remove the old directory.

@ -44,6 +44,10 @@ $lang = array(
'lang_submit' => 'Absenden',
'lang_unassigned' => 'Nicht zugeordnet',
'lang_warning' => 'Warnung',
'lang_description' => 'Beschreibung',
'lang_empty' => 'leer',
'lang_source' => 'Quelle',
'lang_target' => 'Ziel',
'lang_asset_add' => 'Objekt hinzufügen',
'lang_asset_del' => 'Objekt löschen',

@ -44,6 +44,10 @@ $lang = array(
'lang_submit' => 'Submit',
'lang_unassigned' => 'Unassigned',
'lang_warning' => 'Warning',
'lang_description' => 'Description',
'lang_empty' => 'empty',
'lang_source' => 'Source',
'lang_target' => 'Target',
'lang_asset_add' => 'Add asset',
'lang_asset_del' => 'Delete asset',
@ -62,7 +66,7 @@ $lang = array(
'lang_assetclassgroup_add' => 'Add assetclassgroup',
'lang_assetclassgroup_del' => 'Delete assetclassgroup',
'lang_assetclassgroup_edit' => 'Modify assetclassgroup',
'lang_assetclassgroup_name' => 'Assetclass Groupname',
'lang_assetclassgroup_name' => 'Assetclassgroup Name',
'lang_assetclassgroup_none' => 'There are no assetclassegroups defined',
'lang_assignnodetoasset' => 'Assign node to asset',
@ -143,6 +147,7 @@ $lang = array(
'lang_user_edit' => 'Mofidy user',
'lang_user_name' => 'Username',
'lang_user_password' => 'Password',
'lang_user_language' => 'Language',
'lang_user_realm' => 'Realm',
'lang_zone_add' => 'Add zone',
@ -158,7 +163,6 @@ $lang = array(
'lang_vlan_new' => 'VLAN info',
'lang_vlan_name' => 'VLAN name',
'lang_vlan_none' => 'There are no VLANs defined',
'lang_user_language' => 'Language',
'lang_vlansubnet' => 'VLAN/Subnet',
'lang_vlansubnet_edit' => 'Edit VLAN/Subnet',

@ -15,11 +15,11 @@ $config_lang = array('de', 'en');
include("lib/functions.php");
require("lib/db.class.php");
$db = new Db($dblink);
//require("lib/db.class.php");
//$db = new Db($dblink);
require("lib/user.class.php");
$user = new User();
//require("lib/user.class.php");
// $user = new User();
require_once('smarty3/Smarty.class.php');
$smarty = new Smarty();
@ -29,4 +29,102 @@ $smarty->registerPlugin('function', 'treelist', 'print_tree');
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips'] ?? 'off');
// ========== DATABASE FUCTIONS ===============================================
function db_load_enum($table, $column) {
// returns array of enum-values as defined in database
global $dbh;
$sql = "SELECT TRIM(TRAILING ')' FROM SUBSTRING(column_type,6))
FROM information_schema.columns
WHERE table_name=? AND column_name=?";
$sth = $dbh->prepare($sql);
$sth->execute([$table, $column]);
return array_map(fn($x) => trim($x, "'"), explode(',', $sth->fetch(PDO::FETCH_NUM)));
}
function db_get_options_asset() {
global $dbh;
$sql = "SELECT asset_id, asset_name FROM asset ORDER BY asset_name";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_assetclass() {
global $dbh;
$sql = "SELECT assetclass_id, assetclass_name FROM assetclass ORDER BY assetclass_name";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_assetclassgroup() {
global $dbh;
$sql = "SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup ORDER BY assetclassgroup_name";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_location($default = NULL) {
global $dbh;
$options = array();
if ($default != NULL) {
$options[0] = $default;
}
$sql = "SELECT location_id, location_name FROM location ORDER BY location_name";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_subnet() {
global $dbh;
$sql = "SELECT subnet_id,
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
FROM subnet
ORDER BY INET_ATON(subnet_address)";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_vlan($default = NULL) {
global $dbh;
$options = array();
if ($default != NULL) {
$options[0] = $default;
}
$sql = "SELECT vlan_id, vlan_name FROM vlan ORDER BY vlan_name";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
function db_get_options_zone($default = NULL) {
global $dbh;
$options = array();
if ($default != NULL) {
$options[0] = $default;
}
$sql = "SELECT zone_id, zone_origin FROM zone ORDER BY zone_origin";
$sth = $dbh->query($sql);
foreach ($sth->fetchAll(PDO::FETCH_NUM) as $rec) {
$options[$rec[0]] = $rec[1];
}
return $options;
}
?>

@ -1,172 +0,0 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
For more information, visit http://sourceforge.net/projects/ipreg,
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
class Db {
protected $dblink;
public function __construct ($dblink) {
$this->dblink = $dblink;
}
function db_delete($query) {
// run query
$sql = mysqli_query($this->dblink, $query) or die(mysqli_error($this->dblink));
}
function db_insert($query) {
// run query
$sql = mysqli_query($this->dblink, $query) or die(mysqli_error($this->dblink));
// return result
return mysqli_insert_id($this->dblink);
}
function db_select($query) {
// run query
$sql = mysqli_query($this->dblink, $query) or die(mysqli_error($this->dblink));
// loop results
$result = array();
while($record = mysqli_fetch_assoc($sql)) {
$result[] = $record;
}
// return array
return $result;
}
function db_update($query) {
// run query
$sql = mysqli_query($this->dblink, $query) or die(mysqli_error($this->dblink));
}
function options_asset($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT asset_id, asset_name
FROM asset
ORDER BY asset_name";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['asset_id']] = $rec['asset_name'];
}
return $options;
}
function options_assetclass($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT assetclass_id, assetclass_name
FROM assetclass
ORDER BY assetclass_name";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['assetclass_id']] = $rec['assetclass_name'];
}
return $options;
}
function options_assetclassgroup($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT assetclassgroup_id, assetclassgroup_name
FROM assetclassgroup
ORDER BY assetclassgroup_name";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['assetclassgroup_id']] = $rec['assetclassgroup_name'];
}
return $options;
}
function options_location($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT location_id,
location_name
FROM location
ORDER BY location_name";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['location_id']] = $rec['location_name'];
}
return $options;
}
function options_subnet($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT subnet_id,
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
FROM subnet
ORDER BY INET_ATON(subnet_address)";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['subnet_id']] = $rec['subnet_name'];
}
return $options;
}
function options_vlan($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT vlan_id,
CONCAT_WS(' - ', vlan_number, vlan_name) AS vlan_option
FROM vlan
ORDER BY vlan_number";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['vlan_id']] = $rec['vlan_option'];
}
return $options;
}
function options_zone($null_value=NULL) {
$options = array();
if (isset($null_value)) {
$options[0] = $null_value;
}
$sql = "SELECT zone_id, zone_origin
FROM zone
ORDER BY zone_origin";
$records = $this->db_select($sql);
foreach ($records as $rec) {
$options[$rec['zone_id']] = $rec['zone_origin'];
}
return $options;
}
}
?>

@ -74,9 +74,6 @@ function sanitize($input) {
// convert special chars
$input = htmlentities($input,ENT_QUOTES,'UTF-8');
// make sql ready
$input = mysqli_real_escape_string($dblink, $input);
// and return
return $input;
}

@ -11,15 +11,11 @@ include("includes.php");
include("header.php");
$query = "SELECT
location_id AS id,
location_name AS value,
location_parent AS parent_id
FROM
location
$sql = "SELECT location_id AS id, location_name AS value, location_parent AS parent_id
FROM location
ORDER BY location_parent, location_sort, location_name";
$locations = $db->db_select($query);
$sth = $dbh->query($sql);
$locations = $sth->fetchAll();
// function for recursion
function build_tree($parent_id, $level) {

@ -16,18 +16,16 @@ include("header.php");
// ************* <option value="0">{$lang_option_none}</option>
$query = "SELECT location_id, location_name, location_parent, location_sort
$sql = "SELECT location_id AS id, location_name, location_parent, location_sort
FROM location
ORDER BY location_parent, location_sort, location_name";
$locations = $db->db_select($query);
$sth = $dbh->query($sql);
$locations = $sth->fetchAll();
$location_counter = count($locations);
if ($location_counter > 0) {
// get objects
foreach ($locations AS $location) {
// create arrays
$location_names[$location['location_id']] = $location['location_name'];
$parents[$location['location_parent']][] = $location['location_id'];
}
@ -36,7 +34,6 @@ if ($location_counter>0) {
// look for parents
// function to look for parents and create a new array for every child
function location($parents, $parent = 0) {
// loop array to check
foreach ($parents[$parent] as $child) {
if (isset($parents[$child])) {
// element has children
@ -47,7 +44,6 @@ function location($parents, $parent = 0) {
}
}
// and again...
return $children;
}

@ -13,17 +13,10 @@ $location_id = sanitize($_GET['location_id']);
include("header.php");
$query = "SELECT
location_name
FROM
location
WHERE
location_id=" . $location_id;
$location = $db->db_select($query);
$smarty->assign("location_id", $location_id);
$smarty->assign("location_name", $location[0]['location_name']);
$sql = "SELECT location_id AS id, location_name AS name FROM location WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$smarty->assign("location", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("locationdel.tpl");

@ -14,38 +14,32 @@ $location_id = sanitize($_GET['location_id']);
include("header.php");
// location
$query = "SELECT
location_name,
location_parent,
location_info,
location_sort
FROM
location
WHERE
location_id=" . $location_id;
$sql = "SELECT location_id AS id, location_name AS name, location_parent AS parent,
location_info AS info, location_sort AS sort
FROM location
WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$location = $sth->fetch(PDO::FETCH_OBJ);
$location = $db->db_select($query);
$location_parent = $location->parent;
$location_parent = $location[0]['location_parent'];
$smarty->assign("location", $location);
$smarty->assign("location_id", $location_id);
/*$smarty->assign("location_id", $location_id);
$smarty->assign("location_name", $location[0]['location_name']);
$smarty->assign("location_info", $location[0]['location_info']);
$smarty->assign("location_sort", $location[0]['location_sort']);
$smarty->assign("location_sort", $location[0]['location_sort']); */
// parent location
$query = "SELECT
location_id,
location_name,
location_parent
FROM
location
WHERE
location_id != " . $location_id . "
ORDER BY
location_name";
$locations = $db->db_select($query);
$sql = "SELECT location_id, location_name, location_parent
FROM location
WHERE location_id != ?
ORDER BY location_name";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$locations = $sth->fetchAll();
$location_counter = count($locations);

@ -13,18 +13,15 @@ $location_id = sanitize($_GET['location_id']);
include("header.php");
$query = "SELECT
location_name
FROM
location
WHERE
location_id=" . $location_id;
$sql = "SELECT location_id AS id, location_name AS name
FROM location
WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$smarty->assign("location", $sth->fetch(PDO::FETCH_OBJ));
$location = $db->db_select($query);
$smarty->assign("location_id", $location_id);
$smarty->assign("location_name", $location[0]['location_name']);
$smarty->assign("subnet_options", $db->options_subnet());
$smarty->display("locationsubnetadd.tpl");
include("footer.php");

@ -14,32 +14,29 @@ $location_id = sanitize($_GET['location_id']);
include("header.php");
// location
$query = "SELECT
location_name
FROM
location
WHERE
location_id=" . $location_id;
$location = $db->db_select($query);
$sql = "SELECT location_id AS id, location_name AS name
FROM location
WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$smarty->assign("location", $sth->fetch(PDO::FETCH_OBJ));
$smarty->assign("location_id", $location_id);
$smarty->assign("location_name", $location[0]['location_name']);
// subnet
$query = "SELECT
$sql = "SELECT
s.subnet_id,
s.subnet_address,
s.subnet_mask
FROM
subnetlocation AS l LEFT JOIN subnet AS s USING (subnet_id)
WHERE
l.location_id=" . $location_id . "
l.location_id=?
ORDER BY
INET_ATON(s.subnet_address)";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$subnets = $db->db_select($query);
$smarty->assign($subnets);
$smarty->assign($sth->fetchAll());
$smarty->display("locationsubnetdel.tpl");

@ -12,18 +12,13 @@ include("includes.php");
$location_id = sanitize($_GET['location_id']);
include("header.php");
// location
$query = "SELECT
location_name
FROM
location
WHERE
location_id=" . $location_id;
$location = $db->db_select($query);
$smarty->assign("location_id", $location_id);
$smarty->assign("location_name", $location[0]['location_name']);
$sql = "SELECT location_id AS id, location_name AS name
FROM location
WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$zone_id]);
$smarty->assign("location", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("locationsubnetedit.tpl");

@ -10,69 +10,56 @@ SPDX-License-Identifier: GPL-3.0-or-later
include("includes.php");
$location_id = sanitize($_GET['location_id']);
if ((isset($_GET['id'])) ? $id = sanitize($_GET['id']) : $id = '');
include("header.php");
// locationcrumb
// base location
$sql = "SELECT location_id AS id, location_name AS name,
location_parent AS parent_id, location_info AS info,
CONCAT('locationview.php?location_id=', location_id) AS url
FROM location
WHERE location_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$location = $sth->fetch(PDO::FETCH_OBJ);
$smarty->assign("location", $location);
$query = "SELECT location_id AS id,
location_name AS name,
// crumbs
$crumbs[] = $location;
$sql = "SELECT location_id AS id, location_name AS name,
location_parent AS parent_id,
location_info
FROM location
WHERE location_id=" . $location_id;
$location = $db->db_select($query);
$location[0]['url'] = 'locationview.php?location_id=' . $location[0]['id'];
$crumbs[] = $location[0];
$level = 1;
while ($crumbs[0]['parent_id'] != 0) {
$query = "SELECT location_id AS id,
location_name AS name,
location_parent AS parent_id
CONCAT('locationview.php?location_id=', location_id) AS url
FROM location
WHERE location_id=" . $crumbs[0]['parent_id'];
$result = $db->db_select($query);
$result[0]['url'] = 'locationview.php?location_id=' . $result[0]['id'];
array_unshift($crumbs, $result[0]);
$level++;
WHERE location_id=?";
$sth = $dbh->prepare($sql);
while ($crumbs[0]->parent_id != 0) {
$sth->execute([$crumbs[0]->parent_id]);
$result = $sth->fetch(PDO::FETCH_OBJ);
array_unshift($crumbs, $result);
}
$smarty->assign("location_id", $location_id);
$smarty->assign("location_info", nl2br($location[0]['location_info']));
$smarty->assign("crumbs", $crumbs);
// sublocations
$query = "SELECT
location_id AS sublocation_id,
location_name AS sublocation_name,
$sql = "SELECT location_id AS sublocation_id, location_name AS sublocation_name,
LEFT(location_info, 40) AS info_short,
CHAR_LENGTH(location_info) AS info_length
FROM
location
WHERE
location_parent=" . $location_id . "
ORDER BY
location_name";
$sublocations = $db->db_select($query);
$smarty->assign("sublocations", $sublocations);
FROM location
WHERE location_parent=?
ORDER BY location_name";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$smarty->assign("sublocations", $sth->fetchAll());
// subnets
$query = "SELECT
s.subnet_id,
s.subnet_address,
s.subnet_mask
FROM
subnet AS s LEFT JOIN subnetlocation USING (subnet_id)
WHERE
subnetlocation.location_id=" . $location_id . "
ORDER BY
INET_ATON(s.subnet_address)";
$subnets = $db->db_select($query);
$smarty->assign("subnets", $subnets);
$sql = "SELECT s.subnet_id, s.subnet_address, s.subnet_mask
FROM subnet AS s LEFT JOIN subnetlocation AS l USING (subnet_id)
WHERE l.location_id=?
ORDER BY INET_ATON(s.subnet_address)";
$sth = $dbh->prepare($sql);
$sth->execute([$location_id]);
$smarty->assign("subnets", $sth->fetchAll());
$smarty->display("locationview.tpl");

@ -12,27 +12,86 @@ session_start();
include("config.php");
include("dbconnect.php");
include("lib.php");
// include language file
function user_login ($user_name, $user_pass) {
global $dbh;
if (strlen($user_name) < 1) {
return FALSE;
}
if (strlen($user_pass) < 1) {
return FALSE;
}
$sql = "SELECT user_id, user_pass, user_displayname, user_language,
user_imagesize, user_imagecount, user_mac, user_dateformat,
user_dns1suffix, user_dns2suffix, user_menu_assets,
user_menu_assetclasses, user_menu_assetclassgroups,
user_menu_locations, user_menu_nodes, user_menu_subnets,
user_menu_users, user_menu_vlans, user_menu_zones,
user_tooltips
FROM user
WHERE user_name=?";
$sth = $dbh->prepare($sql);
$sth->execute([$user_name]);
if (!$user = $sth->fetch(PDO::FETCH_OBJ)) {
// no user record found
return FALSE;
}
if (strcmp(md5($user_pass), rtrim($user->user_pass)) != 0) {
// password does not match with md5, check if new hash matches
// For future expansion: $pwd_peppered = hash_hmac('sha256', $user_pass, $config_pepper);
if (! password_verify($user_pass, $user->user_pass)) {
return FALSE;
}
} else {
// md5 match but outdated. rewrite with new algo
$sth = $dbh->prepare("UPDATE user SET user_pass=? WHERE user_id=?");
$newhash = password_hash($user_pass, PASSWORD_BCRYPT);
$sth->execute([$newhash, $user->user_id]);
}
// all ok: user is logged in, register session data
$_SESSION['suser_id'] = $user->user_id;
$_SESSION['suser_displayname'] = $user->user_displayname;
$_SESSION['suser_language'] = $user->user_language;
$_SESSION['suser_imagesize'] = $user->user_imagesize;
$_SESSION['suser_imagecount'] = $user->user_imagecount;
$_SESSION['suser_mac'] = $user->user_mac;
$_SESSION['suser_dateformat'] = $user->user_dateformat;
$_SESSION['suser_dns1suffix'] = $user->user_dns1suffix;
$_SESSION['suser_dns2suffix'] = $user->user_dns2suffix;
$_SESSION['suser_menu_assets'] = $user->user_menu_assets;
$_SESSION['suser_menu_assetclasses'] = $user->user_menu_assetclasses;
$_SESSION['suser_menu_assetclassgroups'] = $user->user_menu_assetclassgroups;
$_SESSION['suser_menu_locations'] = $user->user_menu_locations;
$_SESSION['suser_menu_nodes'] = $user->user_menu_nodes;
$_SESSION['suser_menu_subnets'] = $user->user_menu_subnets;
$_SESSION['suser_menu_users'] = $user->user_menu_users;
$_SESSION['suser_menu_vlans'] = $user->user_menu_vlans;
$_SESSION['suser_menu_zones'] = $user->user_menu_zones;
$_SESSION['suser_tooltips'] = $user->user_tooltips;
return TRUE;
}
// No header included, this page has no menu
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
include('lang/' . $language . '.php');
// check for submit
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
/// get post info
$user_name = sanitize($_POST['user_name']);
$user_pass = sanitize($_POST['user_pass']);
// login
$login = $user->user_login($user_name, $user_pass);
if($login==TRUE) {
// redirect
if (user_login($user_name, $user_pass) == TRUE) {
header_location("index.php");
} else {
// not ok, break session
$_SESSION = array();
session_destroy();
}
@ -40,7 +99,6 @@ if ($_SERVER['REQUEST_METHOD']=="POST" ) {
$smarty->assign("config_version", $config_version);
$smarty->assign($lang);
$smarty->display("login.tpl");
include("footer.php");

@ -14,20 +14,19 @@ $node_id = sanitize($_GET['node_id']);
include("header.php");
// node_ext
$query = "SELECT
node_ip AS node_ip_ext
FROM
node
WHERE
node_id=" . $node_id;
$sql = "SELECT node_ip AS node_ip_ext
FROM node
WHERE node_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$node = $db->db_select($query);
$node = $sth->fetch(PDO::FETCH_OBJ);
$smarty->assign("node_id_ext", $node_id);
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
$smarty->assign("node_ip_ext", $node->node_ip_ext);
// node_int
$query = "SELECT
$sql = "SELECT
a.asset_name,
n.node_id AS node_id_int,
n.node_ip AS node_ip_int
@ -40,13 +39,16 @@ $query = "SELECT
FROM
nat
WHERE
nat_ext=" . $node_id . "
nat_ext=?
)
AND n.node_id!=" . $node_id . "
AND n.node_id!=?
ORDER BY
INET_ATON(n.node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id, $node_id]);
$nodes = $sth->fetchAll();
$nodes = $db->db_select($query);
foreach ($nodes as $rec) {
$node_options[$rec['node_id_int']] = $rec['node_ip_int'] . '/' . $rec['asset_name'];
}

@ -14,39 +14,24 @@ $node_id = sanitize($_GET['node_id']);
include("header.php");
// node_ext
$query = "SELECT
node_ip AS node_ip_ext
FROM
node
WHERE
node_id=" . $node_id;
$node = $db->db_select($query);
$smarty->assign("node_id_ext", $node_id);
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
$sth = $dbh->prepare("SELECT node_id AS id_ext, node_ip AS ip_ext FROM node WHERE node_id=?");
$sth->execute([$node_id]);
$smarty->assign("node", $sth->fetch(PDO::FETCH_OBJ));
// options
$query = "SELECT
a.asset_name,
n.node_ip,
x.nat_ext
FROM
asset AS a,
nat AS x,
node AS n
WHERE
x.nat_ext=" . $node_id . "
AND n.node_id=x.nat_int
AND a.asset_id=n.asset_id
ORDER BY
INET_ATON(n.node_ip)";
$nodes = $db->db_select($query);
$sql = "SELECT x.nat_id, n.node_ip, a.asset_name
FROM nat AS x
LEFT JOIN node AS n ON (x.nat_int=n.node_id)
LEFT JOIN asset AS a USING (asset_id)
WHERE x.nat_ext=?
ORDER BY INET_ATON(n.node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$nats = $sth->fetchAll();
$options = array();
foreach ($nodes as $rec) {
$options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name'];
foreach ($nats as $rec) {
$options[$rec['nat_id']] = $rec['node_ip'] . '/' . $rec['asset_name'];
}
$smarty->assign("nat_options", $options);
$smarty->display("natdel.tpl");

@ -13,17 +13,10 @@ $node_id = sanitize($_GET['node_id']);
include("header.php");
$query = "SELECT
node_ip
FROM
node
WHERE
node.node_id=" . $node_id;
$node = $db->db_select($query);
$smarty->assign("node_id", $node_id);
$smarty->assign("node_ip", $node[0]['node_ip']);
$sql = "SELECT node_id AS id, node_ip AS ip FROM node WHERE node.node_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$smarty->assign("node", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("natedit.tpl");

@ -10,31 +10,42 @@ SPDX-License-Identifier: GPL-3.0-or-later
include("includes.php");
include("header.php");
// filter preparation
$p = array();
$w = array();
if(isset($_GET['subnet_id'])) {
$subnet_id = sanitize($_GET['subnet_id']);
$subnet_view = "WHERE node.subnet_id=" . $subnet_id;
$w[] = "n.subnet_id=?";
$p[] = $subnet_id;
$smarty->assign("subnet_id", $subnet_id);
// get subnet details for title
$sql = "SELECT CONCAT_WS('/',subnet_address,subnet_mask) AS subnet
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetchColumn());
} else {
$smarty->assign("subnet_id", '');
$subnet_view = '';
}
$query = "SELECT
asset.asset_id,
REPLACE(asset.asset_name, ' ', '&nbsp;') AS asset_name,
asset.asset_info,
node.node_id,
node.node_ip
FROM
asset LEFT JOIN node USING (asset_id)
" . $subnet_view . "
GROUP BY
node.node_id
ORDER BY
INET_ATON(node.node_ip)";
$nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
// create sql with optional filter
$where = join(' AND ', $w);
$sql = "SELECT a.asset_id, a.asset_info,
REPLACE(a.asset_name, ' ', '&nbsp;') AS asset_name,
n.node_id, n.node_ip
FROM node AS n LEFT JOIN asset AS a USING (asset_id)";
if ($where) {
$sql .= ' WHERE ' . $where;
}
$sql .= "GROUP BY n.node_id ORDER BY INET_ATON(n.node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute($p);
$smarty->assign("nodes", $sth->fetchAll());
$smarty->display("node.tpl");
include("footer.php");

@ -19,8 +19,8 @@ $smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']);
$smarty->assign("node_ip", $node_ip);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_options", $db->options_subnet());
$smarty->assign("assetclass_options", $db->options_assetclass());
$smarty->assign("subnet_options", db_get_options_subnet());
$smarty->assign("assetclass_options", db_get_options_assetclass());
$smarty->display("nodeadd.tpl");
include("footer.php");

@ -13,21 +13,10 @@ $node_id = sanitize($_GET['node_id']);
include("header.php");
$query = "SELECT
asset_id,
node_ip
FROM
node
WHERE
node_id=" . $node_id;
// run query
$node = $db->db_select($query);
// send to tpl
$smarty->assign("node_id", $node_id);
$smarty->assign("asset_id", $node[0]['asset_id']);
$smarty->assign("node_ip", $node[0]['node_ip']);
$sql = "SELECT node_id AS id, node_ip AS ip, asset_id FROM node WHERE node_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$smarty->assign("node", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("nodedel.tpl");

@ -13,40 +13,18 @@ $node_id = sanitize($_GET['node_id']);
include("header.php");
$query = "SELECT
a.asset_id,
n.node_id,
n.node_ip,
n.node_mac,
n.node_dns1,
n.node_dns2,
n.node_info,
s.subnet_id,
n.zone_id
FROM
asset AS a,
node AS n,
subnet AS s
WHERE
a.asset_id=n.asset_id
AND n.node_id=" . $node_id . "
AND s.subnet_id=n.subnet_id";
$node = $db->db_select($query);
$smarty->assign("node_id", $node[0]['node_id']);
$smarty->assign("node_ip", $node[0]['node_ip']);
$smarty->assign("node_mac", write_mac($node[0]['node_mac']));
$smarty->assign("node_dns1", $node[0]['node_dns1']);
$smarty->assign("node_dns2", $node[0]['node_dns2']);
$smarty->assign("node_info", $node[0]['node_info']);
$smarty->assign("asset_id", $node[0]['asset_id']);
$smarty->assign("subnet_id", $node[0]['subnet_id']);
$smarty->assign("zone_id", $node[0]['zone_id']);
$smarty->assign("asset_options", $db->options_asset());
$smarty->assign("subnet_options", $db->options_subnet());
$smarty->assign("zone_options", $db->options_zone("(keine)"));
$sql = "SELECT node_id AS id, node_ip AS ip, node_mac AS mac,
node_dns1 AS dns1, node_dns2 AS dns2, node_info AS info,
zone_id, asset_id, subnet_id
FROM node
WHERE node_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$smarty->assign("node", $sth->fetch(PDO::FETCH_OBJ));
$smarty->assign("asset_options", db_get_options_asset());
$smarty->assign("subnet_options", db_get_options_subnet());
$smarty->assign("zone_options", db_get_options_zone('(keine)'));
$smarty->display("nodeedit.tpl");

@ -18,17 +18,18 @@ if (isset($_GET['node_id']) && (!empty($_GET['node_id']))) {
}
include("header.php");
// node
$query = "SELECT
$sql = "SELECT
asset.asset_id,
asset.asset_name,
node.node_id,
node.node_ip,
node.node_mac,
node.node_dns1,
node.node_dns2,
node.node_info,
node.node_type,
node.node_id AS id,
node.node_ip AS ip,
node.node_mac AS mac,
node.node_dns1 AS dns1,
node.node_dns2 AS dns2,
node.node_info AS info,
node.node_type AS type,
subnet.subnet_id,
subnet.subnet_address,
subnet.subnet_mask,
@ -39,14 +40,16 @@ $query = "SELECT
JOIN subnet USING (subnet_id)
LEFT JOIN zone USING (zone_id)
WHERE
node.node_id=" . $node_id;
node.node_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$node_id]);
$node = $db->db_select($query);
$node[0]['node_mac'] = write_mac($node[0]['node_mac']);
$smarty->assign("node", $node[0]);
$node = $sth->fetch(PDO::FETCH_OBJ);
$node->mac = write_mac($node->mac);
$smarty->assign("node", $node);
// nat
$query = "SELECT
$sql = "SELECT
asset_ext.asset_id AS asset_id_ext,
asset_int.asset_id AS asset_id_int,
asset_ext.asset_name AS asset_name_ext,
@ -66,8 +69,7 @@ $query = "SELECT
node AS node_ext,
node AS node_int
WHERE
(nat.nat_ext=" . $node_id . "
OR nat.nat_int=" . $node_id . ")
(nat.nat_ext=:node_id OR nat.nat_int=:node_id)
AND node_ext.node_id=nat.nat_ext
AND node_int.node_id=nat.nat_int
AND asset_ext.asset_id=node_ext.asset_id
@ -76,8 +78,10 @@ $query = "SELECT
INET_ATON(node_ext.node_ip),
INET_ATON(node_int.node_ip)";
$natrules = $db->db_select($query);
$smarty->assign("natrules", $natrules);
$sth = $dbh->prepare($sql);
$sth->execute(['node_id' => $node_id]);
$smarty->assign("natrules", $sth->fetchAll());
$smarty->display("nodeview.tpl");

@ -15,129 +15,99 @@ include("header.php");
if (empty($search)) {
// parse nosearch box
$smarty->assign("nosearch", TRUE);
} else {
$smarty->display("search.tpl");
include("footer.php");
exit;
}
// hide nosearch box
$smarty->assign("nosearch", FALSE);
$smarty->assign("search", $search);
// set needle
$needle = '%' . $search . '%';
// set counter
$resultcounter = 0;
// asset
$query = "SELECT
asset_id AS id,
asset_name AS name,
asset_info AS description
FROM
asset
WHERE
asset_name LIKE '" . $needle . "'
OR asset_hostname LIKE '" . $needle . "'
OR asset_info LIKE '" . $needle . "'
ORDER BY
asset_name";
$assets = $db->db_select($query);
$sql = "SELECT asset_id AS id, asset_name AS name, asset_info AS description
FROM asset
WHERE asset_name LIKE :needle OR asset_hostname LIKE :needle
OR asset_info LIKE :needle
ORDER BY asset_name";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$assets = $sth->fetchAll();
$resultcounter += count($assets);
$smarty->assign("assets", $assets);
// location
$query = "SELECT
location_id AS id,
location_name AS name
FROM
location
WHERE
location_name LIKE '" . $needle . "'
OR location_info LIKE '" . $needle . "'
ORDER BY
location_name";
$locations = $db->db_select($query);
$sql = "SELECT location_id AS id, location_name AS name
FROM location
WHERE location_name LIKE :needle OR location_info LIKE :needle
ORDER BY location_name";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$locations = $sth->fetchAll();
$resultcounter += count($locations);
$smarty->assign("locations", $locations);
// node
$query = "SELECT
node_id AS id,
node_ip AS ip
FROM
node
WHERE
node_ip LIKE '" . $needle . "'
OR node_mac LIKE '" . $needle . "'
OR node_dns1 LIKE '" . $needle . "'
OR node_dns2 LIKE '" . $needle . "'
OR node_info LIKE '" . $needle . "'
ORDER BY
node_ip";
$nodes = $db->db_select($query);
$sql = "SELECT node_id AS id, node_ip AS ip
FROM node
WHERE node_ip LIKE :needle OR node_mac LIKE :needle
OR node_dns1 LIKE :needle OR node_dns2 LIKE :needle
OR node_info LIKE :needle
ORDER BY node_ip";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$nodes = $sth->fetchAll();
$resultcounter += count($nodes);
$smarty->assign("nodes", $nodes);
// subnet
$query = "SELECT
subnet_id AS id,
subnet_address AS address
FROM
subnet
WHERE
subnet_address LIKE '" . $needle . "'
OR subnet_info LIKE '" . $needle . "'
ORDER BY
subnet_address";
// run query
$subnets = $db->db_select($query);
$sql = "SELECT subnet_id AS id, subnet_address AS address
FROM subnet
WHERE subnet_address LIKE :needle OR subnet_info LIKE :needle
ORDER BY subnet_address";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$subnets = $sth->fetchAll();
$resultcounter += count($subnets);
$smarty->assign("subnets", $subnets);
// vlan
$query = "SELECT
vlan_id AS id,
vlan_name AS name
FROM
vlan
WHERE
vlan_name LIKE '" . $needle . "'
OR vlan_info LIKE '" . $needle . "'
ORDER BY
vlan_name";
$vlans = $db->db_select($query);
$sql = "SELECT vlan_id AS id, vlan_name AS name
FROM vlan
WHERE vlan_name LIKE :needle OR vlan_info LIKE :needle
ORDER BY vlan_name";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$vlans = $sth->fetchAll();
$resultcounter += count($vlans);
$smarty->assign("vlans", $vlans);
// setup zone
$query = "SELECT
zone_id AS id,
zone_origin AS origin
FROM
zone
WHERE
zone_origin LIKE '" . $needle . "'
OR zone_soa LIKE '" . $needle . "'
OR zone_hostmaster LIKE '" . $needle . "'
OR zone_ns1 LIKE '" . $needle . "'
OR zone_ns2 LIKE '" . $needle . "'
OR zone_ns3 LIKE '" . $needle . "'
OR zone_mx1 LIKE '" . $needle . "'
OR zone_mx2 LIKE '" . $needle . "'
OR zone_info LIKE '" . $needle . "'
ORDER BY
zone_origin";
$zones = $db->db_select($query);
$sql = "SELECT zone_id AS id, zone_origin AS origin
FROM zone
WHERE zone_origin LIKE :needle OR zone_soa LIKE :needle
OR zone_hostmaster LIKE :needle OR zone_ns1 LIKE :needle
OR zone_ns2 LIKE :needle OR zone_ns3 LIKE :needle
OR zone_mx1 LIKE :needle OR zone_mx2 LIKE :needle
OR zone_info LIKE :needle
ORDER BY zone_origin";
$sth = $dbh->prepare($sql);
$sth->execute(['needle' => $needle]);
$zones = $sth->fetchAll();
$resultcounter += count($zones);
$smarty->assign("zones", $zones);
// grand totals
$smarty->assign("resultcounter", $resultcounter);
}
$smarty->display("search.tpl");

File diff suppressed because it is too large Load Diff

@ -10,24 +10,17 @@ SPDX-License-Identifier: GPL-3.0-or-later
include("includes.php");
include("header.php");
$query = "SELECT
s.subnet_id,
s.subnet_address,
s.subnet_mask,
s.ntp_server,
LEFT(s.subnet_info, 40) AS subnet_info,
$sql = "SELECT s.subnet_id, s.subnet_address, s.subnet_mask,
s.ntp_server, LEFT(s.subnet_info, 40) AS subnet_info,
CHAR_LENGTH(s.subnet_info) AS subnet_length,
COUNT(node.subnet_id) AS node_counter
FROM
subnet AS s LEFT JOIN node USING (subnet_id)
GROUP BY
s.subnet_id
ORDER BY
INET_ATON(s.subnet_address)";
FROM subnet AS s LEFT JOIN node USING (subnet_id)
GROUP BY s.subnet_id
ORDER BY INET_ATON(s.subnet_address)";
$sth = $dbh->query($sql);
$subnets = $db->db_select($query);
$smarty->assign("subnets", $sth->fetchAll());
$smarty->assign("subnets", $subnets);
$smarty->display("subnet.tpl");
include("footer.php");

@ -13,21 +13,7 @@ if((isset($_GET['vlan_id'])) ? $vlan_id = sanitize($_GET['vlan_id']) : $vlan_id
include("header.php");
$query = "SELECT
vlan_id,
vlan_number,
vlan_name
FROM
vlan
ORDER BY
vlan_name";
$vlans = $db->db_select($query);
$vlan_options[0] = $lang['lang_option_none'];
foreach ($vlans as $vlan) {
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
}
$smarty->assign("vlan_options", $vlan_options);
$smarty->assign("vlan_options", db_get_options_vlan($lang['lang_option_none']));
$smarty->display("subnetadd.tpl");

@ -14,34 +14,22 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
// subnet
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
// node
$query = "SELECT
node_id,
node_ip
FROM
node
WHERE
subnet_id=" . $subnet_id . "
ORDER BY
INET_ATON(node_ip)";
$nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
$sql = "SELECT node_id AS id, node_ip AS ip
FROM node
WHERE subnet_id=?
ORDER BY INET_ATON(node_ip)";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("nodes", $sth->fetchAll());
$smarty->display("subnetdel.tpl");
include("footer.php");

@ -13,29 +13,15 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$query = "SELECT
subnet_address,
subnet_mask,
protocol_version,
subnet_dhcp_start,
subnet_dhcp_end,
ntp_server,
subnet_info AS subnet_info
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$smarty->assign("subnet_proto_vers", $subnet[0]['protocol_version']);
$smarty->assign("subnet_dhcpstart", $subnet[0]['subnet_dhcp_start']);
$smarty->assign("subnet_dhcpend", $subnet[0]['subnet_dhcp_end']);
$smarty->assign("subnet_ntp_server", $subnet[0]['ntp_server']);
$smarty->assign("subnet_info", $subnet[0]['subnet_info']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask,
protocol_version AS proto_vers, subnet_dhcp_start AS dhcp_start,
subnet_dhcp_end AS dhcp_end, ntp_server, subnet_info AS info
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("subnetedit.tpl");

@ -13,21 +13,15 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
$subnet = $db->db_select($query);
$smarty->assign("location_options", db_get_options_location());
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$smarty->assign("location_options", $db->options_location());
$smarty->display("subnetlocationadd.tpl");
include("footer.php");

@ -14,34 +14,22 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
// subnet
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
// run query
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
// location
$query = "SELECT
l.location_id,
l.location_name
FROM
subnetlocation AS s LEFT JOIN location USING (location_id)
WHERE
s.subnet_id=" . $subnet_id . "
ORDER BY
l.location_name";
// run query
$records = $db->db_select($query);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
// locations for subnet
$sql = "SELECT l.location_id, l.location_name
FROM subnetlocation AS s LEFT JOIN location USING (location_id)
WHERE s.subnet_id=?
ORDER BY l.location_name";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]
$records = $sth->fetchAll();
$locations = array();
foreach ($records as $rec) {
$locations[$rec['location_id']] = $rec['location_name'];

@ -13,20 +13,13 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
// run query
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("subnetlocationedit.tpl");

@ -19,45 +19,34 @@ $smarty->assign("scripts",'changetext.js');
include("header.php");
// subnet
$query = "SELECT
s.subnet_address,
s.subnet_mask,
s.subnet_dhcp_start,
s.subnet_dhcp_end,
s.subnet_info,
s.protocol_version,
$sql = "SELECT
s.subnet_id AS id,
s.subnet_address AS address,
s.subnet_mask AS mask,
s.subnet_dhcp_start AS dhcp_start,
s.subnet_dhcp_end AS dhcp_end,
s.subnet_info AS info,
s.protocol_version AS proto_vers,
s.ntp_server,
COUNT(node.subnet_id) AS node_counter
FROM
subnet AS s LEFT JOIN node USING (subnet_id)
WHERE
s.subnet_id=" . $subnet_id . "
s.subnet_id=?
GROUP BY
s.subnet_id";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$subnet = $db->db_select($query);
$subnet = $sth->fetch(PDO::FETCH_OBJ);
// set needed variables
$subnet_address = $subnet[0]['subnet_address'];
$subnet_mask = $subnet[0]['subnet_mask'];
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start'];
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end'];
$subnet_proto_vers = $subnet[0]['protocol_version'];
$subnet_ntp_server = $subnet[0]['ntp_server'];
$smarty->assign("subnet", $subnet);
// set counters
$host_counter = pow(2,(32-$subnet_mask));
$node_counter = $subnet[0]['node_counter'];
$host_counter = pow(2, (32-$subnet->mask));
$node_counter = $subnet->node_counter;
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet_address);
$smarty->assign("subnet_mask", $subnet_mask);
$smarty->assign("subnet_dhcpstart", $subnet_dhcpstart);
$smarty->assign("subnet_dhcpend", $subnet_dhcpend);
$smarty->assign("subnet_info", nl2br($subnet[0]['subnet_info']));
$smarty->assign("subnet_proto_vers", $subnet_proto_vers);
$smarty->assign("subnet_ntp_server", $subnet_ntp_server);
$smarty->assign("node_counter", $node_counter);
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage);
$smarty->assign("config_color_unused", $config_color_unused);
@ -67,17 +56,17 @@ $smarty->assign("free_counter", (($host_counter-2)-$node_counter));
// subnet
// split up the range
$iprange = explode('.', $subnet_address);
$iprange = explode('.', $subnet->address);
$iprange1 = $iprange[0];
$iprange2 = $iprange[1];
$iprange3 = $iprange[2];
$iprange4 = $iprange[3];
// create empty subnet-array
$subnet = array();
$subnetdata = array();
// determine range (Class A/B/C)
if ($subnet_mask>=24) {
if ($subnet->mask >= 24) {
// Class C
// fill subnet-array with addresses we want to see
for($i=0; $i<$host_counter; $i++) {
@ -85,7 +74,7 @@ if ($subnet_mask>=24) {
$ip = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i);
// fill subnet-array
$subnet[$ip] = array();
$subnetdata[$ip] = array();
}
// calculate broadcast address
@ -108,10 +97,11 @@ if ($subnet_mask>=24) {
// set displayed nodes
$nodes_displayed = $host_counter;
} else if ($subnet_mask>=16) {
} else if ($subnet->mask >= 16) {
// Class B
// which part do we want to see?
if((empty($page)) ? $page=$subnet_address : $page=$page);
if ((empty($page)) ? $page = $subnet->address : $page = $page);
$page = explode('.', $page);
$page2 = $page[2];
@ -121,7 +111,7 @@ if ($subnet_mask>=24) {
$ip = $iprange1 . '.' . $iprange2 . '.' . $page2 . '.' . $i;
// fill subnet-array
$subnet[$ip] = array();
$subnetdata[$ip] = array();
}
// calculate broadcast address
@ -132,7 +122,7 @@ if ($subnet_mask>=24) {
$smarty->assign("iprange2", $iprange2);
// loop addresses in range3
for($i=$iprange3;$i<(pow(2,(32-$subnet_mask))/256);$i++) {
for ($i=$iprange3; $i<(pow(2,(32-$subnet->mask))/256); $i++) {
// send to tpl
$smarty->assign("iprange3", $i);
$smarty->assign("iprange4", 0);
@ -162,7 +152,7 @@ if ($subnet_mask>=24) {
} else {
// Class A
// which part do we want to see?
if((empty($page)) ? $page=$subnet_address : $page=$page);
if ((empty($page)) ? $page = $subnet->address : $page = $page);
$page = explode('.', $page);
$page2 = $page[1];
$page3 = $page[2];
@ -173,7 +163,7 @@ if ($subnet_mask>=24) {
$ip = $iprange1 . '.' . $page2 . '.' . $page3 . '.' . $i;
// fill subnet-array
$subnet[$ip] = array();
$subnetdata[$ip] = array();
}
// calculate broadcast address
@ -184,7 +174,7 @@ if ($subnet_mask>=24) {
$smarty->assign("iprange2", $iprange2);
// loop addresses in range 2
for ($i=$iprange2; $i<(pow(2,(24-$subnet_mask))/256); $i++) {
for ($i=$iprange2; $i<(pow(2,(24-$subnet->mask))/256); $i++) {
// send to tpl
$smarty->assign("iprange1", $iprange1);
$smarty->assign("iprange2", $i);
@ -199,8 +189,6 @@ if ($subnet_mask>=24) {
$smarty->assign("row1_selected", "");
}
// parse block
$tp->parse("two_select_row1");
}
// loop addresses in range 3
@ -219,8 +207,6 @@ if ($subnet_mask>=24) {
$smarty->assign("row2_selected", "");
}
// parse block
$tp->parse("two_select_row2");
}
$smarty->assign("subnetmask1", 255);
@ -238,96 +224,93 @@ if ($subnet_mask>=24) {
}
// get nodes for this subnetview and implement the values into the array
$query = "SELECT
asset.asset_name,
assetclassgroup.assetclassgroup_color,
node.node_id,
node.node_ip
$sql = "SELECT a.asset_name, g.assetclassgroup_color, n.node_id, n.node_ip
FROM
asset,
assetclass,
assetclassgroup,
node
asset AS a,
assetclass AS c,
assetclassgroup AS g,
node AS n
WHERE
node.node_ip IN ('".implode("','",array_keys($subnet))."')
AND node.subnet_id='$subnet_id'
AND asset.asset_id=node.asset_id
AND assetclass.assetclass_id=asset.assetclass_id
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
n.node_ip IN ('".implode("','",array_keys($subnetdata))."')
AND n.subnet_id=?
AND a.asset_id=n.asset_id
AND c.assetclass_id=a.assetclass_id
AND g.assetclassgroup_id=c.assetclassgroup_id";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$nodes = $db->db_select($query);
$nodes = $sth->fetchAll();
$smarty->assign("nodes", $nodes);
$node_counter = count($nodes);
if ($node_counter>0) {
// get objects
if (count($nodes) > 0) {
foreach ($nodes AS $node) {
// add node-values to ip in subnet-array
$subnet[$node['node_ip']] = $node;
$subnetdata[$node['node_ip']] = $node;
}
}
// replace ip's in subnet-array (if necessary)
// check for subnet address
if(array_key_exists($subnet_address, $subnet)) {
if (array_key_exists($subnet->address, $subnet)) {
// replace
$subnet[$subnet_address] = array("subnet_address");
$subnetdata[$subnet->address] = array("subnet_address");
}
// check for broadcast address
if (array_key_exists($broadcast_address, $subnet)) {
// replace
$subnet[$broadcast_address] = array("broadcast_address");
$subnetdata[$broadcast_address] = array("broadcast_address");
}
$dhcpstart = 0;
if ($subnet_dhcpstart && $subnet_dhcpend) {
$dhcpstart = ip2long($subnet_dhcpstart);
$dhcpend = ip2long($subnet_dhcpend);
if ($subnet->dhcp_start && $subnet->dhcp_end) {
$dhcpstart = ip2long($subnet->dhcp_start);
$dhcpend = ip2long($subnet->dhcp_end);
}
// loop subnet-array and send to template
// start counter
// $i=1;
// loop subnet-array
foreach ($subnet AS $node_ip => $node) {
foreach ($subnetdata AS $node_ip => $node) {
// make new line?
// if(($i%$_SESSION['suser_imagecount']==0 && $i!=$nodes_displayed) ? $tr="</tr><tr>" : $tr="");
// check if node-ip in DHCP-area
$subnet[$node_ip]["dynamic"] = false;
$subnetdata[$node_ip]["dynamic"] = false;
if ($dhcpstart > 0) {
$ipval = ip2long($node_ip);
if (($ipval >= $dhcpstart) and ($ipval <= $dhcpend)) {
$subnet[$node_ip]["dynamic"] = true;
$subnetdata[$node_ip]["dynamic"] = true;
}
}
// check node
if (empty($node)) {
// empty node to tpl
$subnet[$node_ip]["url"] = 'assigniptonode.php?subnet_id=' . $subnet_id . '&amp;node_ip='. $node_ip;
$subnet[$node_ip]["remotetext"] = $node_ip;
if ($subnet[$node_ip]["dynamic"]) {
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_dynamic;
$subnetdata[$node_ip]["url"] = 'assigniptonode.php?subnet_id=' . $subnet_id . '&amp;node_ip='. $node_ip;
$subnetdata[$node_ip]["remotetext"] = $node_ip;
if ($subnetdata[$node_ip]["dynamic"]) {
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_dynamic;
} else {
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_unused;
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_unused;
}
} else if (array_key_exists(0, $node) && $node[0]=="subnet_address") {
// subnet address to tpl
$subnet[$node_ip]["url"] = "";
$subnet[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $lang['lang_subnet_subnetaddress'];
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked;
$subnetdata[$node_ip]["url"] = "";
$subnetdata[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $lang['lang_subnet_subnetaddress'];
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_blocked;
} else if (array_key_exists(0, $node) && $node[0]=="broadcast_address") {
// broadcast address to tpl
$subnet[$node_ip]["url"] = "";
$subnet[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $lang['lang_subnet_broadcastaddress'];
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked;
$subnetdata[$node_ip]["url"] = "";
$subnetdata[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $lang['lang_subnet_broadcastaddress'];
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_blocked;
} else {
// node to tpl
$subnet[$node_ip]["url"] = 'nodeview.php?node_id=' . $node['node_id'];
$subnet[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $node['asset_name'];
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color'];
$subnetdata[$node_ip]["url"] = 'nodeview.php?node_id=' . $node['node_id'];
$subnetdata[$node_ip]["remotetext"] = $node_ip . '&nbsp;' . $node['asset_name'];
$subnetdata[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color'];
}
// update counter
@ -335,43 +318,30 @@ foreach ($subnet AS $node_ip => $node) {
} // foreach
$smarty->assign("subnet", $subnet);
$smarty->assign("subnetdata", $subnetdata);
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']);
// vlan
$query = "SELECT
vlan.vlan_id AS vlan_id,
vlan.vlan_name AS vlan_name,
vlan.vlan_number AS vlan_number
FROM
subnetvlan,
vlan
WHERE
subnetvlan.subnet_id=" . $subnet_id . "
AND vlan.vlan_id=subnetvlan.vlan_id
ORDER BY
vlan.vlan_name";
// run query
$vlans = $db->db_select($query);
$smarty->assign("vlans", $vlans);
// location
$query = "SELECT
l.location_id,
l.location_name
FROM
location AS l LEFT JOIN subnetlocation AS s USING (location_id)
WHERE
s.subnet_id=". $subnet_id . "
ORDER BY
l.location_name";
$locations = $db->db_select($query);
$smarty->assign("locations", $locations);
// assetclassgroup
$query = "SELECT
// vlans
$sql = "SELECT v.vlan_id AS id, v.vlan_name AS name,
v.vlan_number AS number
FROM subnetvlan AS s JOIN vlan AS v USING (vlan_id)
WHERE s.subnet_id=?
ORDER BY v.vlan_name";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("vlans", $sth->fetchAll());
// locations
$sql = "SELECT l.location_id, l.location_name
FROM location AS l LEFT JOIN subnetlocation AS s USING (location_id)
WHERE s.subnet_id=?
ORDER BY l.location_name";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("locations", $sth->fetchAll());
// assetclassgroups
$sql = "SELECT
assetclassgroup_id AS id,
assetclassgroup_name AS name,
assetclassgroup_color AS color,
@ -381,13 +351,12 @@ $query = "SELECT
LEFT JOIN asset USING (asset_id)
LEFT JOIN assetclass USING (assetclass_id)
LEFT JOIN assetclassgroup USING (assetclassgroup_id)
WHERE subnet_id=" . $subnet_id . "
WHERE subnet_id=?
GROUP BY assetclass_id
ORDER BY counter DESC";
// run query
$assetclassgroups = $db->db_select($query);
$smarty->assign("assetclassgroups", $assetclassgroups);
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("assetclassgroups", $sth->fetchAll());
$smarty->display("subnetview.tpl");

@ -13,44 +13,25 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
// subnet
// build query
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
// run query
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
// vlan
$query = " SELECT
vlan_id,
vlan_number,
vlan_name
FROM
vlan
WHERE
vlan_id NOT IN (
SELECT
vlan_id
FROM
subnetvlan
WHERE
subnet_id=" . $subnet_id . "
$sql = "SELECT vlan_id, vlan_number, vlan_name
FROM vlan
WHERE vlan_id NOT IN (
SELECT vlan_id FROM subnetvlan WHERE subnet_id=?
)
ORDER BY
vlan_number";
ORDER BY vlan_number";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$vlans = $db->db_select($query);
$vlans = $sth->fetchAll();
foreach ($vlans as $vlan) {
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name'];
}

@ -14,36 +14,21 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
// subnet
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
// run query
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
// vlan
$query = "SELECT
v.vlan_id,
v.vlan_number,
v.vlan_name
FROM
subnetvlan AS s LEFT JOIN vlan AS v USING (vlan_id)
WHERE
s.subnet_id=" . $subnet_id . "
ORDER BY
v.vlan_number";
// run query
$vlans = $db->db_select($query);
$smarty->assign("vlans", $vlans);
$sql = "SELECT v.vlan_id, v.vlan_number, v.vlan_name
FROM subnetvlan AS s LEFT JOIN vlan AS v USING (vlan_id)
WHERE s.subnet_id=?
ORDER BY v.vlan_number";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("vlans", $sth->fetchAll());
$smarty->display("subnetvlandel.tpl");

@ -13,19 +13,12 @@ $subnet_id = sanitize($_GET['subnet_id']);
include("header.php");
$query = "SELECT
subnet_address,
subnet_mask
FROM
subnet
WHERE
subnet_id=" . $subnet_id;
$subnet = $db->db_select($query);
$smarty->assign("subnet_id", $subnet_id);
$smarty->assign("subnet_address", $subnet[0]['subnet_address']);
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
$sql = "SELECT subnet_id AS id, subnet_address AS address, subnet_mask AS mask
FROM subnet
WHERE subnet_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$subnet_id]);
$smarty->assign("subnet", $sth->fetch(PDO::FETCH_OBJ));
$smarty->display("subnetvlanedit.tpl");

@ -1,7 +1,7 @@
<table class="title">
<tr>
<td class="header">
{$lang_assets} ({$assets|@count})
{$lang_assets} ({$assets|@count} / {$assetcount})
</td>
<td align="right">
<a href="assetadd.php"><img src="image.php?icon=add" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_asset_add}" {/if}/></a>
@ -34,7 +34,7 @@
{foreach item=asset from=$assets}
<tr>
<td class="label">
<a href="assetview.php?asset.id={$asset.asset_id}">{$asset.asset_name}</a>
<a href="assetview.php?asset_id={$asset.asset_id}">{$asset.asset_name}</a>
</td>
<td class="value">
<a href="assetclassview.php?assetclass_id={$asset.assetclass_id}">{$asset.assetclass_name}</a>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="assetclass">
<input type="hidden" name="assetclass_id" value="{$assetclass_id}">
<input type="hidden" name="assetclass_id" value="{$assetclass->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_assetclass_name}
</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>
</tr>
</table>

@ -1,11 +1,11 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="assetclass">
<input type="hidden" name="assetclass_id" value="{$assetclass_id}">
<input type="hidden" name="assetclass_id" value="{$assetclass->id}">
<table class="title">
<tr>
<td class="header">
{$assetclass_name}
{$assetclass->name}
</td>
<td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
@ -28,7 +28,7 @@
{$lang_assetclass_name}
</td>
<td class="value">
<input type="text" name="assetclass_name" value="{$assetclass_name}">
<input type="text" name="assetclass_name" value="{$assetclass->name}">
</td>
</tr>
</table>

@ -14,17 +14,23 @@
<td class="header">
{$lang_assetclassgroup_name}
</td>
<td class="header">
{$lang_description}
</td>
</tr>
{foreach item=assetclassgroup from=$assetclassgroups}
{foreach item=acg from=$assetclassgroups}
<tr>
<td class="label">
<img src="image.php?color={$assetclassgroup.assetclassgroup_color}" alt="#{$assetclassgroup.assetclassgroup_color}">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup.assetclassgroup_id}">{$assetclassgroup.assetclassgroup_name}</a>
<img src="image.php?color={$acg.color}" alt="#{$acg.color}">
<a href="assetclassgroupview.php?assetclassgroup_id={$acg.id}">{$acg.name}</a>
</td>
<td>
{$acg.description}
</td>
</tr>
{foreachelse}
<tr>
<td>
<td colspan="2">
{$lang_assetclassgroup_none}
</td>
</tr>

@ -27,7 +27,15 @@
{$lang_assetclassgroup_name}
</td>
<td class="value">
<input type="text" name="assetclassgroup_name">
<input type="text" name="acg_name">
</td>
</tr>
<tr>
<td class="label">
{$lang_description}
</td>
<td class="value">
<input type="text" name="acg_description" size="80" maxlength="100">
</td>
</tr>
<tr>
@ -35,7 +43,7 @@
{$lang_color}
</td>
<td class="value">
<input type="text" name="assetclassgroup_color">
#<input type="text" {literal}class="color {pickerPosition:'right'}"{/literal} name="acg_color" size="6" maxlength="6" value="{$assetclassgroup->color}">
</td>
</tr>
</table>

@ -1,11 +1,11 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="assetclassgroup">
<input type="hidden" name="assetclassgroup_id" value="{$assetclassgroup_id}">
<input type="hidden" name="assetclassgroup_id" value="{$assetclassgroup->id}">
<table class="title">
<tr>
<td class="header">
{$assetclassgroup_name}
{$assetclassgroup->name}
</td>
<td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=cancel" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
@ -30,7 +30,7 @@
{$lang_assetclassgroup_name}
</td>
<td class="value">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a>
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup->id}">{$assetclassgroup->name}</a>
</td>
</tr>
</table>

@ -1,11 +1,11 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="assetclassgroup">
<input type="hidden" name="assetclassgroup_id" value="{$assetclassgroup_id}">
<input type="hidden" name="acg_id" value="{$assetclassgroup->id}">
<table class="title">
<tr>
<td class="header">
{$assetclassgroup_name}
{$assetclassgroup->name}
</td>
<td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
@ -28,7 +28,15 @@
{$lang_assetclassgroup_name}
</td>
<td class="value">
<input type="text" name="assetclassgroup_name" value="{$assetclassgroup_name}">
<input type="text" name="acg_name" value="{$assetclassgroup->name}">
</td>
</tr>
<tr>
<td class="label">
{$lang_description}
</td>
<td class="value">
<input type="text" name="acg_description" size="80" maxlength="100" value="{$assetclassgroup->description}">
</td>
</tr>
<tr>
@ -36,7 +44,7 @@
{$lang_color}
</td>
<td class="value">
#<input type="text" {literal}class="color {pickerPosition:'right'}"{/literal} name="assetclassgroup_color" size="6" maxlength="6" value="{$assetclassgroup_color}">
#<input type="text" {literal}class="color {pickerPosition:'right'}"{/literal} name="acg_color" size="6" maxlength="6" value="{$assetclassgroup->color}">
</td>
</tr>
</table>

@ -1,12 +1,12 @@
<table class="title">
<tr>
<td class="header">
{$assetclassgroup_name}
{$assetclassgroup->name}
</td>
<td align="right">
<a href="assetclassgroupadd.php?assetclassgroup_id={$assetclassgroup_id}"><img src="image.php?icon=add" alt="{$lang_assetclassgroup_add}" {if $suser_tooltips}title="{$lang_assetclassgroup_add}" {/if}/></a>
<a href="assetclassgroupedit.php?assetclassgroup_id={$assetclassgroup_id}"><img src="image.php?icon=edit" alt="{$lang_assetclassgroup_edit}" {if $suser_tooltips}title="{$lang_assetclassgroup_edit}" {/if}/></a>
<a href="assetclassgroupdel.php?assetclassgroup_id={$assetclassgroup_id}"><img src="image.php?icon=delete" alt="{$lang_assetclassgroup_del}" {if $suser_tooltips}title="{$lang_assetclassgroup_del}" {/if}/></a>
<a href="assetclassgroupadd.php?assetclassgroup_id={$assetclassgroup->id}"><img src="image.php?icon=add" alt="{$lang_assetclassgroup_add}" {if $suser_tooltips}title="{$lang_assetclassgroup_add}" {/if}/></a>
<a href="assetclassgroupedit.php?assetclassgroup_id={$assetclassgroup->id}"><img src="image.php?icon=edit" alt="{$lang_assetclassgroup_edit}" {if $suser_tooltips}title="{$lang_assetclassgroup_edit}" {/if}/></a>
<a href="assetclassgroupdel.php?assetclassgroup_id={$assetclassgroup->id}"><img src="image.php?icon=delete" alt="{$lang_assetclassgroup_del}" {if $suser_tooltips}title="{$lang_assetclassgroup_del}" {/if}/></a>
</td>
</tr>
</table>
@ -25,7 +25,15 @@
{$lang_assetclassgroup_name}
</td>
<td class="value">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a>
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup->id}">{$assetclassgroup->name}</a>
</td>
</tr>
<tr>
<td class="label">
{$lang_description}
</td>
<td class="value">
{$assetclassgroup->description}
</td>
</tr>
<tr>
@ -33,7 +41,8 @@
{$lang_color}
</td>
<td class="value">
<img src="image.php?color={$assetclassgroup_color}" alt="{$assetclassgroup_color}">
<img src="image.php?color={$assetclassgroup->color}" alt="{$assetclassgroup->color}">
#{$assetclassgroup->color}
</td>
</tr>
</table>

@ -4,9 +4,9 @@
{$assetclass_name}
</td>
<td align="right">
<a href="assetadd.php?assetclass_id={$assetclass_id}"><img src="image.php?icon=add" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_asset_add}" {/if}/></a>
<a href="assetclassedit.php?assetclass_id={$assetclass_id}"><img src="image.php?icon=edit" alt="{$lang_assetclass_edit}" {if $suser_tooltips}title="{$lang_asset_edit}" {/if}/></a>
<a href="assetclassdel.php?assetclass_id={$assetclass_id}"><img src="image.php?icon=delete" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_asset_delete}" {/if}/></a>
<a href="assetadd.php?assetclass_id={$assetclass->assetclass_id}"><img src="image.php?icon=add" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_asset_add}" {/if}/></a>
<a href="assetclassedit.php?assetclass_id={$assetclass->assetclass_id}"><img src="image.php?icon=edit" alt="{$lang_assetclass_edit}" {if $suser_tooltips}title="{$lang_asset_edit}" {/if}/></a>
<a href="assetclassdel.php?assetclass_id={$assetclass->assetclass_id}"><img src="image.php?icon=delete" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_asset_delete}" {/if}/></a>
</td>
</tr>
</table>
@ -25,7 +25,7 @@
{$lang_assetclass_name}
</td>
<td class="value">
<a href="assetclassview.php?assetclass_id={$assetclass_id}">{$assetclass_name}</a>
<a href="assetclassview.php?assetclass_id={$assetclass->assetclass_id}">{$assetclass->assetclass_name}</a>
</td>
</tr>
</table>
@ -44,8 +44,8 @@
{$lang_assetclassgroup_name}
</td>
<td class="value">
<img src="image.php?color={$assetclassgroup_color}" alt="#{$assetclassgroup_color}">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a><br>
<img src="image.php?color={$assetclass->assetclassgroup_color}" alt="#{$assetclass->assetclassgroup_color}">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclass->assetclassgroup_id}">{$assetclass->assetclassgroup_name}</a><br>
</td>
</tr>
</table>

@ -1,7 +1,7 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="asset">
<input type="hidden" name="asset_id" value="{$asset.asset_id}">
<input type="hidden" name="assetclass_id" value="{$asset.assetclass_id}">
<input type="hidden" name="asset_id" value="{$asset->asset_id}">
<input type="hidden" name="assetclass_id" value="{$asset->assetclass_id}">
<table class="title">
<tr>
@ -29,7 +29,7 @@
{$lang_asset_name}
</td>
<td class="value">
<input type="text" name="asset_name" value="{$asset.asset_name}">
<input type="text" name="asset_name" value="{$asset->asset_name}">
</td>
</tr>
<tr>
@ -37,7 +37,7 @@
{$lang_asset_hostname}
</td>
<td class="value">
<input type="text" name="asset_hostname" value="{$asset.asset_hostname}">
<input type="text" name="asset_hostname" value="{$asset->asset_hostname}">
</td>
</tr>
<tr>
@ -45,7 +45,7 @@
{$lang_asset_info}
</td>
<td class="value">
<textarea name="asset_info" cols="30" rows="10">{$asset.asset_info}</textarea>
<textarea name="asset_info" cols="30" rows="10">{$asset->asset_info}</textarea>
</td>
</tr>
</table>
@ -64,7 +64,7 @@
{$lang_assetclass_name}
</td>
<td class="value">
{html_options name=assetclass_id options=$assetclass_options selected=$asset.assetclass_id}
{html_options name=assetclass_id options=$assetclass_options selected=$asset->assetclass_id}
</td>
</tr>
</table>

@ -4,9 +4,9 @@
{$asset_name}
</td>
<td align="right">
<a href="assignnodetoasset.php?asset_id={$asset_id}"><img src="image.php?icon=add" alt="{$lang_assignnodetoasset}"></a>
<a href="assetedit.php?asset_id={$asset_id}"><img src="image.php?icon=edit" alt="{$lang_asset_edit}"></a>
<a href="assetdel.php?asset_id={$asset_id}"><img src="image.php?icon=delete" alt="{$lang_asset_edit}"></a>
<a href="assignnodetoasset.php?asset_id={$asset->asset_id}"><img src="image.php?icon=add" alt="{$lang_assignnodetoasset}"></a>
<a href="assetedit.php?asset_id={$asset->asset_id}"><img src="image.php?icon=edit" alt="{$lang_asset_edit}"></a>
<a href="assetdel.php?asset_id={$asset->asset_id}"><img src="image.php?icon=delete" alt="{$lang_asset_edit}"></a>
</td>
</tr>
</table>
@ -25,7 +25,7 @@
{$lang_asset_name}
</td>
<td class="value">
<a href="assetview.php?asset_id={$asset_id}">{$asset_name}</a>
<a href="assetview.php?asset_id={$asset->asset_id}">{$asset->asset_name}</a>
</td>
</tr>
<tr>
@ -33,7 +33,7 @@
{$lang_asset_hostname}
</td>
<td class="value">
{$asset_hostname}
{$asset->asset_hostname}
</td>
</tr>
<tr>
@ -41,7 +41,7 @@
{$lang_asset_info}
</td>
<td class="value">
{$asset_info}
{$asset->asset_info}
</td>
</tr>
</table>
@ -61,7 +61,7 @@
{$lang_assetclass_name}
</td>
<td class="value">
<a href="assetclassview.php?assetclass_id={$assetclass_id}">{$assetclass_name}</a>
<a href="assetclassview.php?assetclass_id={$asset->assetclass_id}">{$asset->assetclass_name}</a>
</td>
</tr>
</table>
@ -72,7 +72,7 @@
{$lang_nodes}
</td>
<td class="header_right">
<a href="assignnodetoasset.php?asset_id={$asset_id}"><img src="image.php?icon=edit" alt="{$lang_assignnodetoasset}"></a>
<a href="assignnodetoasset.php?asset_id={$asset->asset_id}"><img src="image.php?icon=edit" alt="{$lang_assignnodetoasset}"></a>
</td>
</tr>
<tr>

@ -1,7 +1,7 @@
<form method="POST" action="submit.php">
<input type="hidden" name="redirect" value="assigniptonode">
<input type="hidden" name="node_ip" value="{$node_ip}">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -37,7 +37,7 @@
{$lang_subnet}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}&page={$node_ip}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet_id}&page={$node_ip}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="location">
<input type="hidden" name="location_id" value="{$location_id}">
<input type="hidden" name="location_id" value="{$location->id}">
<table class="title">
<tr>
@ -31,7 +31,7 @@
{$lang_location_name}
</td>
<td class="value">
<a href="locationview.php?location_id={$location_id}">{$location_name}</a>
<a href="locationview.php?location_id={$location->id}">{$location->name}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="location">
<input type="hidden" name="location_id" value="{$location_id}">
<input type="hidden" name="location_id" value="{$location->id}">
<table class="title">
<tr>
@ -29,7 +29,7 @@
{$lang_location_name}
</td>
<td class="value">
<input type="text" name="location_name" value="{$location_name}">
<input type="text" name="location_name" value="{$location->name}">
</td>
</tr>
<tr>
@ -37,7 +37,7 @@
{$lang_location_info}
</td>
<td class="value">
<textarea name="location_info" cols="30" rows="10">{$location_info}</textarea>
<textarea name="location_info" cols="30" rows="10">{$location->info}</textarea>
</td>
</tr>
</table>
@ -56,7 +56,7 @@
{$lang_location_parent}
</td>
<td class="value">
{html_options name=parentlocation_id options=$location_options selected=$location_parent}
{html_options name=parentlocation_id options=$location_options selected=$location->parent}
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="add" value="locationsubnet">
<input type="hidden" name="location_id" value="{$location_id}">
<input type="hidden" name="location_id" value="{$location->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_location_name}
</td>
<td class="value">
<a href="locationview.php?location_id={$location_id}">{$location_name}</a>
<a href="locationview.php?location_id={$location->id}">{$location->name}</a>
</td>
</tr>
</table>

@ -5,9 +5,9 @@
{$location_name}
</td>
<td align="right">
<a href="locationadd.php?location_parent={$location_id}"><img src="images/building_add.png" alt="{$lang_sublocation_add}"></a>
<a href="locationedit.php?location_id={$location_id}"><img src="images/building_edit.png" alt="{$lang_location_edit}"></a>
<a href="locationdel.php?location_id={$location_id}"><img src="images/building_delete.png" alt="{$lang_location_del}"></a>
<a href="locationadd.php?location_parent={$location->id}"><img src="images/building_add.png" alt="{$lang_sublocation_add}"></a>
<a href="locationedit.php?location_id={$location->id}"><img src="images/building_edit.png" alt="{$lang_location_edit}"></a>
<a href="locationdel.php?location_id={$location->id}"><img src="images/building_delete.png" alt="{$lang_location_del}"></a>
</td>
</tr>
</table>
@ -28,7 +28,7 @@
<td class="value">
<ol id="breadcrumbs">
{foreach item=breadcrumb from=$crumbs name=breadcrumbs}
<li{if $smarty.foreach.breadcrumbs.first} class="first"{/if}><a href="{$breadcrumb.url}">{$breadcrumb.name}</a></li>
<li{if $smarty.foreach.breadcrumbs.first} class="first"{/if}><a href="{$breadcrumb->url}">{$breadcrumb->name}</a></li>
{/foreach}
</ol>
</td>
@ -38,7 +38,7 @@
{$lang_location_info}
</td>
<td class="value">
{$location_info}
{$location->info}
</td>
</tr>
</table>
@ -72,7 +72,7 @@
{$lang_subnet}
</td>
<td class="header_right">
<a href="locationsubnetedit.php?location_id={$location_id}"><img src="image.php?icon=edit" alt="{$lang_locationsubnet_edit}"></a>
<a href="locationsubnetedit.php?location_id={$location->id}"><img src="image.php?icon=edit" alt="{$lang_locationsubnet_edit}"></a>
</td>
</tr>
<tr>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="nat">
<input type="hidden" name="node_id_ext" value="{$node_id_ext}">
<input type="hidden" name="node_id_ext" value="{$node->id_ext}">
<table class="title">
<tr>
@ -10,7 +10,7 @@
<td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a>
{if $nat_options}
<input type="image" src="image.php?icon=save" alt="{$lang_submit}">
<input type="image" src="image.php?icon=delete" alt="{$lang_submit}">
{/if}
</td>
</tr>
@ -30,7 +30,7 @@
{$lang_ip}
</td>
<td class="value">
<a href="nodeview.php?node_id={$node_id_ext}">{$node_ip_ext}</a>
<a href="nodeview.php?node_id={$node->id_ext}">{$node->ip_ext}</a>
</td>
</tr>
</table>
@ -50,7 +50,7 @@
{$lang_node}
</td>
<td class="value">
{html_options name=nat_ext options=$nat_options}
{html_options name=nat_id options=$nat_options}
</td>
{else}
<td colspan="2">

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="redirect" value="nat">
<input type="hidden" name="node_id" value="{$node_id}">
<input type="hidden" name="node_id" value="{$node->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_ip}
</td>
<td class="value">
<a href="nodeview.php?node_id={$node_id}">{$node_ip}</a>
<a href="nodeview.php?node_id={$node->id}">{$node->ip}</a>
</td>
</tr>
</table>

@ -2,14 +2,13 @@
<tr>
<td class="header">
<img class="icon" src="images/network-ethernet.png" alt="" />
{$lang_nodes} ({$nodes|@count})
{$lang_nodes} {if $subnet_id}in {$subnet}{/if} ({$nodes|@count})
</td>
<td align="right">
<a href="nodeadd.php?subnet_id={$subnet_id}"><img src="image.php?icon=add" alt="{$lang_node_add}"></a>
</td>
</tr>
</table>
<table class="info">
<tr>
<td class="header">

@ -1,13 +1,13 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="node">
<input type="hidden" name="node_id" value="{$node_id}">
<input type="hidden" name="asset_id" value="{$asset_id}">
<input type="hidden" name="node_id" value="{$node->id}">
<input type="hidden" name="asset_id" value="{$node->asset_id}">
<table class="title">
<tr>
<td class="header">
<img class="icon" src="images/network-ethernet.png" alt="" />
{$node_ip}
{$node->ip}
</td>
<td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=cancel" alt="{$lang_cancel}"></a>
@ -30,7 +30,7 @@
{$lang_ip}
</td>
<td class="value">
<a href="nodeview.php?node_id={$node_id}">{$node_ip}</a>
<a href="nodeview.php?node_id={$node->id}">{$node->ip}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="node">
<input type="hidden" name="node_id" value="{$node_id}">
<input type="hidden" name="node_id" value="{$node->id}">
<table class="title">
<tr>
@ -29,7 +29,7 @@
{$lang_ip}
</td>
<td label="value">
<input type="text" name="node_ip" value="{$node_ip}">
<input type="text" name="node_ip" value="{$node->ip}">
</td>
</tr>
<tr>
@ -37,7 +37,7 @@
{$lang_mac}
</td>
<td label="value">
<input type="text" name="node_mac" value="{$node_mac}">
<input type="text" name="node_mac" value="{$node->mac}">
</td>
</tr>
<tr>
@ -45,7 +45,7 @@
{$lang_dns1}
</td>
<td label="value">
<input type="text" name="node_dns1" value="{$node_dns1}">
<input type="text" name="node_dns1" value="{$node->dns1}">
</td>
</tr>
<tr>
@ -53,7 +53,7 @@
{$lang_dns2}
</td>
<td label="value">
<input type="text" name="node_dns2" value="{$node_dns2}">
<input type="text" name="node_dns2" value="{$node->dns2}">
</td>
</tr>
<tr>
@ -61,7 +61,7 @@
{$lang_node_info}
</td>
<td label="value">
<textarea name="node_info">{$node_info}</textarea>
<textarea name="node_info">{$node->info}</textarea>
</td>
</tr>
</table>
@ -80,7 +80,7 @@
{$lang_asset_name}
</td>
<td label="value">
{html_options name=asset_id options=$asset_options selected=$asset_id}
{html_options name=asset_id options=$asset_options selected=$node->asset_id}
</td>
</tr>
</table>
@ -99,7 +99,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
{html_options name=subnet_id options=$subnet_options selected=$subnet_id}
{html_options name=subnet_id options=$subnet_options selected=$node->subnet_id}
</td>
</tr>
</table>
@ -118,7 +118,7 @@
Origin
</td>
<td class="value">
{html_options name=zone_id options=$zone_options selected=$zone_id}
{html_options name=zone_id options=$zone_options selected=$node->zone_id}
</td>
</tr>
</table>

@ -2,11 +2,11 @@
<tr>
<td class="header">
<img class="icon" src="images/network-ethernet.png" alt="" />
{$node_ip}
{$node->ip}
</td>
<td align="right">
<a href="nodeedit.php?node_id={$node.node_id}"><img src="image.php?icon=edit" alt="{$lang_node_edit}"></a>
<a href="nodedel.php?node_id={$node.node_id}"><img src="image.php?icon=delete" alt="{$lang_node_del}"></a>
<a href="nodeedit.php?node_id={$node->id}"><img src="image.php?icon=edit" alt="{$lang_node_edit}"></a>
<a href="nodedel.php?node_id={$node->id}"><img src="image.php?icon=delete" alt="{$lang_node_del}"></a>
</td>
</tr>
</table>
@ -25,7 +25,7 @@
{$lang_ip}
</td>
<td class="value">
<a href="nodeview.php?node_id={$node.node_id}">{$node.node_ip}</a>
<a href="nodeview.php?node_id={$node->id}">{$node->ip}</a>
</td>
</tr>
<tr>
@ -33,7 +33,7 @@
{$lang_proto_vers}
</td>
<td class="value">
{$node.node_type}
{$node->type}
</td>
</tr>
<tr>
@ -41,7 +41,7 @@
{$lang_mac}
</td>
<td class="value">
{$node.node_mac}
{$node->mac}
</td>
</tr>
<tr>
@ -49,7 +49,7 @@
{$lang_dns1}
</td>
<td class="value">
{$node.node_dns1}
{$node->dns1}
</td>
</tr>
<tr>
@ -57,7 +57,7 @@
{$lang_dns2}
</td>
<td class="value">
{$node.node_dns2}
{$node->dns2}
</td>
</tr>
<tr>
@ -65,7 +65,7 @@
{$lang_node_info}
</td>
<td class="value">
{$node.node_info}
{$node->info}
</td>
</tr>
<tr>
@ -73,7 +73,7 @@
{$lang_zone}
</td>
<td class="value">
{$node.zone_origin}
{$node->zone_origin}
</td>
</tr>
</table>
@ -92,7 +92,7 @@
{$lang_asset_name}
</td>
<td class="value">
<a href="assetview.php?asset_id={$node.asset_id}">{$node.asset_name}</a>
<a href="assetview.php?asset_id={$node->asset_id}">{$node->asset_name}</a>
</td>
</tr>
</table>
@ -111,7 +111,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$node.subnet_id}&page={$node.node_ip}">{$node.subnet_address}/{$node.subnet_mask}</a>
<a href="subnetview.php?subnet_id={$node->subnet_id}&page={$node->ip}">{$node->subnet_address}/{$node->subnet_mask}</a>
</td>
</tr>
</table>
@ -122,7 +122,7 @@
{$lang_nat}
</td>
<td class="header_right">
<a href="natedit.php?node_id={$node.node_id}"><img src="image.php?icon=edit" alt="{$lang_nat_edit}"></a>
<a href="natedit.php?node_id={$node->id}"><img src="image.php?icon=edit" alt="{$lang_nat_edit}"></a>
</td>
</tr>
<tr>
@ -131,7 +131,7 @@
</td>
<td class="value">
{foreach item=rule from=$natrules}
{if $rule.node_id_int eq $node.node_id}
{if $rule.node_id_int eq $node->id}
<img src="images/arrow_left.png" alt="incoming" title="coming from">
<a href="nodeview.php?node_id={$rule.node_id_ext}">{$rule.node_ip_ext}</a>/<a href="assetview.php?asset_id={$rule.asset_id_ext}">{$rule.asset_name_ext}</a> ({$rule.nat_type})<br />
{else}

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="subnet">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -25,7 +25,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>
@ -43,7 +43,7 @@
{$lang_ip}
</td>
<td class="value">
<a href="nodeview.php?node_id={$node.node_id}">{$node.node_ip}</a>
<a href="nodeview.php?node_id={$node.id}">{$node.ip}</a>
</td>
</tr>
{/foreach}

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="subnet">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_subnet_subnetaddress}
</td>
<td class="value">
<input type="text" name="subnet_address" value="{$subnet_address}">
<input type="text" name="subnet_address" value="{$subnet->address}">
</td>
</tr>
<tr>
@ -36,7 +36,7 @@
{$lang_subnet_mask}
</td>
<td class="value">
<input type="text" name="subnet_mask" size="2" value="{$subnet_mask}">
<input type="text" name="subnet_mask" size="2" value="{$subnet->mask}">
</td>
</tr>
<tr>
@ -44,7 +44,7 @@
{$lang_proto_vers}
</td>
<td class="value">
<input type="text" name="subnet_proto_vers" size="2" value="{$subnet_proto_vers}">
<input type="text" name="subnet_proto_vers" size="2" value="{$subnet->proto_vers}">
</td>
</tr>
<tr>
@ -52,7 +52,7 @@
{$lang_subnet_dhcpstart}
</td>
<td class="value">
<input type="text" name="subnet_dhcpstart" size="15" value="{$subnet_dhcpstart}">
<input type="text" name="subnet_dhcpstart" size="15" value="{$subnet->dhcp_start}">
</td>
</tr>
<tr>
@ -60,7 +60,7 @@
{$lang_subnet_dhcpend}
</td>
<td class="value">
<input type="text" name="subnet_dhcpend" size="15" value="{$subnet_dhcpend}">
<input type="text" name="subnet_dhcpend" size="15" value="{$subnet->dhcp_end}">
</td>
</tr>
<tr>
@ -68,7 +68,7 @@
NTP Server
</td>
<td class="value">
<input type="text" name="subnet_ntp_server" size="45" value="{$subnet_ntp_server}">
<input type="text" name="subnet_ntp_server" size="45" value="{$subnet->ntp_server}">
</td>
</tr>
<tr>
@ -76,7 +76,7 @@
{$lang_subnet_info}
</td>
<td class="value">
<textarea name="subnet_info" cols="30" rows="10">{$subnet_info}</textarea>
<textarea name="subnet_info" cols="30" rows="10">{$subnet->info}</textarea>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="add" value="subnetlocation">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -30,7 +30,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="subnetlocation">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="redirect" value="subnetlocation">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -1,11 +1,11 @@
<table class="title">
<tr>
<td class="header">
{$subnet_address}/{$subnet_mask}
{$subnet->address}/{$subnet->mask}
</td>
<td align="right">
<a href="subnetedit.php?subnet_id={$subnet_id}"><img src="image.php?icon=edit" alt="{$lang_subnet_edit}"></a>
<a href="subnetdel.php?subnet_id={$subnet_id}"><img src="image.php?icon=delete" alt="{$lang_subnet_del}"></a>
<a href="subnetedit.php?subnet_id={$subnet->id}"><img src="image.php?icon=edit" alt="{$lang_subnet_edit}"></a>
<a href="subnetdel.php?subnet_id={$subnet->id}"><img src="image.php?icon=delete" alt="{$lang_subnet_del}"></a>
</td>
</tr>
</table>
@ -17,25 +17,25 @@
</td>
<td class="header" align="right">
{if $noselect eq TRUE}
{$subnet_address}
{$subnet->address}
{/if}
</td>
</tr>
<tr>
<td class="label" colspan="2">
{if $subnet_proto_vers eq 4}
{foreach name=iptable item=adr from=$subnet}
{if $subnet->proto_vers eq 4}
{foreach name=iptable item=adr from=$subnetdata}
<a href="{$adr.url}" onMouseOver="changetext('remotetext','{$adr.remotetext}')" onMouseOut="changetext('remotetext','&nbsp;')"><img src="image.php?color={$adr.assetclassgroup_color}" alt="{$adr.remotetext}"></a>
{if $smarty.foreach.iptable.iteration % $imagewrap eq 0}
<br />
{/if}
{/foreach}
{else}
Für IPv6 steht keine Graphik zur Verfügung.
F&uuml;r IPv6 steht keine Graphik zur Verf&uuml;gung.
{/if}
</td>
</tr>
{if $subnet_proto_vers eq 4}
{if $subnet->proto_vers eq 4}
<tr>
<td colspan="2">
<a id="remotetext">&nbsp;</a>
@ -47,10 +47,10 @@
{$lang_subnet_subnetaddress}
</td>
<td class="value">
{if $subnet_proto_vers eq 4}
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}</a>
{if $subnet->proto_vers eq 4}
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}</a>
{else}
{$subnet_address}&nbsp;/&nbsp;{$subnet_mask}
{$subnet->address}&nbsp;/&nbsp;{$subnet->mask}
{/if}
</td>
</tr>
@ -59,10 +59,10 @@
{$lang_proto_vers}
</td>
<td class="value">
{$subnet_proto_vers}
{$subnet->proto_vers}
</td>
</tr>
{if $subnet_proto_vers eq 4}
{if $subnet->proto_vers eq 4}
<tr>
<td class="label">
{$lang_subnet_mask}
@ -72,13 +72,13 @@
</td>
</tr>
{/if}
{if $subnet_dhcpstart}
{if $subnet->dhcp_start}
<tr>
<td class="label">
{$lang_subnet_dhcp}
</td>
<td class="value">
{$subnet_dhcpstart} - {$subnet_dhcpend}
{$subnet->dhcp_start} - {$subnet->dhcp_end}
</td>
</tr>
{/if}
@ -87,20 +87,20 @@
{$lang_subnet_nodesinsubnet}
</td>
<td class="value">
{if $subnet_proto_vers eq 4}
<a href="node.php?subnet_id={$subnet_id}">{$node_counter}</a>&nbsp;/&nbsp;{$host_counter}&nbsp;({$subnet_usedpercentage}&#37;)
{if $subnet->proto_vers eq 4}
<a href="node.php?subnet_id={$subnet->id}">{$node_counter}</a>&nbsp;/&nbsp;{$host_counter}&nbsp;({$subnet_usedpercentage}&#37;)
{else}
<a href="node.php?subnet_id={$subnet_id}">{$node_counter}</a>
<a href="node.php?subnet_id={$subnet->id}">{$node_counter}</a>
{/if}
</td>
</tr>
{if $subnet_ntp_server}
{if $subnet->ntp_server}
<tr>
<td class="label">
NTP Server
</td>
<td class="value">
{$subnet_ntp_server}
{$subnet->ntp_server}
</td>
</tr>
{/if}
@ -109,7 +109,7 @@
{$lang_subnet_info}
</td>
<td class="value">
{$subnet_info}
{$subnet->info}
</td>
</tr>
</table>
@ -123,7 +123,7 @@
&nbsp;
</td>
</tr>
{if $subnet_proto_vers eq 4}
{if $subnet->proto_vers eq 4}
<tr>
<td class="label">
<img src="image.php?color={$config_color_unused}" alt="{$lang_unassigned}">&nbsp;{$lang_unassigned}
@ -151,7 +151,7 @@
{$lang_vlans}
</td>
<td class="header_right">
<a href="subnetvlanedit.php?subnet_id={$subnet_id}"><img src="image.php?icon=edit" alt="{$lang_subnetvlan_edit}"></a>
<a href="subnetvlanedit.php?subnet_id={$subnet->id}"><img src="image.php?icon=edit" alt="{$lang_subnetvlan_edit}"></a>
</td>
</tr>
<tr>
@ -160,7 +160,7 @@
</td>
<td class="value">
{foreach item=vlan from=$vlans}
<a href="vlanview.php?vlan_id={$vlan.vlan_id}">{$vlan.vlan_name} ({$vlan.vlan_number})</a><br>
<a href="vlanview.php?vlan_id={$vlan.id}">{$vlan.name} ({$vlan.number})</a><br>
{/foreach}
</td>
</tr>
@ -172,7 +172,7 @@
{$lang_locations}
</td>
<td class="header" align="right">
<a href="subnetlocationedit.php?subnet_id={$subnet_id}"><img src="image.php?icon=edit" alt="{$lang_location_edit}"></a>
<a href="subnetlocationedit.php?subnet_id={$subnet->id}"><img src="image.php?icon=edit" alt="{$lang_location_edit}"></a>
</td>
</tr>
<tr>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="add" value="subnetvlan">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="redirect" value="subnetvlan">
<input type="hidden" name="subnet_id" value="{$subnet_id}">
<input type="hidden" name="subnet_id" value="{$subnet->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td>
<td class="value">
<a href="subnetview.php?subnet_id={$subnet_id}">{$subnet_address}/{$subnet_mask}</a>
<a href="subnetview.php?subnet_id={$subnet->id}">{$subnet->address}/{$subnet->mask}</a>
</td>
</tr>
</table>

@ -25,13 +25,13 @@
{foreach item=user from=$users}
<tr>
<td class="label">
<a href="userview.php?user_id={$user.user_id}">{$user.user_name}</a>
<a href="userview.php?user_id={$user.id}">{$user.name}</a>
</td>
<td class="value">
{$user.user_realm}
{$user.realm}
</td>
<td class="value">
{$user.user_displayname}
{$user.displayname}
</td>
</tr>
{/foreach}

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="user">
<input type="hidden" name="user_id" value="{$user_id}">
<input type="hidden" name="user_id" value="{$user->id}">
<table class="title">
<tr>
@ -29,7 +29,7 @@
{$lang_user_name}
</td>
<td class="value">
<a href="userview.php?user_id={$user_id}">{$user_name}</a>
<a href="userview.php?user_id={$user->id}">{$user->name}</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="edit" value="user">
<input type="hidden" name="user_id" value="{$user_id}">
<input type="hidden" name="user_id" value="{$user->id}">
<table class="title">
<tr>
@ -29,7 +29,7 @@
{$lang_user_name}
</td>
<td class="value">
<input type="text" name="user_name" value="{$user_name}">
<input type="text" name="user_name" value="{$user->name}">
</td>
</tr>
<tr>
@ -37,7 +37,7 @@
{$lang_user_displayname}
</td>
<td class="value">
<input type="text" name="user_displayname" value="{$user_displayname}">
<input type="text" name="user_displayname" value="{$user->displayname}">
</td>
</tr>
<tr>

@ -5,8 +5,8 @@
{$user_name}
</td>
<td align="right">
<a href="useredit.php?user_id={$user_id}"><img src="images/user_edit.png" alt="{$lang_user_edit}"></a>
<a href="userdel.php?user_id={$user_id}"><img src="images/user_delete.png" alt="{$lang_user_del}"></a>
<a href="useredit.php?user_id={$user->id}"><img src="images/user_edit.png" alt="{$lang_user_edit}"></a>
<a href="userdel.php?user_id={$user->id}"><img src="images/user_delete.png" alt="{$lang_user_del}"></a>
</td>
</tr>
</table>
@ -19,13 +19,21 @@
<td class="header_right">
&nbsp;
</td>
<tr>
<td class="label">
{$lang_user_realm}
</td>
<td class="value">
{$user_realm}
</td>
</tr>
</tr>
<tr>
<td class="label">
{$lang_user_name}
</td>
<td class="value">
<a href="userview.php?user_id={$user_id}">{$user_name}</a>
<a href="userview.php?user_id={$user->id}">{$user->name}</a>
</td>
</tr>
<tr>
@ -33,7 +41,7 @@
{$lang_user_displayname}
</td>
<td class="value">
{$user_displayname}
{$user->displayname}
</td>
</tr>
<tr>

@ -24,13 +24,13 @@
{foreach item=vlan from=$vlans}
<tr>
<td class="label">
{$vlan.vlan_number}
{$vlan.number}
</td>
<td class="value">
<a href="vlanview.php?vlan_id={$vlan.vlan_id}">{$vlan.vlan_name}</a>
<a href="vlanview.php?vlan_id={$vlan.id}">{$vlan.name}</a>
</td>
<td>
{$vlan.vlan_info}
{$vlan.info}
</td>
</tr>
{foreachelse}

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="del" value="vlan">
<input type="hidden" name="vlan_id" value="{$vlan_id}">
<input type="hidden" name="vlan_id" value="{$vlan->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_vlan_name}
</td>
<td class="value">
<a href="vlanview.php?vlan_id={$vlan_id}">{$vlan_name}&nbsp;({$vlan_number})</a>
<a href="vlanview.php?vlan_id={$vlan->id}">{$vlan->name}&nbsp;({$vlan->number})</a>
</td>
</tr>
</table>

@ -28,7 +28,7 @@
{$lang_vlan_name}
</td>
<td class="value">
<input type="text" name="vlan_name" value="{$vlan_name}">
<input type="text" name="vlan_name" value="{$vlan->name}">
</td>
</tr>
<tr>
@ -36,7 +36,7 @@
{$lang_vlan_number}
</td>
<td class="value">
<input type="text" name="vlan_number" size="3" value="{$vlan_number}">
<input type="text" name="vlan_number" size="3" value="{$vlan->number}">
</td>
</tr>
<tr>
@ -44,7 +44,7 @@
{$lang_vlan_info}
</td>
<td class="value">
<textarea name="vlan_info" cols="30" rows="10">{$vlan_info}</textarea>
<textarea name="vlan_info" cols="30" rows="10">{$vlan->info}</textarea>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="add" value="vlansubnet">
<input type="hidden" name="vlan_id" value="{$vlan_id}">
<input type="hidden" name="vlan_id" value="{$vlan->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_vlan_name} ({$lang_vlan_number})
</td>
<td class="value">
<a href="vlanview.php?vlan_id={$vlan_id}">{$vlan_name} ({$vlan_number})</a>
<a href="vlanview.php?vlan_id={$vlan->id}">{$vlan->name} ({$vlan->number})</a>
</td>
</tr>
</table>

@ -1,6 +1,6 @@
<form method="POST" action="submit.php">
<input type="hidden" name="redirect" value="vlansubnet">
<input type="hidden" name="vlan_id" value="{$vlan_id}">
<input type="hidden" name="vlan_id" value="{$vlan->id}">
<table class="title">
<tr>
@ -28,7 +28,7 @@
{$lang_vlan_name} ({$lang_vlan_number})
</td>
<td class="value">
<a href="vlanview.php?vlan_id={$vlan_id}">{$vlan_name} ({$vlan_number})</a>
<a href="vlanview.php?vlan_id={$vlan->id}">{$vlan->name} ({$vlan->number})</a>
</td>
</tr>
</table>

@ -4,9 +4,9 @@
{$vlan_name}
</td>
<td align="right">
<a href="assignvlantosubnet.php?vlan_id={$vlan_id}"><img src="image.php?icon=add" alt="{$lang_assignvlantosubnet}"></a>
<a href="vlanedit.php?vlan_id={$vlan_id}"><img src="image.php?icon=edit" alt="{$lang_vlan_edit}"></a>
<a href="vlandel.php?vlan_id={$vlan_id}"><img src="image.php?icon=delete" alt="{$lang_vlan_del}"></a>
<a href="assignvlantosubnet.php?vlan_id={$vlan->id}"><img src="image.php?icon=add" alt="{$lang_assignvlantosubnet}"></a>
<a href="vlanedit.php?vlan_id={$vlan->id}"><img src="image.php?icon=edit" alt="{$lang_vlan_edit}"></a>
<a href="vlandel.php?vlan_id={$vlan->id}"><img src="image.php?icon=delete" alt="{$lang_vlan_del}"></a>
</td>
</tr>
</table>
@ -25,7 +25,7 @@
{$lang_vlan_name}
</td>
<td class="value">
<a href="vlanview.php?vlan_id={$vlan_id}">{$vlan_name}</a>
<a href="vlanview.php?vlan_id={$vlan->id}">{$vlan->name}</a>
</td>
</tr>
<tr>
@ -33,7 +33,7 @@
{$lang_vlan_number}
</td>
<td class="value">
{$vlan_number}
{$vlan->number}
</td>
</tr>
<tr>
@ -41,7 +41,7 @@
{$lang_vlan_info}
</td>
<td class="value">
{$vlan_info}
{$vlan->info}
</td>
</tr>
</table>
@ -52,7 +52,7 @@
{$lang_subnet}
</td>
<td class="header" align="right">
<a href="vlansubnetedit.php?vlan_id={$vlan_id}"><img src="image.php?icon=edit" alt="{$lang_subnetvlan_edit}"></a>
<a href="vlansubnetedit.php?vlan_id={$vlan->id}"><img src="image.php?icon=edit" alt="{$lang_subnetvlan_edit}"></a>
</td>
</tr>
<tr>

@ -25,13 +25,13 @@
{foreach item=zone from=$zones}
<tr>
<td class="label">
<a href="zoneview.php?zone_id={$zone.zone_id}">{$zone.zone_origin}</a>
<a href="zoneview.php?zone_id={$zone.id}">{$zone.origin}</a>
</td>
<td class="value">
{$zone.zone_hostmaster}
{$zone.hostmaster}
</td>
<td class="value">
{$zone.zone_serial}
{$zone.serial}
</td>
</tr>
{foreachelse}

Some files were not shown because too many files have changed in this diff Show More