SQL Statements simplified and some bugfixing

master
Thomas Hooge 2 years ago
parent ed33c0553d
commit 6df7a3f6a8
  1. 20
      asset.php
  2. 6
      assetadd.php
  3. 18
      assetclass.php
  4. 6
      assetclassdel.php
  5. 8
      assetclassedit.php
  6. 8
      assetclassgroup.php
  7. 6
      assetclassgroupdel.php
  8. 15
      assetclassview.php
  9. 14
      assetedit.php
  10. 20
      assetview.php
  11. 8
      assigniptonode.php
  12. BIN
      images/arrow_left.png
  13. BIN
      images/arrow_right.png
  14. 22
      install/mysql_sample.sql
  15. 3
      lang/de.php
  16. 1
      lang/en.php
  17. 4
      locationdel.php
  18. 8
      locationedit.php
  19. 4
      locationsubnetadd.php
  20. 4
      locationsubnetedit.php
  21. 14
      locationview.php
  22. 64
      logout.php
  23. 20
      natadd.php
  24. 35
      natdel.php
  25. 6
      nodedel.php
  26. 32
      nodeedit.php
  27. 12
      nodeview.php
  28. 282
      submit.php
  29. 6
      subnet.php
  30. 10
      subnetadd.php
  31. 16
      subnetdel.php
  32. 38
      subnetview.php
  33. 8
      tpl/about.tpl
  34. 1
      tpl/assetclass.tpl
  35. 147
      tpl/assetclassview.tpl
  36. 110
      tpl/header.tpl
  37. 114
      tpl/natdel.tpl
  38. 282
      tpl/nodeview.tpl

@ -55,20 +55,18 @@
// build query // build query
$query = "SELECT $query = "SELECT
asset.asset_id AS asset_id, a.asset_id,
IF(LENGTH(asset.asset_name)>0, asset.asset_name, '...') AS asset_name, IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name,
asset.asset_info AS asset_info, a.asset_info,
assetclass.assetclass_id AS assetclass_id, c.assetclass_id,
assetclass.assetclass_name AS assetclass_name c.assetclass_name
FROM FROM
asset, asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
assetclass
WHERE WHERE
SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "' SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "'
AND assetclass.assetclass_id=asset.assetclass_id
ORDER BY ORDER BY
asset.asset_name"; a.asset_name";
// run query // run query
$assets = $db->db_select($query); $assets = $db->db_select($query);

@ -36,12 +36,12 @@
// setup assetclass // setup assetclass
// build query // build query
$query = "SELECT $query = "SELECT
assetclass.assetclass_id AS assetclass_id, assetclass_id,
assetclass.assetclass_name AS assetclass_name assetclass_name
FROM FROM
assetclass assetclass
ORDER BY ORDER BY
assetclass.assetclass_name"; assetclass_name";
// run query // run query
$assetclasses = $db->db_select($query); $assetclasses = $db->db_select($query);

@ -33,18 +33,16 @@
// setup assetclass // setup assetclass
// build query // build query
$query = "SELECT $query = "SELECT
assetclass.assetclass_id AS assetclass_id, a.assetclass_id,
assetclass.assetclass_name AS assetclass_name, a.assetclass_name,
assetclassgroup.assetclassgroup_id AS assetclassgroup_id, g.assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name g.assetclassgroup_name,
g.assetclassgroup_color
FROM FROM
assetclass, assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
assetclassgroup
WHERE
assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id
ORDER BY ORDER BY
assetclass.assetclass_name"; a.assetclass_name";
// run query // run query
$assetclasses = $db->db_select($query); $assetclasses = $db->db_select($query);

@ -36,12 +36,12 @@
// setup assetclass // setup assetclass
// build query // build query
$query = "SELECT $query = "SELECT
assetclass.assetclass_id AS assetclass_id, assetclass_id,
assetclass.assetclass_name AS assetclass_name assetclass_name
FROM FROM
assetclass assetclass
WHERE WHERE
assetclass.assetclass_id=" . $assetclass_id; assetclass_id=" . $assetclass_id;
// run query // run query
$assetclass = $db->db_select($query); $assetclass = $db->db_select($query);

@ -36,13 +36,13 @@
// setup assetclass // setup assetclass
// build query // build query
$query = "SELECT $query = "SELECT
assetclass.assetclass_id AS assetclass_id, assetclass_id,
assetclass.assetclass_name AS assetclass_name, assetclass_name,
assetclass.assetclassgroup_id AS assetclassgroup_id assetclassgroup_id
FROM FROM
assetclass assetclass
WHERE WHERE
assetclass.assetclass_id=" . $assetclass_id; assetclass_id=" . $assetclass_id;
// run query // run query
$assetclass = $db->db_select($query); $assetclass = $db->db_select($query);

@ -33,13 +33,13 @@
// setup assetclassgroup // setup assetclassgroup
// build query // build query
$query = "SELECT $query = "SELECT
assetclassgroup.assetclassgroup_id AS assetclassgroup_id, assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name, assetclassgroup_name,
assetclassgroup.assetclassgroup_color AS assetclassgroup_color assetclassgroup_color
FROM FROM
assetclassgroup assetclassgroup
ORDER BY ORDER BY
assetclassgroup.assetclassgroup_name"; assetclassgroup_name";
// run query // run query
$assetclassgroups = $db->db_select($query); $assetclassgroups = $db->db_select($query);

@ -36,12 +36,12 @@
// setup assetclassgroup // setup assetclassgroup
// build query // build query
$query = "SELECT $query = "SELECT
assetclassgroup.assetclassgroup_id AS assetclassgroup_id, assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name assetclassgroup_name
FROM FROM
assetclassgroup assetclassgroup
WHERE WHERE
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id; assetclassgroup_id=" . $assetclassgroup_id;
// run query // run query
$assetclassgroup = $db->db_select($query); $assetclassgroup = $db->db_select($query);

@ -35,17 +35,13 @@
// setup assetclass // setup assetclass
// build query // build query
$query = "SELECT $query = "SELECT
assetclass.assetclass_id, a.assetclass_id, a.assetclass_name,
assetclass.assetclass_name, g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
FROM FROM
assetclass, assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
assetclassgroup
WHERE WHERE
assetclass.assetclass_id=" . $assetclass_id . " a.assetclass_id=" . $assetclass_id;
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
// run query // run query
$assetclass = $db->db_select($query); $assetclass = $db->db_select($query);
@ -57,6 +53,7 @@
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']); $smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']); $smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
$smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']);
// send to tpl // send to tpl
// setup asset // setup asset

@ -36,16 +36,16 @@
// setup asset // setup asset
// build query // build query
$query = "SELECT $query = "SELECT
asset_id, asset_id,
asset.asset_name AS asset_name, asset_name,
asset.asset_hostname AS asset_hostname, asset_hostname,
asset.asset_info AS asset_info, asset_info,
asset.assetclass_id AS assetclass_id assetclass_id
FROM FROM
asset asset
WHERE WHERE
asset.asset_id=" . $asset_id; asset_id=" . $asset_id;
// run query // run query
$asset = $db->db_select($query); $asset = $db->db_select($query);
$smarty->assign("asset", $asset[0]); $smarty->assign("asset", $asset[0]);

@ -36,17 +36,15 @@
// setup asset // setup asset
// build query // build query
$query = "SELECT $query = "SELECT
asset.asset_name, a.asset_name,
asset.asset_hostname, a.asset_hostname,
asset.asset_info, a.asset_info,
assetclass.assetclass_id AS assetclass_id, c.assetclass_id,
assetclass.assetclass_name AS assetclass_name c.assetclass_name
FROM FROM
asset, asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
assetclass
WHERE WHERE
asset.asset_id=" . $asset_id . " a.asset_id=" . $asset_id;
AND assetclass.assetclass_id=asset.assetclass_id";
// run query // run query
$asset = $db->db_select($query); $asset = $db->db_select($query);
@ -69,9 +67,9 @@
FROM FROM
node node
WHERE WHERE
node.asset_id=" . $asset_id . " asset_id=" . $asset_id . "
ORDER BY ORDER BY
INET_ATON(node.node_ip)"; INET_ATON(node_ip)";
// run query // run query
$nodes = $db->db_select($query); $nodes = $db->db_select($query);

@ -36,13 +36,13 @@
// build query // build query
$query = "SELECT $query = "SELECT
subnet.subnet_address AS subnet_address, subnet_address,
subnet.subnet_mask AS subnet_mask subnet_mask
FROM FROM
subnet subnet
WHERE WHERE
subnet.subnet_id=" . $subnet_id; subnet_id=" . $subnet_id;
// run query // run query
$subnet = $db->db_select($query); $subnet = $db->db_select($query);

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

@ -1,19 +1,23 @@
INSERT INTO asset (asset_name, assetclass_id) VALUES INSERT INTO asset (asset_name, assetclass_id) VALUES
('Computer', 1), ('Computer', 1),
('Server', 2), ('Server', 3),
('Printer', 3); ('Printer', 4),
('Firewall', 6);
INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
(1, 'Desktop'), (1, 'Desktop'),
(1, 'Notebook'), (1, 'Notebook'),
(2, 'Server'), (2, 'Server'),
(3, 'Printers'), (3, 'Printer'),
(4, 'Scanners'); (4, 'Switch'),
(4, 'Firewall'),
(5, 'Scanner');
INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
('Personal Computer', '000000'), ('Personal Computer', '000000'),
('Servers', '0000CC'), ('Servers', '0000CC'),
('Periphery', '00CC00'), ('Periphery', '00CC00'),
('Network', 'CCCC00'),
('Miscellaneous', 'CC0000'); ('Miscellaneous', 'CC0000');
INSERT INTO location (location_name, location_parent) VALUES INSERT INTO location (location_name, location_parent) VALUES
@ -22,9 +26,13 @@ INSERT INTO location (location_name, location_parent) VALUES
('Branch Office B', 1); ('Branch Office B', 1);
INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
('192.168.1.2', '001122334455', 1, 1), ('192.168.0.10', '001122334455', 1, 1),
('192.168.1.1', 'aabbccddeeff', 1, 2), ('192.168.0.11', 'aabbccddeeff', 1, 2),
('192.168.0.1', '667755441122', 2, 3); ('192.168.0.12', '775544881199', 1, 3),
('192.168.0.1', '667755441122', 1, 4),
('192.168.1.1', '667755441123', 2, 4),
('192.168.10.1', '667755441124', 3, 4),
('192.168.20.1', '667755441125', 4, 4);
INSERT INTO subnet (subnet_address, subnet_mask) VALUES INSERT INTO subnet (subnet_address, subnet_mask) VALUES
('192.168.0.0', 24), ('192.168.0.0', 24),

@ -197,7 +197,8 @@ $lang = array(
'lang_options_tooltips_help' => 'Tooltips anzeigen', 'lang_options_tooltips_help' => 'Tooltips anzeigen',
'lang_options_language_help' => 'Sprache für diesen Benutzer', 'lang_options_language_help' => 'Sprache für diesen Benutzer',
'lang_about_sfprojectpage' => 'Sourceforge Project Page', 'lang_about_projectpage' => 'Aktuelle Projektseite',
'lang_about_sfprojectpage' => 'Sourceforge Projektseite',
'lang_about_license' => 'Lizenz', 'lang_about_license' => 'Lizenz',
'lang_about_gpl' => 'GNU General Public License (GPL)', 'lang_about_gpl' => 'GNU General Public License (GPL)',
'lang_about_smarty' => 'Smarty Template Engine', 'lang_about_smarty' => 'Smarty Template Engine',

@ -197,6 +197,7 @@ $lang = array(
'lang_options_tooltips_help' => 'Show tooltips', 'lang_options_tooltips_help' => 'Show tooltips',
'lang_options_language_help' => 'Language for this user', 'lang_options_language_help' => 'Language for this user',
'lang_about_projectpage' => 'Current Project Page',
'lang_about_sfprojectpage' => 'Sourceforge Project Page', 'lang_about_sfprojectpage' => 'Sourceforge Project Page',
'lang_about_license' => 'License', 'lang_about_license' => 'License',
'lang_about_gpl' => 'GNU General Public License (GPL)', 'lang_about_gpl' => 'GNU General Public License (GPL)',

@ -36,11 +36,11 @@
// setup location // setup location
// build query // build query
$query = "SELECT $query = "SELECT
location.location_name AS location_name location_name
FROM FROM
location location
WHERE WHERE
location.location_id=" . $location_id; location_id=" . $location_id;
// run query // run query
$location = $db->db_select($query); $location = $db->db_select($query);

@ -61,11 +61,13 @@
// look for locations // look for locations
// build query // build query
$query = "SELECT $query = "SELECT
location.location_id AS location_id, location_id,
location.location_name AS location_name, location_name,
location.location_parent AS location_parent location_parent
FROM FROM
location location
WHERE
location_id != " . $location_id . "
ORDER BY ORDER BY
location.location_name"; location.location_name";

@ -36,11 +36,11 @@
// setup location // setup location
// build query // build query
$query = "SELECT $query = "SELECT
location.location_name AS location_name location_name
FROM FROM
location location
WHERE WHERE
location.location_id=" . $location_id; location_id=" . $location_id;
// run query // run query
$location = $db->db_select($query); $location = $db->db_select($query);

@ -36,11 +36,11 @@
// setup location // setup location
// build query // build query
$query = "SELECT $query = "SELECT
location.location_name AS location_name location_name
FROM FROM
location location
WHERE WHERE
location.location_id=" . $location_id; location_id=" . $location_id;
// run query // run query
$location = $db->db_select($query); $location = $db->db_select($query);

@ -85,18 +85,16 @@
// setup subnets // setup subnets
// build query // build query
$query = "SELECT $query = "SELECT
subnet.subnet_id AS subnet_id, s.subnet_id,
subnet.subnet_address AS subnet_address, s.subnet_address,
subnet.subnet_mask AS subnet_mask s.subnet_mask
FROM FROM
subnet, subnet AS s LEFT JOIN subnetlocation USING (subnet_id)
subnetlocation
WHERE WHERE
subnetlocation.location_id=" . $location_id . " subnetlocation.location_id=" . $location_id . "
AND subnetlocation.subnet_id=subnet.subnet_id
ORDER BY ORDER BY
INET_ATON(subnet.subnet_address)"; INET_ATON(s.subnet_address)";
// run query // run query
$subnets = $db->db_select($query); $subnets = $db->db_select($query);
$smarty->assign("subnets", $subnets); $smarty->assign("subnets", $subnets);

@ -1,33 +1,33 @@
<?php <?php
/***************************************************************************** /*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2007-2009 Wietse Warendorff Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
For more information, visit http://sourceforge.net/projects/ipreg, For more information, visit http://sourceforge.net/projects/ipreg,
or contact me at wietsew@users.sourceforge.net or contact me at wietsew@users.sourceforge.net
*****************************************************************************/ *****************************************************************************/
// start page // start page
// includes // includes
include("includes.php"); include("includes.php");
// logout // logout
// user logout // user logout
$user->user_logout(); $user->user_logout();
// redirect // redirect
header("Location: index.php"); header("Location: index.php");
?> ?>

@ -36,11 +36,11 @@
// setup node_ext // setup node_ext
// build query // build query
$query = "SELECT $query = "SELECT
node.node_ip AS node_ip_ext node_ip AS node_ip_ext
FROM FROM
node node
WHERE WHERE
node.node_id=" . $node_id; node_id=" . $node_id;
// run query // run query
$node = $db->db_select($query); $node = $db->db_select($query);
@ -51,14 +51,13 @@
// setup node_int // setup node_int
// build query // build query
$query = "SELECT $query = "SELECT
asset.asset_name AS asset_name, a.asset_name,
node.node_id AS node_id_int, n.node_id AS node_id_int,
node.node_ip AS node_ip_int n.node_ip AS node_ip_int
FROM FROM
asset, asset AS a LEFT JOIN node AS n USING (asset_id)
node
WHERE WHERE
node.node_id NOT IN ( n.node_id NOT IN (
SELECT SELECT
nat_int nat_int
FROM FROM
@ -66,10 +65,9 @@
WHERE WHERE
nat_ext=" . $node_id . " nat_ext=" . $node_id . "
) )
AND node.node_id!=" . $node_id . " AND n.node_id!=" . $node_id . "
AND asset.asset_id=node.asset_id
ORDER BY ORDER BY
INET_ATON(node.node_ip)"; INET_ATON(n.node_ip)";
// run query // run query
$nodes = $db->db_select($query); $nodes = $db->db_select($query);

@ -36,11 +36,11 @@
// setup node_ext // setup node_ext
// build query // build query
$query = "SELECT $query = "SELECT
node.node_ip AS node_ip_ext node_ip AS node_ip_ext
FROM FROM
node node
WHERE WHERE
node.node_id=" . $node_id; node_id=" . $node_id;
// run query // run query
$node = $db->db_select($query); $node = $db->db_select($query);
@ -48,28 +48,31 @@
$smarty->assign("node_id_ext", $node_id); $smarty->assign("node_id_ext", $node_id);
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']); $smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
// setup node // setup options
// build query // build query
$query = "SELECT $query = "SELECT
asset.asset_name AS asset_name, a.asset_name,
node.node_id AS node_id_int, n.node_ip,
node.node_ip AS node_ip_int x.nat_ext
FROM FROM
asset, asset AS a,
nat, nat AS x,
node node AS n
WHERE WHERE
nat.nat_ext=" . $node_id . " x.nat_ext=" . $node_id . "
AND node.node_id=nat.nat_int AND n.node_id=x.nat_int
AND asset.asset_id=node.asset_id AND a.asset_id=n.asset_id
ORDER BY ORDER BY
INET_ATON(node.node_ip)"; INET_ATON(n.node_ip)";
// run query // run query
$nodes = $db->db_select($query); $nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
// *** <option value="{node_id_int}">{node_ip_int}/{asset_name}</option> $options = array();
foreach ($nodes as $rec) {
$options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name'];
}
$smarty->assign("nat_options", $options);
// end page // end page
// output // output

@ -36,12 +36,12 @@
// setup node // setup node
// build query // build query
$query = "SELECT $query = "SELECT
node.asset_id AS asset_id, asset_id,
node.node_ip AS node_ip node_ip
FROM FROM
node node
WHERE WHERE
node.node_id=" . $node_id; node_id=" . $node_id;
// run query // run query
$node = $db->db_select($query); $node = $db->db_select($query);

@ -36,24 +36,24 @@
// setup node // setup node
// build query // build query
$query = "SELECT $query = "SELECT
asset.asset_id AS asset_id, a.asset_id,
node.node_id AS node_id, n.node_id,
node.node_ip AS node_ip, n.node_ip,
node.node_mac AS node_mac, n.node_mac,
node.node_dns1 AS node_dns1, n.node_dns1,
node.node_dns2 AS node_dns2, n.node_dns2,
node.node_info AS node_info, n.node_info,
subnet.subnet_id AS subnet_id, s.subnet_id,
node.zone_id AS zone_id n.zone_id
FROM FROM
asset, asset AS a,
node, node AS n,
subnet subnet AS s
WHERE WHERE
asset.asset_id=node.asset_id a.asset_id=n.asset_id
AND node.node_id=" . $node_id . " AND n.node_id=" . $node_id . "
AND subnet.subnet_id=node.subnet_id"; AND s.subnet_id=n.subnet_id";
// run query // run query
$node = $db->db_select($query); $node = $db->db_select($query);

@ -74,13 +74,15 @@
nat.nat_ext AS nat_ext, nat.nat_ext AS nat_ext,
nat.nat_int AS nat_int, nat.nat_int AS nat_int,
node_ext.node_ip AS node_ip_ext, node_ext.node_ip AS node_ip_ext,
node_int.node_ip AS node_ip_int node_int.node_ip AS node_ip_int,
node_int.node_id AS node_id_int,
node_ext.node_id AS node_id_ext
FROM FROM
asset asset_ext, asset AS asset_ext,
asset asset_int, asset AS asset_int,
nat, nat,
node node_ext, node AS node_ext,
node node_int node AS node_int
WHERE WHERE
(nat.nat_ext=" . $node_id . " (nat.nat_ext=" . $node_id . "
OR nat.nat_int=" . $node_id . ") OR nat.nat_int=" . $node_id . ")

@ -135,10 +135,10 @@
$query = "INSERT $query = "INSERT
INTO INTO
asset( asset(
asset.asset_name, asset_name,
asset.asset_hostname, asset_hostname,
asset.assetclass_id, assetclass_id,
asset.asset_info asset_info
) )
VALUE VALUE
( (
@ -163,8 +163,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
assetclass( assetclass(
assetclass.assetclass_name, assetclass_name,
assetclass.assetclassgroup_id assetclassgroup_id
) )
VALUE VALUE
( (
@ -187,8 +187,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
assetclassgroup( assetclassgroup(
assetclassgroup.assetclassgroup_name, assetclassgroup_name,
assetclassgroup.assetclassgroup_color assetclassgroup_color
) )
VALUE VALUE
( (
@ -216,13 +216,13 @@
$query = "INSERT $query = "INSERT
INTO INTO
node( node(
node.node_ip, node_ip,
node.node_mac, node_mac,
node.node_dns1, node_dns1,
node.node_dns2, node_dns2,
node.subnet_id, subnet_id,
node.asset_id, asset_id,
node.node_info node_info
) )
VALUE VALUE
( (
@ -250,8 +250,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnetlocation( subnetlocation(
subnetlocation.location_id, location_id,
subnetlocation.subnet_id subnet_id
) )
VALUE VALUE
( (
@ -274,9 +274,9 @@
$query = "UPDATE $query = "UPDATE
subnet subnet
SET SET
subnet.vlan_id='$vlan_id' vlan_id='$vlan_id'
WHERE WHERE
subnet.subnet_id='$subnet_id'"; subnet_id='$subnet_id'";
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -294,9 +294,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
location( location(
location.location_name, location_name,
location.location_parent, location_parent,
location.location_info location_info
) )
VALUE VALUE
( (
@ -320,8 +320,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnetlocation( subnetlocation(
subnetlocation.location_id, location_id,
subnetlocation.subnet_id subnet_id
) )
VALUE VALUE
( (
@ -345,9 +345,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
nat( nat(
nat.nat_ext, nat_ext,
nat.nat_int, nat_int,
nat.nat_type nat_type
) )
VALUE VALUE
( (
@ -378,9 +378,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
asset( asset(
asset.asset_name, asset_name,
asset.asset_hostname, asset_hostname,
asset.assetclass_id assetclass_id
) )
VALUE VALUE
( (
@ -396,13 +396,13 @@
$query = "INSERT $query = "INSERT
INTO INTO
node( node(
node.node_ip, node_ip,
node.node_mac, node_mac,
node.node_dns1, node_dns1,
node.node_dns2, node_dns2,
node.node_info, node_info,
node.subnet_id, subnet_id,
node.asset_id asset_id
) )
VALUE VALUE
( (
@ -431,9 +431,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnet( subnet(
subnet.subnet_address, subnet_address,
subnet.subnet_mask, subnet_mask,
subnet.subnet_info subnet_info
) )
VALUE VALUE
( (
@ -457,8 +457,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnetlocation( subnetlocation(
subnetlocation.location_id, location_id,
subnetlocation.subnet_id subnet_id
) )
VALUE VALUE
( (
@ -481,8 +481,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnetvlan( subnetvlan(
subnetvlan.subnet_id, subnet_id,
subnetvlan.vlan_id vlan_id
) )
VALUE VALUE
( (
@ -504,11 +504,11 @@
// build query // build query
$query = "SELECT $query = "SELECT
user.user_name user_name
FROM FROM
user user
WHERE WHERE
user.user_name='$user_name'"; user_name='$user_name'";
// run query // run query
$users = $db->db_select($query); $users = $db->db_select($query);
@ -522,9 +522,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
user( user(
user.user_name, user_name,
user.user_displayname, user_displayname,
user.user_pass user_pass
) )
VALUE VALUE
( (
@ -553,9 +553,9 @@
$query = "INSERT $query = "INSERT
INTO INTO
vlan( vlan(
vlan.vlan_name, vlan_name,
vlan.vlan_number, vlan_number,
vlan.vlan_info vlan_info
) )
VALUE VALUE
( (
@ -579,8 +579,8 @@
$query = "INSERT $query = "INSERT
INTO INTO
subnetvlan( subnetvlan(
subnetvlan.subnet_id, subnet_id,
subnetvlan.vlan_id vlan_id
) )
VALUE VALUE
( (
@ -616,21 +616,21 @@
$query = "INSERT $query = "INSERT
INTO INTO
zone( zone(
zone.zone_origin, zone_origin,
zone.zone_ttl_default, zone_ttl_default,
zone.zone_soa, zone_soa,
zone.zone_hostmaster, zone_hostmaster,
zone.zone_refresh, zone_refresh,
zone.zone_retry, zone_retry,
zone.zone_expire, zone_expire,
zone.zone_ttl, zone_ttl,
zone.zone_serial, zone_serial,
zone.zone_ns1, zone_ns1,
zone.zone_ns2, zone_ns2,
zone.zone_ns3, zone_ns3,
zone.zone_mx1, zone_mx1,
zone.zone_mx2, zone_mx2,
zone.zone_info zone_info
) )
VALUE VALUE
( (
@ -672,7 +672,7 @@
FROM FROM
asset asset
WHERE WHERE
asset.asset_id=" . $asset_id; asset_id=" . $asset_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -682,7 +682,7 @@
FROM FROM
node node
WHERE WHERE
node.asset_id=" . $asset_id; asset_id=" . $asset_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -699,7 +699,7 @@
FROM FROM
assetclass assetclass
WHERE WHERE
assetclass.assetclass_id=" . $assetclass_id; assetclass_id=" . $assetclass_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -716,7 +716,7 @@
FROM FROM
assetclassgroup assetclassgroup
WHERE WHERE
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id; assetclassgroup_id=" . $assetclassgroup_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -733,7 +733,7 @@
FROM FROM
location location
WHERE WHERE
location.location_id=" . $location_id; location_id=" . $location_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -751,8 +751,8 @@
FROM FROM
subnetlocation subnetlocation
WHERE WHERE
subnetlocation.location_id=" . $location_id . " location_id=" . $location_id . "
AND subnetlocation.subnet_id=" . $subnet_id; AND subnet_id=" . $subnet_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -770,8 +770,8 @@
FROM FROM
nat nat
WHERE WHERE
nat.nat_ext=" . $node_id_ext . " nat_ext=" . $node_id_ext . "
AND nat.nat_int=" . $node_id_int; AND nat_int=" . $node_id_int;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -789,7 +789,7 @@
FROM FROM
node node
WHERE WHERE
node.node_id=" . $node_id; node_id=" . $node_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -807,7 +807,7 @@
FROM FROM
subnet subnet
WHERE WHERE
subnet.subnet_id=" . $subnet_id; subnet_id=" . $subnet_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -836,8 +836,8 @@
FROM FROM
subnetlocation subnetlocation
WHERE WHERE
subnetlocation.location_id=" . $location_id . " location_id=" . $location_id . "
AND subnetlocation.subnet_id=" . $subnet_id; AND subnet_id=" . $subnet_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -855,8 +855,8 @@
FROM FROM
subnetvlan subnetvlan
WHERE WHERE
subnetvlan.subnet_id=" . $subnet_id . " subnet_id=" . $subnet_id . "
AND subnetvlan.vlan_id=" . $vlan_id; AND vlan_id=" . $vlan_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -873,7 +873,7 @@
FROM FROM
user user
WHERE WHERE
user.user_id=" . $user_id; user_id=" . $user_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -890,7 +890,7 @@
FROM FROM
vlan vlan
WHERE WHERE
vlan.vlan_id=" . $vlan_id; vlan_id=" . $vlan_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -908,8 +908,8 @@
FROM FROM
subnetvlan subnetvlan
WHERE WHERE
subnetvlan.subnet_id=" . $subnet_id . " subnet_id=" . $subnet_id . "
AND subnetvlan.vlan_id=" . $vlan_id; AND vlan_id=" . $vlan_id;
// run query // run query
$db->db_delete($query); $db->db_delete($query);
@ -951,12 +951,12 @@
$query = "UPDATE $query = "UPDATE
asset asset
SET SET
asset.asset_name='$asset_name', asset_name='$asset_name',
asset.asset_info='$asset_info', asset_info='$asset_info',
asset.asset_hostname='$asset_hostname', asset_hostname='$asset_hostname',
asset.assetclass_id='$assetclass_id' assetclass_id='$assetclass_id'
WHERE WHERE
asset.asset_id=" . $asset_id; asset_id=" . $asset_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -973,10 +973,10 @@
$query = "UPDATE $query = "UPDATE
assetclass assetclass
SET SET
assetclass.assetclass_name='$assetclass_name', assetclass_name='$assetclass_name',
assetclass.assetclassgroup_id='$assetclassgroup_id' assetclassgroup_id='$assetclassgroup_id'
WHERE WHERE
assetclass.assetclass_id=" . $assetclass_id; assetclass_id=" . $assetclass_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -994,10 +994,10 @@
$query = "UPDATE $query = "UPDATE
assetclassgroup assetclassgroup
SET SET
assetclassgroup.assetclassgroup_name='$assetclassgroup_name', assetclassgroup_name='$assetclassgroup_name',
assetclassgroup.assetclassgroup_color='$assetclassgroup_color' assetclassgroup_color='$assetclassgroup_color'
WHERE WHERE
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id; assetclassgroup_id=" . $assetclassgroup_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -1016,11 +1016,11 @@
$query = "UPDATE $query = "UPDATE
location location
SET SET
location.location_name='$location_name', location_name='$location_name',
location.location_parent='$parentlocation_id', location_parent='$parentlocation_id',
location.location_info='$location_info' location_info='$location_info'
WHERE WHERE
location.location_id=" . $location_id; location_id=" . $location_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -1044,16 +1044,16 @@
$query = "UPDATE $query = "UPDATE
node node
SET SET
node.asset_id='$asset_id', asset_id='$asset_id',
node.node_ip='$node_ip', node_ip='$node_ip',
node.subnet_id='$subnet_id', subnet_id='$subnet_id',
node.node_mac='$node_mac', node_mac='$node_mac',
node.node_dns1='$node_dns1', node_dns1='$node_dns1',
node.node_dns2='$node_dns2', node_dns2='$node_dns2',
node.node_info='$node_info', node_info='$node_info',
node.zone_id='$zone_id' zone_id='$zone_id'
WHERE WHERE
node.node_id=" . $node_id; node_id=" . $node_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -1086,25 +1086,25 @@
$query = "UPDATE $query = "UPDATE
user user
SET SET
user.user_language='" . $user_language . "', user_language='" . $user_language . "',
user.user_imagesize='" . $user_imagesize . "', user_imagesize='" . $user_imagesize . "',
user.user_imagecount='" . $user_imagecount . "', user_imagecount='" . $user_imagecount . "',
user.user_mac='" . $user_mac . "', user_mac='" . $user_mac . "',
user.user_dateformat='" . $user_dateformat . "', user_dateformat='" . $user_dateformat . "',
user.user_dns1suffix='" . $user_dns1suffix . "', user_dns1suffix='" . $user_dns1suffix . "',
user.user_dns2suffix='" . $user_dns2suffix . "', user_dns2suffix='" . $user_dns2suffix . "',
user.user_menu_assets='" . $user_menu_assets . "', user_menu_assets='" . $user_menu_assets . "',
user.user_menu_assetclasses='" . $user_menu_assetclasses . "', user_menu_assetclasses='" . $user_menu_assetclasses . "',
user.user_menu_assetclassgroups='" . $user_menu_assetclassgroups . "', user_menu_assetclassgroups='" . $user_menu_assetclassgroups . "',
user.user_menu_locations='" . $user_menu_locations . "', user_menu_locations='" . $user_menu_locations . "',
user.user_menu_nodes='" . $user_menu_nodes . "', user_menu_nodes='" . $user_menu_nodes . "',
user.user_menu_subnets='" . $user_menu_subnets . "', user_menu_subnets='" . $user_menu_subnets . "',
user.user_menu_users='" . $user_menu_users . "', user_menu_users='" . $user_menu_users . "',
user.user_menu_vlans='" . $user_menu_vlans . "', user_menu_vlans='" . $user_menu_vlans . "',
user.user_menu_zones='" . $user_menu_zones . "', user_menu_zones='" . $user_menu_zones . "',
user.user_tooltips='" . $user_tooltips . "' user_tooltips='" . $user_tooltips . "'
WHERE WHERE
user.user_id=" . $user_id; user_id=" . $user_id;
// update session // update session
$_SESSION['suser_language'] = $user_language; $_SESSION['suser_language'] = $user_language;
@ -1140,11 +1140,11 @@
// get current pass from db // get current pass from db
$query = "SELECT $query = "SELECT
user.user_pass user_pass
FROM FROM
user user
WHERE WHERE
user.user_id='" . $user_id . "'"; user_id='" . $user_id . "'";
// run query // run query
$user = $db->db_select($query); $user = $db->db_select($query);
@ -1156,9 +1156,9 @@
$query = "UPDATE $query = "UPDATE
user user
SET SET
user.user_pass='" . md5($user_newpass1) . "' user_pass='" . md5($user_newpass1) . "'
WHERE WHERE
user.user_id=" . $user_id; user_id=" . $user_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -1209,10 +1209,10 @@
$query = "UPDATE $query = "UPDATE
user user
SET SET
user.user_name='" . $user_name . "', user_name='" . $user_name . "',
user.user_displayname='" . $user_displayname . "' user_displayname='" . $user_displayname . "'
WHERE WHERE
user.user_id=" . $user_id; user_id=" . $user_id;
// run query // run query
$db->db_update($query); $db->db_update($query);
@ -1231,11 +1231,11 @@
$query = "UPDATE $query = "UPDATE
vlan vlan
SET SET
vlan.vlan_name='$vlan_name', vlan_name='$vlan_name',
vlan.vlan_number='$vlan_number', vlan_number='$vlan_number',
vlan.vlan_info='$vlan_info' vlan_info='$vlan_info'
WHERE WHERE
vlan.vlan_id=" . $vlan_id; vlan_id=" . $vlan_id;
// run query // run query
$db->db_update($query); $db->db_update($query);

@ -41,11 +41,7 @@
CHAR_LENGTH(s.subnet_info) AS subnet_length, CHAR_LENGTH(s.subnet_info) AS subnet_length,
COUNT(node.subnet_id) AS node_counter COUNT(node.subnet_id) AS node_counter
FROM FROM
subnet AS s subnet AS s LEFT JOIN node USING (subnet_id)
LEFT JOIN
node
ON
node.subnet_id=s.subnet_id
GROUP BY GROUP BY
s.subnet_id s.subnet_id
ORDER BY ORDER BY

@ -36,14 +36,14 @@
// setup vlan // setup vlan
// build query // build query
$query = "SELECT $query = "SELECT
vlan.vlan_id AS vlan_id, vlan_id,
vlan.vlan_number AS vlan_number, vlan_number,
vlan.vlan_name AS vlan_name vlan_name
FROM FROM
vlan vlan
ORDER BY ORDER BY
vlan.vlan_name"; vlan_name";
// run query // run query
$vlans = $db->db_select($query); $vlans = $db->db_select($query);
$vlan_options[0] = $lang['lang_option_none']; $vlan_options[0] = $lang['lang_option_none'];

@ -36,12 +36,12 @@
// setup subnet // setup subnet
// build query // build query
$query = "SELECT $query = "SELECT
subnet.subnet_address AS subnet_address, subnet_address,
subnet.subnet_mask AS subnet_mask subnet_mask
FROM FROM
subnet subnet
WHERE WHERE
subnet.subnet_id=" . $subnet_id; subnet_id=" . $subnet_id;
// run query // run query
$subnet = $db->db_select($query); $subnet = $db->db_select($query);
@ -54,15 +54,15 @@
// setup node // setup node
// build query // build query
$query = "SELECT $query = "SELECT
node.node_id AS node_id, node_id,
node.node_ip AS node_ip node_ip
FROM FROM
node node
WHERE WHERE
node.subnet_id=" . $subnet_id . " subnet_id=" . $subnet_id . "
ORDER BY ORDER BY
INET_ATON(node.node_ip)"; INET_ATON(node_ip)";
// run query // run query
$nodes = $db->db_select($query); $nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes); $smarty->assign("nodes", $nodes);

@ -42,24 +42,20 @@
// setup subnet // setup subnet
// build query // build query
$query = "SELECT $query = "SELECT
subnet.subnet_address, s.subnet_address,
subnet.subnet_mask, s.subnet_mask,
subnet.subnet_dhcp_start, s.subnet_dhcp_start,
subnet.subnet_dhcp_end, s.subnet_dhcp_end,
subnet.subnet_info, s.subnet_info,
subnet.protocol_version, s.protocol_version,
subnet.ntp_server, s.ntp_server,
COUNT(node.subnet_id) AS node_counter COUNT(node.subnet_id) AS node_counter
FROM FROM
subnet subnet AS s LEFT JOIN node USING (subnet_id)
LEFT JOIN
node
ON
node.subnet_id=subnet.subnet_id
WHERE WHERE
subnet.subnet_id=" . $subnet_id . " s.subnet_id=" . $subnet_id . "
GROUP BY GROUP BY
subnet.subnet_id"; s.subnet_id";
// run query // run query
$subnet = $db->db_select($query); $subnet = $db->db_select($query);
@ -394,18 +390,14 @@
// setup location // setup location
// build query // build query
$query = "SELECT $query = "SELECT
location.location_id, l.location_id,
location.location_name l.location_name
FROM FROM
location location AS l LEFT JOIN subnetlocation AS s USING (location_id)
LEFT JOIN
subnetlocation
ON
subnetlocation.location_id=location.location_id
WHERE WHERE
subnetlocation.subnet_id=". $subnet_id . " s.subnet_id=". $subnet_id . "
ORDER BY ORDER BY
location.location_name"; l.location_name";
// run query // run query
$locations = $db->db_select($query); $locations = $db->db_select($query);

@ -15,6 +15,14 @@
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr>
<td class="label">
{$lang_about_projectpage}
</td>
<td class="value">
<a href="https://git.piratenpartei-sh.de/thooge/ipreg">https://git.piratenpartei-sh.de/thooge/ipreg</a>
</td>
</tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_about_sfprojectpage} {$lang_about_sfprojectpage}

@ -24,6 +24,7 @@
<a href="assetclassview.php?assetclass_id={$assetclass.assetclass_id}">{$assetclass.assetclass_name}</a> <a href="assetclassview.php?assetclass_id={$assetclass.assetclass_id}">{$assetclass.assetclass_name}</a>
</td> </td>
<td class="value"> <td class="value">
<img src="image.php?color={$assetclass.assetclassgroup_color}" alt="#{$assetclass.assetclassgroup_color}">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclass.assetclassgroup_id}">{$assetclass.assetclassgroup_name}</a> <a href="assetclassgroupview.php?assetclassgroup_id={$assetclass.assetclassgroup_id}">{$assetclass.assetclassgroup_name}</a>
</td> </td>
</tr> </tr>

@ -1,73 +1,74 @@
<table class="title"> <table class="title">
<tr> <tr>
<td class="header"> <td class="header">
{$assetclass_name} {$assetclass_name}
</td> </td>
<td align="right"> <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="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="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="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>
</td> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_assetclass} {$lang_assetclass}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_assetclass_name} {$lang_assetclass_name}
</td> </td>
<td class="value"> <td class="value">
<a href="assetclassview.php?assetclass_id={$assetclass_id}">{$assetclass_name}</a> <a href="assetclassview.php?assetclass_id={$assetclass_id}">{$assetclass_name}</a>
</td> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_assetclassgroup} {$lang_assetclassgroup}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_assetclassgroup_name} {$lang_assetclassgroup_name}
</td> </td>
<td class="value"> <td class="value">
<a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a><br> <img src="image.php?color={$assetclassgroup_color}" alt="#{$assetclassgroup_color}">
</td> <a href="assetclassgroupview.php?assetclassgroup_id={$assetclassgroup_id}">{$assetclassgroup_name}</a><br>
</tr> </td>
</table> </tr>
</table>
<table class="info">
<tr> <table class="info">
<td class="header"> <tr>
{$lang_assets} <td class="header">
</td> {$lang_assets}
<td class="header_right"> </td>
&nbsp; <td class="header_right">
</td> &nbsp;
</tr> </td>
<tr> </tr>
<td class="label"> <tr>
{$lang_assets} ({$assets|@count}) <td class="label">
</td> {$lang_assets} ({$assets|@count})
<td class="value"> </td>
{foreach item=asset from=$assets} <td class="value">
<a href="assetview.php?asset_id={$asset.asset_id}">{$asset.asset_name}</a> {foreach item=asset from=$assets}
{$asset.asset_info} <a href="assetview.php?asset_id={$asset.asset_id}">{$asset.asset_name}</a>
<br> {$asset.asset_info}
{/foreach} <br>
</td> {/foreach}
</tr> </td>
</table> </tr>
</table>

@ -1,55 +1,55 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>{$lang_ipreg}</title> <title>{$lang_ipreg}</title>
<meta name="author" content="Thomas Hooge" /> <meta name="author" content="Thomas Hooge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="images/shield.ico"> <link rel="shortcut icon" href="images/shield.ico">
<link rel="stylesheet" href="tpl/style.css" type="text/css"> <link rel="stylesheet" href="tpl/style.css" type="text/css">
{foreach item=style from=$styles} {foreach item=style from=$styles}
<link rel="stylesheet" href="css/{$style[0]}" type="text/css" media="{$style[1]}" /> <link rel="stylesheet" href="css/{$style[0]}" type="text/css" media="{$style[1]}" />
{/foreach} {/foreach}
{foreach item=script from=$scripts} {foreach item=script from=$scripts}
<script type="text/javascript" src="lib/{$script}"></script> <script type="text/javascript" src="lib/{$script}"></script>
{/foreach} {/foreach}
</head> </head>
<body> <body>
<form action="search.php" method="post"> <form action="search.php" method="post">
<table class="menu"> <table class="menu">
<tr> <tr>
<td valign="top" rowspan="2"> <td valign="top" rowspan="2">
<a href="index.php"><img src="image.php?icon=logo" alt="{$lang_ipreg}" style="margin-right:1em" /></a> <a href="index.php"><img src="image.php?icon=logo" alt="{$lang_ipreg}" style="margin-right:1em" /></a>
</td> </td>
<td valign="top" rowspan="2"> <td valign="top" rowspan="2">
{if $menu_assets}<a href="asset.php">{$lang_assets}</a> | {/if} {if $menu_assets}<a href="asset.php">{$lang_assets}</a> | {/if}
{if $menu_assetclasses}<a href="assetclass.php">{$lang_assetclasses}</a> | {/if} {if $menu_assetclasses}<a href="assetclass.php">{$lang_assetclasses}</a> | {/if}
{if $menu_assetclassgroups}<a href="assetclassgroup.php">{$lang_assetclassgroups}</a> | {/if} {if $menu_assetclassgroups}<a href="assetclassgroup.php">{$lang_assetclassgroups}</a> | {/if}
{if $menu_locations}<a href="location.php">{$lang_locations}</a> | {/if} {if $menu_locations}<a href="location.php">{$lang_locations}</a> | {/if}
{if $menu_nodes}<a href="node.php">{$lang_nodes}</a> | {/if} {if $menu_nodes}<a href="node.php">{$lang_nodes}</a> | {/if}
{if $menu_subnets}<a href="subnet.php">{$lang_subnets}</a> | {/if} {if $menu_subnets}<a href="subnet.php">{$lang_subnets}</a> | {/if}
{if $menu_vlans}<a href="vlan.php">{$lang_vlans}</a> | {/if} {if $menu_vlans}<a href="vlan.php">{$lang_vlans}</a> | {/if}
{if $menu_zones}<a href="zone.php">{$lang_zones}</a> {/if} {if $menu_zones}<a href="zone.php">{$lang_zones}</a> {/if}
</td> </td>
<td align="right" width="38%"> <td align="right" width="38%">
{$suser_name}&nbsp;|&nbsp; {$suser_name}&nbsp;|&nbsp;
<a href="about.php">{$lang_about}</a> | <a href="about.php">{$lang_about}</a> |
<a href="options.php">{$lang_options}</a> | <a href="options.php">{$lang_options}</a> |
<a href="logout.php">{$lang_logout}</a> <a href="logout.php">{$lang_logout}</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="right"> <td align="right">
<input type="text" name="search" value="{$search}">&nbsp;<input type="image" class="icon" src="image.php?icon=search" alt="{$lang_search}"> <input type="text" name="search" value="{$search}">&nbsp;<input type="image" class="icon" src="image.php?icon=search" alt="{$lang_search}">
</td> </td>
</tr> </tr>
</table> </table>
</form> </form>
<table class="header"> <table class="header">
<tr> <tr>
<td> <td>
&nbsp;{$lang_ipreg} &nbsp;{$lang_ipreg}
</td> </td>
</tr> </tr>
</table> </table>

@ -1,53 +1,61 @@
<form method="POST" action="submit.php"> <form method="POST" action="submit.php">
<input type="hidden" name="del" value="nat"> <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"> <table class="title">
<tr> <tr>
<td class="header"> <td class="header">
{lang_nat} {$lang_nat}
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a> <a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a>
<input type="image" src="image.php?icon=save" alt="{$lang_submit}"> {if $nat_options}
</td> <input type="image" src="image.php?icon=save" alt="{$lang_submit}">
</tr> {/if}
</table> </td>
</tr>
<table class="info"> </table>
<tr>
<td class="header"> <table class="info">
{$lang_node} <tr>
</td> <td class="header">
<td class="header_right"> {$lang_node}
&nbsp; </td>
</td> <td class="header_right">
</tr> &nbsp;
<tr> </td>
<td class="label"> </tr>
{$lang_ip} <tr>
</td> <td class="label">
<td class="value"> {$lang_ip}
<a href="nodeview.php?node_id={$node_id_ext}">{$node_ip_ext}</a> </td>
</td> <td class="value">
</tr> <a href="nodeview.php?node_id={$node_id_ext}">{$node_ip_ext}</a>
</table> </td>
</tr>
<table class="info"> </table>
<tr>
<td class="header"> <table class="info">
{$lang_nat_del} <tr>
</td> <td class="header">
<td class="header_right"> {$lang_nat_del}
&nbsp; </td>
</td> <td class="header_right">
</tr> &nbsp;
<tr> </td>
<td class="label"> </tr>
{$lang_node} <tr>
</td> {if $nat_options}
<td class="value"> <td class="label">
{html_options name=node_id_int options=$node_id_int_options} {$lang_node}
</td> </td>
</tr> <td class="value">
</table> {html_options name=nat_ext options=$nat_options}
</td>
{else}
<td colspan="2">
No NAT rule to delete
</td>
{/if}
</tr>
</table>

@ -1,138 +1,144 @@
<table class="title"> <table class="title">
<tr> <tr>
<td class="header"> <td class="header">
<img class="icon" src="images/network-ethernet.png" alt="" /> <img class="icon" src="images/network-ethernet.png" alt="" />
{$node_ip} {$node_ip}
</td> </td>
<td align="right"> <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="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="nodedel.php?node_id={$node.node_id}"><img src="image.php?icon=delete" alt="{$lang_node_del}"></a>
</td> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_node} {$lang_node}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_ip} {$lang_ip}
</td> </td>
<td class="value"> <td class="value">
<a href="nodeview.php?node_id={$node.node_id}">{$node.node_ip}</a> <a href="nodeview.php?node_id={$node.node_id}">{$node.node_ip}</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_proto_vers} {$lang_proto_vers}
</td> </td>
<td class="value"> <td class="value">
{$node.node_type} {$node.node_type}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_mac} {$lang_mac}
</td> </td>
<td class="value"> <td class="value">
{$node.node_mac} {$node.node_mac}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_dns1} {$lang_dns1}
</td> </td>
<td class="value"> <td class="value">
{$node.node_dns1} {$node.node_dns1}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_dns2} {$lang_dns2}
</td> </td>
<td class="value"> <td class="value">
{$node.node_dns2} {$node.node_dns2}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_node_info} {$lang_node_info}
</td> </td>
<td class="value"> <td class="value">
{$node.node_info} {$node.node_info}
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_zone} {$lang_zone}
</td> </td>
<td class="value"> <td class="value">
{$node.zone_origin} {$node.zone_origin}
</td> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_asset} {$lang_asset}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_asset_name} {$lang_asset_name}
</td> </td>
<td class="value"> <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> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_subnet} {$lang_subnet}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_subnet_subnetaddress}/{$lang_subnet_mask} {$lang_subnet_subnetaddress}/{$lang_subnet_mask}
</td> </td>
<td class="value"> <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.node_ip}">{$node.subnet_address}/{$node.subnet_mask}</a>
</td> </td>
</tr> </tr>
</table> </table>
<table class="info"> <table class="info">
<tr> <tr>
<td class="header"> <td class="header">
{$lang_nat} {$lang_nat}
</td> </td>
<td class="header_right"> <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.node_id}"><img src="image.php?icon=edit" alt="{$lang_nat_edit}"></a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label"> <td class="label">
{$lang_nat_rules} ({$natrules|@count}) {$lang_nat_rules} ({$natrules|@count})
</td> </td>
<td class="value"> <td class="value">
{foreach item=rule from=$natrules} {foreach item=rule from=$natrules}
<a href="nodeview.php?node_id={$rule.nat_node_id}">{$rule.nat_node_ip}</a>/<a href="assetview.php?asset_id={$rule.nat_asset_id}">{$rule.nat_asset_name}</a> ({$rule.nat_type})<br /> {if $rule.node_id_int eq $node.node_id}
{/foreach} <img src="images/arrow_left.png" alt="incoming" title="coming from">
</td> <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 />
</tr> {else}
</table> <img src="images/arrow_right.png" alt="outgoing" title="forwarding to">
<a href="nodeview.php?node_id={$rule.node_id_int}">{$rule.node_ip_int}</a>/<a href="assetview.php?asset_id={$rule.asset_id_int}">{$rule.asset_name_int}</a> ({$rule.nat_type})<br />
{/if}
{/foreach}
</td>
</tr>
</table>