diff --git a/asset.php b/asset.php
index 2efa16e..a8ebe28 100644
--- a/asset.php
+++ b/asset.php
@@ -55,20 +55,18 @@
// build query
$query = "SELECT
- asset.asset_id AS asset_id,
- IF(LENGTH(asset.asset_name)>0, asset.asset_name, '...') AS asset_name,
- asset.asset_info AS asset_info,
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
+ 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,
- assetclass
+ asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE
- SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "'
- AND assetclass.assetclass_id=asset.assetclass_id
+ SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "'
ORDER BY
- asset.asset_name";
-
+ a.asset_name";
+
// run query
$assets = $db->db_select($query);
diff --git a/assetadd.php b/assetadd.php
index e85f5cc..3d3af06 100644
--- a/assetadd.php
+++ b/assetadd.php
@@ -36,12 +36,12 @@
// setup assetclass
// build query
$query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
+ assetclass_id,
+ assetclass_name
FROM
assetclass
ORDER BY
- assetclass.assetclass_name";
+ assetclass_name";
// run query
$assetclasses = $db->db_select($query);
diff --git a/assetclass.php b/assetclass.php
index c9fb73a..7e3ed41 100644
--- a/assetclass.php
+++ b/assetclass.php
@@ -33,18 +33,16 @@
// setup assetclass
// build query
$query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name,
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
+ a.assetclass_id,
+ a.assetclass_name,
+ g.assetclassgroup_id,
+ g.assetclassgroup_name,
+ g.assetclassgroup_color
FROM
- assetclass,
- assetclassgroup
- WHERE
- assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id
+ assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
ORDER BY
- assetclass.assetclass_name";
-
+ a.assetclass_name";
+
// run query
$assetclasses = $db->db_select($query);
diff --git a/assetclassdel.php b/assetclassdel.php
index e00749e..d870a34 100644
--- a/assetclassdel.php
+++ b/assetclassdel.php
@@ -36,12 +36,12 @@
// setup assetclass
// build query
$query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
+ assetclass_id,
+ assetclass_name
FROM
assetclass
WHERE
- assetclass.assetclass_id=" . $assetclass_id;
+ assetclass_id=" . $assetclass_id;
// run query
$assetclass = $db->db_select($query);
diff --git a/assetclassedit.php b/assetclassedit.php
index 9fe4a52..ac12eec 100644
--- a/assetclassedit.php
+++ b/assetclassedit.php
@@ -36,13 +36,13 @@
// setup assetclass
// build query
$query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name,
- assetclass.assetclassgroup_id AS assetclassgroup_id
+ assetclass_id,
+ assetclass_name,
+ assetclassgroup_id
FROM
assetclass
WHERE
- assetclass.assetclass_id=" . $assetclass_id;
+ assetclass_id=" . $assetclass_id;
// run query
$assetclass = $db->db_select($query);
diff --git a/assetclassgroup.php b/assetclassgroup.php
index b1babb3..79ecd11 100644
--- a/assetclassgroup.php
+++ b/assetclassgroup.php
@@ -33,13 +33,13 @@
// setup assetclassgroup
// build query
$query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
- assetclassgroup.assetclassgroup_color AS assetclassgroup_color
+ assetclassgroup_id,
+ assetclassgroup_name,
+ assetclassgroup_color
FROM
assetclassgroup
ORDER BY
- assetclassgroup.assetclassgroup_name";
+ assetclassgroup_name";
// run query
$assetclassgroups = $db->db_select($query);
diff --git a/assetclassgroupdel.php b/assetclassgroupdel.php
index 3232eba..281b345 100644
--- a/assetclassgroupdel.php
+++ b/assetclassgroupdel.php
@@ -36,12 +36,12 @@
// setup assetclassgroup
// build query
$query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
+ assetclassgroup_id,
+ assetclassgroup_name
FROM
assetclassgroup
WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+ assetclassgroup_id=" . $assetclassgroup_id;
// run query
$assetclassgroup = $db->db_select($query);
diff --git a/assetclassview.php b/assetclassview.php
index af3796c..bcd3122 100644
--- a/assetclassview.php
+++ b/assetclassview.php
@@ -35,17 +35,13 @@
// setup assetclass
// build query
- $query = "SELECT
- assetclass.assetclass_id,
- assetclass.assetclass_name,
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
+ $query = "SELECT
+ a.assetclass_id, a.assetclass_name,
+ g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color
FROM
- assetclass,
- assetclassgroup
+ assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id)
WHERE
- assetclass.assetclass_id=" . $assetclass_id . "
- AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
+ a.assetclass_id=" . $assetclass_id;
// run query
$assetclass = $db->db_select($query);
@@ -57,6 +53,7 @@
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
+ $smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']);
// send to tpl
// setup asset
diff --git a/assetedit.php b/assetedit.php
index d8bc853..0a31cc8 100644
--- a/assetedit.php
+++ b/assetedit.php
@@ -36,16 +36,16 @@
// setup asset
// build query
$query = "SELECT
- asset_id,
- asset.asset_name AS asset_name,
- asset.asset_hostname AS asset_hostname,
- asset.asset_info AS asset_info,
- asset.assetclass_id AS assetclass_id
+ asset_id,
+ asset_name,
+ asset_hostname,
+ asset_info,
+ assetclass_id
FROM
asset
WHERE
- asset.asset_id=" . $asset_id;
-
+ asset_id=" . $asset_id;
+
// run query
$asset = $db->db_select($query);
$smarty->assign("asset", $asset[0]);
diff --git a/assetview.php b/assetview.php
index adf1bb4..be2d18a 100644
--- a/assetview.php
+++ b/assetview.php
@@ -36,17 +36,15 @@
// setup asset
// build query
$query = "SELECT
- asset.asset_name,
- asset.asset_hostname,
- asset.asset_info,
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
+ a.asset_name,
+ a.asset_hostname,
+ a.asset_info,
+ c.assetclass_id,
+ c.assetclass_name
FROM
- asset,
- assetclass
+ asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id)
WHERE
- asset.asset_id=" . $asset_id . "
- AND assetclass.assetclass_id=asset.assetclass_id";
+ a.asset_id=" . $asset_id;
// run query
$asset = $db->db_select($query);
@@ -69,9 +67,9 @@
FROM
node
WHERE
- node.asset_id=" . $asset_id . "
+ asset_id=" . $asset_id . "
ORDER BY
- INET_ATON(node.node_ip)";
+ INET_ATON(node_ip)";
// run query
$nodes = $db->db_select($query);
diff --git a/assigniptonode.php b/assigniptonode.php
index 0ae77c7..d183771 100644
--- a/assigniptonode.php
+++ b/assigniptonode.php
@@ -36,13 +36,13 @@
// build query
$query = "SELECT
- subnet.subnet_address AS subnet_address,
- subnet.subnet_mask AS subnet_mask
+ subnet_address,
+ subnet_mask
FROM
subnet
WHERE
- subnet.subnet_id=" . $subnet_id;
-
+ subnet_id=" . $subnet_id;
+
// run query
$subnet = $db->db_select($query);
diff --git a/images/arrow_left.png b/images/arrow_left.png
new file mode 100644
index 0000000..1391cda
Binary files /dev/null and b/images/arrow_left.png differ
diff --git a/images/arrow_right.png b/images/arrow_right.png
new file mode 100644
index 0000000..5051c35
Binary files /dev/null and b/images/arrow_right.png differ
diff --git a/install/mysql_sample.sql b/install/mysql_sample.sql
index a53308f..719eff5 100644
--- a/install/mysql_sample.sql
+++ b/install/mysql_sample.sql
@@ -1,19 +1,23 @@
INSERT INTO asset (asset_name, assetclass_id) VALUES
('Computer', 1),
-('Server', 2),
-('Printer', 3);
+('Server', 3),
+('Printer', 4),
+('Firewall', 6);
INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
(1, 'Desktop'),
(1, 'Notebook'),
(2, 'Server'),
-(3, 'Printers'),
-(4, 'Scanners');
+(3, 'Printer'),
+(4, 'Switch'),
+(4, 'Firewall'),
+(5, 'Scanner');
INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
('Personal Computer', '000000'),
('Servers', '0000CC'),
('Periphery', '00CC00'),
+('Network', 'CCCC00'),
('Miscellaneous', 'CC0000');
INSERT INTO location (location_name, location_parent) VALUES
@@ -22,9 +26,13 @@ INSERT INTO location (location_name, location_parent) VALUES
('Branch Office B', 1);
INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
-('192.168.1.2', '001122334455', 1, 1),
-('192.168.1.1', 'aabbccddeeff', 1, 2),
-('192.168.0.1', '667755441122', 2, 3);
+('192.168.0.10', '001122334455', 1, 1),
+('192.168.0.11', 'aabbccddeeff', 1, 2),
+('192.168.0.12', '775544881199', 1, 3),
+('192.168.0.1', '667755441122', 1, 4),
+('192.168.1.1', '667755441123', 2, 4),
+('192.168.10.1', '667755441124', 3, 4),
+('192.168.20.1', '667755441125', 4, 4);
INSERT INTO subnet (subnet_address, subnet_mask) VALUES
('192.168.0.0', 24),
diff --git a/lang/de.php b/lang/de.php
index d31561f..45ae09c 100644
--- a/lang/de.php
+++ b/lang/de.php
@@ -197,7 +197,8 @@ $lang = array(
'lang_options_tooltips_help' => 'Tooltips anzeigen',
'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_gpl' => 'GNU General Public License (GPL)',
'lang_about_smarty' => 'Smarty Template Engine',
diff --git a/lang/en.php b/lang/en.php
index 05b50ce..754aca3 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -197,6 +197,7 @@ $lang = array(
'lang_options_tooltips_help' => 'Show tooltips',
'lang_options_language_help' => 'Language for this user',
+ 'lang_about_projectpage' => 'Current Project Page',
'lang_about_sfprojectpage' => 'Sourceforge Project Page',
'lang_about_license' => 'License',
'lang_about_gpl' => 'GNU General Public License (GPL)',
diff --git a/locationdel.php b/locationdel.php
index 5c64a81..615537e 100644
--- a/locationdel.php
+++ b/locationdel.php
@@ -36,11 +36,11 @@
// setup location
// build query
$query = "SELECT
- location.location_name AS location_name
+ location_name
FROM
location
WHERE
- location.location_id=" . $location_id;
+ location_id=" . $location_id;
// run query
$location = $db->db_select($query);
diff --git a/locationedit.php b/locationedit.php
index e5fba12..8bffd91 100644
--- a/locationedit.php
+++ b/locationedit.php
@@ -61,11 +61,13 @@
// look for locations
// build query
$query = "SELECT
- location.location_id AS location_id,
- location.location_name AS location_name,
- location.location_parent AS location_parent
+ location_id,
+ location_name,
+ location_parent
FROM
location
+ WHERE
+ location_id != " . $location_id . "
ORDER BY
location.location_name";
diff --git a/locationsubnetadd.php b/locationsubnetadd.php
index cb1c442..c01f319 100644
--- a/locationsubnetadd.php
+++ b/locationsubnetadd.php
@@ -36,11 +36,11 @@
// setup location
// build query
$query = "SELECT
- location.location_name AS location_name
+ location_name
FROM
location
WHERE
- location.location_id=" . $location_id;
+ location_id=" . $location_id;
// run query
$location = $db->db_select($query);
diff --git a/locationsubnetedit.php b/locationsubnetedit.php
index 810c412..6dd1381 100644
--- a/locationsubnetedit.php
+++ b/locationsubnetedit.php
@@ -36,11 +36,11 @@
// setup location
// build query
$query = "SELECT
- location.location_name AS location_name
+ location_name
FROM
location
WHERE
- location.location_id=" . $location_id;
+ location_id=" . $location_id;
// run query
$location = $db->db_select($query);
diff --git a/locationview.php b/locationview.php
index c4deb74..badebd4 100644
--- a/locationview.php
+++ b/locationview.php
@@ -85,18 +85,16 @@
// setup subnets
// build query
$query = "SELECT
- subnet.subnet_id AS subnet_id,
- subnet.subnet_address AS subnet_address,
- subnet.subnet_mask AS subnet_mask
+ s.subnet_id,
+ s.subnet_address,
+ s.subnet_mask
FROM
- subnet,
- subnetlocation
+ subnet AS s LEFT JOIN subnetlocation USING (subnet_id)
WHERE
subnetlocation.location_id=" . $location_id . "
- AND subnetlocation.subnet_id=subnet.subnet_id
ORDER BY
- INET_ATON(subnet.subnet_address)";
-
+ INET_ATON(s.subnet_address)";
+
// run query
$subnets = $db->db_select($query);
$smarty->assign("subnets", $subnets);
diff --git a/logout.php b/logout.php
index 1c1bc64..34518e2 100644
--- a/logout.php
+++ b/logout.php
@@ -1,33 +1,33 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // logout
- // user logout
- $user->user_logout();
-
- // redirect
- header("Location: index.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // logout
+ // user logout
+ $user->user_logout();
+
+ // redirect
+ header("Location: index.php");
?>
\ No newline at end of file
diff --git a/natadd.php b/natadd.php
index 1b5311b..b94e5f4 100644
--- a/natadd.php
+++ b/natadd.php
@@ -36,11 +36,11 @@
// setup node_ext
// build query
$query = "SELECT
- node.node_ip AS node_ip_ext
+ node_ip AS node_ip_ext
FROM
node
WHERE
- node.node_id=" . $node_id;
+ node_id=" . $node_id;
// run query
$node = $db->db_select($query);
@@ -51,14 +51,13 @@
// setup node_int
// build query
$query = "SELECT
- asset.asset_name AS asset_name,
- node.node_id AS node_id_int,
- node.node_ip AS node_ip_int
+ a.asset_name,
+ n.node_id AS node_id_int,
+ n.node_ip AS node_ip_int
FROM
- asset,
- node
+ asset AS a LEFT JOIN node AS n USING (asset_id)
WHERE
- node.node_id NOT IN (
+ n.node_id NOT IN (
SELECT
nat_int
FROM
@@ -66,10 +65,9 @@
WHERE
nat_ext=" . $node_id . "
)
- AND node.node_id!=" . $node_id . "
- AND asset.asset_id=node.asset_id
+ AND n.node_id!=" . $node_id . "
ORDER BY
- INET_ATON(node.node_ip)";
+ INET_ATON(n.node_ip)";
// run query
$nodes = $db->db_select($query);
diff --git a/natdel.php b/natdel.php
index 93ecbd4..b0e4eba 100644
--- a/natdel.php
+++ b/natdel.php
@@ -36,11 +36,11 @@
// setup node_ext
// build query
$query = "SELECT
- node.node_ip AS node_ip_ext
+ node_ip AS node_ip_ext
FROM
node
WHERE
- node.node_id=" . $node_id;
+ node_id=" . $node_id;
// run query
$node = $db->db_select($query);
@@ -48,28 +48,31 @@
$smarty->assign("node_id_ext", $node_id);
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']);
- // setup node
+ // setup options
// build query
$query = "SELECT
- asset.asset_name AS asset_name,
- node.node_id AS node_id_int,
- node.node_ip AS node_ip_int
+ a.asset_name,
+ n.node_ip,
+ x.nat_ext
FROM
- asset,
- nat,
- node
+ asset AS a,
+ nat AS x,
+ node AS n
WHERE
- nat.nat_ext=" . $node_id . "
- AND node.node_id=nat.nat_int
- AND asset.asset_id=node.asset_id
+ x.nat_ext=" . $node_id . "
+ AND n.node_id=x.nat_int
+ AND a.asset_id=n.asset_id
ORDER BY
- INET_ATON(node.node_ip)";
-
+ INET_ATON(n.node_ip)";
+
// run query
$nodes = $db->db_select($query);
- $smarty->assign("nodes", $nodes);
-// ***
+ $options = array();
+ foreach ($nodes as $rec) {
+ $options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name'];
+ }
+ $smarty->assign("nat_options", $options);
// end page
// output
diff --git a/nodedel.php b/nodedel.php
index 732e443..e47775b 100644
--- a/nodedel.php
+++ b/nodedel.php
@@ -36,12 +36,12 @@
// setup node
// build query
$query = "SELECT
- node.asset_id AS asset_id,
- node.node_ip AS node_ip
+ asset_id,
+ node_ip
FROM
node
WHERE
- node.node_id=" . $node_id;
+ node_id=" . $node_id;
// run query
$node = $db->db_select($query);
diff --git a/nodeedit.php b/nodeedit.php
index cf6fe10..54080d9 100644
--- a/nodeedit.php
+++ b/nodeedit.php
@@ -36,24 +36,24 @@
// setup node
// build query
$query = "SELECT
- asset.asset_id AS asset_id,
- node.node_id AS node_id,
- node.node_ip AS node_ip,
- node.node_mac AS node_mac,
- node.node_dns1 AS node_dns1,
- node.node_dns2 AS node_dns2,
- node.node_info AS node_info,
- subnet.subnet_id AS subnet_id,
- node.zone_id AS zone_id
+ 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,
- node,
- subnet
+ asset AS a,
+ node AS n,
+ subnet AS s
WHERE
- asset.asset_id=node.asset_id
- AND node.node_id=" . $node_id . "
- AND subnet.subnet_id=node.subnet_id";
-
+ a.asset_id=n.asset_id
+ AND n.node_id=" . $node_id . "
+ AND s.subnet_id=n.subnet_id";
+
// run query
$node = $db->db_select($query);
diff --git a/nodeview.php b/nodeview.php
index 68795b4..5ce37a6 100644
--- a/nodeview.php
+++ b/nodeview.php
@@ -74,13 +74,15 @@
nat.nat_ext AS nat_ext,
nat.nat_int AS nat_int,
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
- asset asset_ext,
- asset asset_int,
+ asset AS asset_ext,
+ asset AS asset_int,
nat,
- node node_ext,
- node node_int
+ node AS node_ext,
+ node AS node_int
WHERE
(nat.nat_ext=" . $node_id . "
OR nat.nat_int=" . $node_id . ")
diff --git a/submit.php b/submit.php
index 32ca6b9..4dfdf93 100644
--- a/submit.php
+++ b/submit.php
@@ -135,10 +135,10 @@
$query = "INSERT
INTO
asset(
- asset.asset_name,
- asset.asset_hostname,
- asset.assetclass_id,
- asset.asset_info
+ asset_name,
+ asset_hostname,
+ assetclass_id,
+ asset_info
)
VALUE
(
@@ -163,8 +163,8 @@
$query = "INSERT
INTO
assetclass(
- assetclass.assetclass_name,
- assetclass.assetclassgroup_id
+ assetclass_name,
+ assetclassgroup_id
)
VALUE
(
@@ -187,8 +187,8 @@
$query = "INSERT
INTO
assetclassgroup(
- assetclassgroup.assetclassgroup_name,
- assetclassgroup.assetclassgroup_color
+ assetclassgroup_name,
+ assetclassgroup_color
)
VALUE
(
@@ -216,13 +216,13 @@
$query = "INSERT
INTO
node(
- node.node_ip,
- node.node_mac,
- node.node_dns1,
- node.node_dns2,
- node.subnet_id,
- node.asset_id,
- node.node_info
+ node_ip,
+ node_mac,
+ node_dns1,
+ node_dns2,
+ subnet_id,
+ asset_id,
+ node_info
)
VALUE
(
@@ -250,8 +250,8 @@
$query = "INSERT
INTO
subnetlocation(
- subnetlocation.location_id,
- subnetlocation.subnet_id
+ location_id,
+ subnet_id
)
VALUE
(
@@ -274,9 +274,9 @@
$query = "UPDATE
subnet
SET
- subnet.vlan_id='$vlan_id'
+ vlan_id='$vlan_id'
WHERE
- subnet.subnet_id='$subnet_id'";
+ subnet_id='$subnet_id'";
// run query
$db->db_update($query);
@@ -294,9 +294,9 @@
$query = "INSERT
INTO
location(
- location.location_name,
- location.location_parent,
- location.location_info
+ location_name,
+ location_parent,
+ location_info
)
VALUE
(
@@ -320,8 +320,8 @@
$query = "INSERT
INTO
subnetlocation(
- subnetlocation.location_id,
- subnetlocation.subnet_id
+ location_id,
+ subnet_id
)
VALUE
(
@@ -345,9 +345,9 @@
$query = "INSERT
INTO
nat(
- nat.nat_ext,
- nat.nat_int,
- nat.nat_type
+ nat_ext,
+ nat_int,
+ nat_type
)
VALUE
(
@@ -378,9 +378,9 @@
$query = "INSERT
INTO
asset(
- asset.asset_name,
- asset.asset_hostname,
- asset.assetclass_id
+ asset_name,
+ asset_hostname,
+ assetclass_id
)
VALUE
(
@@ -396,13 +396,13 @@
$query = "INSERT
INTO
node(
- node.node_ip,
- node.node_mac,
- node.node_dns1,
- node.node_dns2,
- node.node_info,
- node.subnet_id,
- node.asset_id
+ node_ip,
+ node_mac,
+ node_dns1,
+ node_dns2,
+ node_info,
+ subnet_id,
+ asset_id
)
VALUE
(
@@ -431,9 +431,9 @@
$query = "INSERT
INTO
subnet(
- subnet.subnet_address,
- subnet.subnet_mask,
- subnet.subnet_info
+ subnet_address,
+ subnet_mask,
+ subnet_info
)
VALUE
(
@@ -457,8 +457,8 @@
$query = "INSERT
INTO
subnetlocation(
- subnetlocation.location_id,
- subnetlocation.subnet_id
+ location_id,
+ subnet_id
)
VALUE
(
@@ -481,8 +481,8 @@
$query = "INSERT
INTO
subnetvlan(
- subnetvlan.subnet_id,
- subnetvlan.vlan_id
+ subnet_id,
+ vlan_id
)
VALUE
(
@@ -504,11 +504,11 @@
// build query
$query = "SELECT
- user.user_name
+ user_name
FROM
user
WHERE
- user.user_name='$user_name'";
+ user_name='$user_name'";
// run query
$users = $db->db_select($query);
@@ -522,9 +522,9 @@
$query = "INSERT
INTO
user(
- user.user_name,
- user.user_displayname,
- user.user_pass
+ user_name,
+ user_displayname,
+ user_pass
)
VALUE
(
@@ -553,9 +553,9 @@
$query = "INSERT
INTO
vlan(
- vlan.vlan_name,
- vlan.vlan_number,
- vlan.vlan_info
+ vlan_name,
+ vlan_number,
+ vlan_info
)
VALUE
(
@@ -579,8 +579,8 @@
$query = "INSERT
INTO
subnetvlan(
- subnetvlan.subnet_id,
- subnetvlan.vlan_id
+ subnet_id,
+ vlan_id
)
VALUE
(
@@ -616,21 +616,21 @@
$query = "INSERT
INTO
zone(
- zone.zone_origin,
- zone.zone_ttl_default,
- zone.zone_soa,
- zone.zone_hostmaster,
- zone.zone_refresh,
- zone.zone_retry,
- zone.zone_expire,
- zone.zone_ttl,
- zone.zone_serial,
- zone.zone_ns1,
- zone.zone_ns2,
- zone.zone_ns3,
- zone.zone_mx1,
- zone.zone_mx2,
- zone.zone_info
+ zone_origin,
+ zone_ttl_default,
+ zone_soa,
+ zone_hostmaster,
+ zone_refresh,
+ zone_retry,
+ zone_expire,
+ zone_ttl,
+ zone_serial,
+ zone_ns1,
+ zone_ns2,
+ zone_ns3,
+ zone_mx1,
+ zone_mx2,
+ zone_info
)
VALUE
(
@@ -672,7 +672,7 @@
FROM
asset
WHERE
- asset.asset_id=" . $asset_id;
+ asset_id=" . $asset_id;
// run query
$db->db_delete($query);
@@ -682,7 +682,7 @@
FROM
node
WHERE
- node.asset_id=" . $asset_id;
+ asset_id=" . $asset_id;
// run query
$db->db_delete($query);
@@ -699,7 +699,7 @@
FROM
assetclass
WHERE
- assetclass.assetclass_id=" . $assetclass_id;
+ assetclass_id=" . $assetclass_id;
// run query
$db->db_delete($query);
@@ -716,7 +716,7 @@
FROM
assetclassgroup
WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+ assetclassgroup_id=" . $assetclassgroup_id;
// run query
$db->db_delete($query);
@@ -733,7 +733,7 @@
FROM
location
WHERE
- location.location_id=" . $location_id;
+ location_id=" . $location_id;
// run query
$db->db_delete($query);
@@ -751,8 +751,8 @@
FROM
subnetlocation
WHERE
- subnetlocation.location_id=" . $location_id . "
- AND subnetlocation.subnet_id=" . $subnet_id;
+ location_id=" . $location_id . "
+ AND subnet_id=" . $subnet_id;
// run query
$db->db_delete($query);
@@ -770,8 +770,8 @@
FROM
nat
WHERE
- nat.nat_ext=" . $node_id_ext . "
- AND nat.nat_int=" . $node_id_int;
+ nat_ext=" . $node_id_ext . "
+ AND nat_int=" . $node_id_int;
// run query
$db->db_delete($query);
@@ -789,7 +789,7 @@
FROM
node
WHERE
- node.node_id=" . $node_id;
+ node_id=" . $node_id;
// run query
$db->db_delete($query);
@@ -807,7 +807,7 @@
FROM
subnet
WHERE
- subnet.subnet_id=" . $subnet_id;
+ subnet_id=" . $subnet_id;
// run query
$db->db_delete($query);
@@ -836,8 +836,8 @@
FROM
subnetlocation
WHERE
- subnetlocation.location_id=" . $location_id . "
- AND subnetlocation.subnet_id=" . $subnet_id;
+ location_id=" . $location_id . "
+ AND subnet_id=" . $subnet_id;
// run query
$db->db_delete($query);
@@ -855,8 +855,8 @@
FROM
subnetvlan
WHERE
- subnetvlan.subnet_id=" . $subnet_id . "
- AND subnetvlan.vlan_id=" . $vlan_id;
+ subnet_id=" . $subnet_id . "
+ AND vlan_id=" . $vlan_id;
// run query
$db->db_delete($query);
@@ -873,7 +873,7 @@
FROM
user
WHERE
- user.user_id=" . $user_id;
+ user_id=" . $user_id;
// run query
$db->db_delete($query);
@@ -890,7 +890,7 @@
FROM
vlan
WHERE
- vlan.vlan_id=" . $vlan_id;
+ vlan_id=" . $vlan_id;
// run query
$db->db_delete($query);
@@ -908,8 +908,8 @@
FROM
subnetvlan
WHERE
- subnetvlan.subnet_id=" . $subnet_id . "
- AND subnetvlan.vlan_id=" . $vlan_id;
+ subnet_id=" . $subnet_id . "
+ AND vlan_id=" . $vlan_id;
// run query
$db->db_delete($query);
@@ -951,12 +951,12 @@
$query = "UPDATE
asset
SET
- asset.asset_name='$asset_name',
- asset.asset_info='$asset_info',
- asset.asset_hostname='$asset_hostname',
- asset.assetclass_id='$assetclass_id'
+ asset_name='$asset_name',
+ asset_info='$asset_info',
+ asset_hostname='$asset_hostname',
+ assetclass_id='$assetclass_id'
WHERE
- asset.asset_id=" . $asset_id;
+ asset_id=" . $asset_id;
// run query
$db->db_update($query);
@@ -973,10 +973,10 @@
$query = "UPDATE
assetclass
SET
- assetclass.assetclass_name='$assetclass_name',
- assetclass.assetclassgroup_id='$assetclassgroup_id'
+ assetclass_name='$assetclass_name',
+ assetclassgroup_id='$assetclassgroup_id'
WHERE
- assetclass.assetclass_id=" . $assetclass_id;
+ assetclass_id=" . $assetclass_id;
// run query
$db->db_update($query);
@@ -994,10 +994,10 @@
$query = "UPDATE
assetclassgroup
SET
- assetclassgroup.assetclassgroup_name='$assetclassgroup_name',
- assetclassgroup.assetclassgroup_color='$assetclassgroup_color'
+ assetclassgroup_name='$assetclassgroup_name',
+ assetclassgroup_color='$assetclassgroup_color'
WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+ assetclassgroup_id=" . $assetclassgroup_id;
// run query
$db->db_update($query);
@@ -1016,11 +1016,11 @@
$query = "UPDATE
location
SET
- location.location_name='$location_name',
- location.location_parent='$parentlocation_id',
- location.location_info='$location_info'
+ location_name='$location_name',
+ location_parent='$parentlocation_id',
+ location_info='$location_info'
WHERE
- location.location_id=" . $location_id;
+ location_id=" . $location_id;
// run query
$db->db_update($query);
@@ -1044,16 +1044,16 @@
$query = "UPDATE
node
SET
- node.asset_id='$asset_id',
- node.node_ip='$node_ip',
- node.subnet_id='$subnet_id',
- node.node_mac='$node_mac',
- node.node_dns1='$node_dns1',
- node.node_dns2='$node_dns2',
- node.node_info='$node_info',
- node.zone_id='$zone_id'
+ asset_id='$asset_id',
+ node_ip='$node_ip',
+ subnet_id='$subnet_id',
+ node_mac='$node_mac',
+ node_dns1='$node_dns1',
+ node_dns2='$node_dns2',
+ node_info='$node_info',
+ zone_id='$zone_id'
WHERE
- node.node_id=" . $node_id;
+ node_id=" . $node_id;
// run query
$db->db_update($query);
@@ -1086,25 +1086,25 @@
$query = "UPDATE
user
SET
- user.user_language='" . $user_language . "',
- user.user_imagesize='" . $user_imagesize . "',
- user.user_imagecount='" . $user_imagecount . "',
- user.user_mac='" . $user_mac . "',
- user.user_dateformat='" . $user_dateformat . "',
- user.user_dns1suffix='" . $user_dns1suffix . "',
- user.user_dns2suffix='" . $user_dns2suffix . "',
- user.user_menu_assets='" . $user_menu_assets . "',
- user.user_menu_assetclasses='" . $user_menu_assetclasses . "',
- user.user_menu_assetclassgroups='" . $user_menu_assetclassgroups . "',
- user.user_menu_locations='" . $user_menu_locations . "',
- user.user_menu_nodes='" . $user_menu_nodes . "',
- user.user_menu_subnets='" . $user_menu_subnets . "',
- user.user_menu_users='" . $user_menu_users . "',
- user.user_menu_vlans='" . $user_menu_vlans . "',
- user.user_menu_zones='" . $user_menu_zones . "',
- user.user_tooltips='" . $user_tooltips . "'
+ user_language='" . $user_language . "',
+ user_imagesize='" . $user_imagesize . "',
+ user_imagecount='" . $user_imagecount . "',
+ user_mac='" . $user_mac . "',
+ user_dateformat='" . $user_dateformat . "',
+ user_dns1suffix='" . $user_dns1suffix . "',
+ user_dns2suffix='" . $user_dns2suffix . "',
+ user_menu_assets='" . $user_menu_assets . "',
+ user_menu_assetclasses='" . $user_menu_assetclasses . "',
+ user_menu_assetclassgroups='" . $user_menu_assetclassgroups . "',
+ user_menu_locations='" . $user_menu_locations . "',
+ user_menu_nodes='" . $user_menu_nodes . "',
+ user_menu_subnets='" . $user_menu_subnets . "',
+ user_menu_users='" . $user_menu_users . "',
+ user_menu_vlans='" . $user_menu_vlans . "',
+ user_menu_zones='" . $user_menu_zones . "',
+ user_tooltips='" . $user_tooltips . "'
WHERE
- user.user_id=" . $user_id;
+ user_id=" . $user_id;
// update session
$_SESSION['suser_language'] = $user_language;
@@ -1140,11 +1140,11 @@
// get current pass from db
$query = "SELECT
- user.user_pass
+ user_pass
FROM
user
WHERE
- user.user_id='" . $user_id . "'";
+ user_id='" . $user_id . "'";
// run query
$user = $db->db_select($query);
@@ -1156,9 +1156,9 @@
$query = "UPDATE
user
SET
- user.user_pass='" . md5($user_newpass1) . "'
+ user_pass='" . md5($user_newpass1) . "'
WHERE
- user.user_id=" . $user_id;
+ user_id=" . $user_id;
// run query
$db->db_update($query);
@@ -1209,10 +1209,10 @@
$query = "UPDATE
user
SET
- user.user_name='" . $user_name . "',
- user.user_displayname='" . $user_displayname . "'
+ user_name='" . $user_name . "',
+ user_displayname='" . $user_displayname . "'
WHERE
- user.user_id=" . $user_id;
+ user_id=" . $user_id;
// run query
$db->db_update($query);
@@ -1231,11 +1231,11 @@
$query = "UPDATE
vlan
SET
- vlan.vlan_name='$vlan_name',
- vlan.vlan_number='$vlan_number',
- vlan.vlan_info='$vlan_info'
+ vlan_name='$vlan_name',
+ vlan_number='$vlan_number',
+ vlan_info='$vlan_info'
WHERE
- vlan.vlan_id=" . $vlan_id;
+ vlan_id=" . $vlan_id;
// run query
$db->db_update($query);
diff --git a/subnet.php b/subnet.php
index 9914cc0..a09412e 100644
--- a/subnet.php
+++ b/subnet.php
@@ -41,11 +41,7 @@
CHAR_LENGTH(s.subnet_info) AS subnet_length,
COUNT(node.subnet_id) AS node_counter
FROM
- subnet AS s
- LEFT JOIN
- node
- ON
- node.subnet_id=s.subnet_id
+ subnet AS s LEFT JOIN node USING (subnet_id)
GROUP BY
s.subnet_id
ORDER BY
diff --git a/subnetadd.php b/subnetadd.php
index 56062f5..538975d 100644
--- a/subnetadd.php
+++ b/subnetadd.php
@@ -36,14 +36,14 @@
// setup vlan
// build query
$query = "SELECT
- vlan.vlan_id AS vlan_id,
- vlan.vlan_number AS vlan_number,
- vlan.vlan_name AS vlan_name
+ vlan_id,
+ vlan_number,
+ vlan_name
FROM
vlan
ORDER BY
- vlan.vlan_name";
-
+ vlan_name";
+
// run query
$vlans = $db->db_select($query);
$vlan_options[0] = $lang['lang_option_none'];
diff --git a/subnetdel.php b/subnetdel.php
index 1ac4c3e..9d1bc34 100644
--- a/subnetdel.php
+++ b/subnetdel.php
@@ -36,12 +36,12 @@
// setup subnet
// build query
$query = "SELECT
- subnet.subnet_address AS subnet_address,
- subnet.subnet_mask AS subnet_mask
+ subnet_address,
+ subnet_mask
FROM
subnet
WHERE
- subnet.subnet_id=" . $subnet_id;
+ subnet_id=" . $subnet_id;
// run query
$subnet = $db->db_select($query);
@@ -54,15 +54,15 @@
// setup node
// build query
$query = "SELECT
- node.node_id AS node_id,
- node.node_ip AS node_ip
+ node_id,
+ node_ip
FROM
node
WHERE
- node.subnet_id=" . $subnet_id . "
+ subnet_id=" . $subnet_id . "
ORDER BY
- INET_ATON(node.node_ip)";
-
+ INET_ATON(node_ip)";
+
// run query
$nodes = $db->db_select($query);
$smarty->assign("nodes", $nodes);
diff --git a/subnetview.php b/subnetview.php
index 77f1196..59ab994 100644
--- a/subnetview.php
+++ b/subnetview.php
@@ -42,24 +42,20 @@
// setup subnet
// build query
$query = "SELECT
- subnet.subnet_address,
- subnet.subnet_mask,
- subnet.subnet_dhcp_start,
- subnet.subnet_dhcp_end,
- subnet.subnet_info,
- subnet.protocol_version,
- subnet.ntp_server,
+ s.subnet_address,
+ s.subnet_mask,
+ s.subnet_dhcp_start,
+ s.subnet_dhcp_end,
+ s.subnet_info,
+ s.protocol_version,
+ s.ntp_server,
COUNT(node.subnet_id) AS node_counter
FROM
- subnet
- LEFT JOIN
- node
- ON
- node.subnet_id=subnet.subnet_id
+ subnet AS s LEFT JOIN node USING (subnet_id)
WHERE
- subnet.subnet_id=" . $subnet_id . "
+ s.subnet_id=" . $subnet_id . "
GROUP BY
- subnet.subnet_id";
+ s.subnet_id";
// run query
$subnet = $db->db_select($query);
@@ -394,18 +390,14 @@
// setup location
// build query
$query = "SELECT
- location.location_id,
- location.location_name
+ l.location_id,
+ l.location_name
FROM
- location
- LEFT JOIN
- subnetlocation
- ON
- subnetlocation.location_id=location.location_id
+ location AS l LEFT JOIN subnetlocation AS s USING (location_id)
WHERE
- subnetlocation.subnet_id=". $subnet_id . "
+ s.subnet_id=". $subnet_id . "
ORDER BY
- location.location_name";
+ l.location_name";
// run query
$locations = $db->db_select($query);
diff --git a/tpl/about.tpl b/tpl/about.tpl
index 0a8018d..7c48343 100644
--- a/tpl/about.tpl
+++ b/tpl/about.tpl
@@ -15,6 +15,14 @@
+
+
+ {$lang_about_projectpage}
+ |
+
+ https://git.piratenpartei-sh.de/thooge/ipreg
+ |
+
{$lang_about_sfprojectpage}
diff --git a/tpl/assetclass.tpl b/tpl/assetclass.tpl
index d0eaa62..c84ed25 100644
--- a/tpl/assetclass.tpl
+++ b/tpl/assetclass.tpl
@@ -24,6 +24,7 @@
{$assetclass.assetclass_name}
|
+
{$assetclass.assetclassgroup_name}
|
diff --git a/tpl/assetclassview.tpl b/tpl/assetclassview.tpl
index c8055ae..19f2f69 100644
--- a/tpl/assetclassview.tpl
+++ b/tpl/assetclassview.tpl
@@ -1,73 +1,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- {$lang_assets} ({$assets|@count})
- |
-
- {foreach item=asset from=$assets}
- {$asset.asset_name}
- {$asset.asset_info}
-
- {/foreach}
- |
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$lang_assets} ({$assets|@count})
+ |
+
+ {foreach item=asset from=$assets}
+ {$asset.asset_name}
+ {$asset.asset_info}
+
+ {/foreach}
+ |
+
+
diff --git a/tpl/header.tpl b/tpl/header.tpl
index f49eb4b..d88e0dc 100644
--- a/tpl/header.tpl
+++ b/tpl/header.tpl
@@ -1,55 +1,55 @@
-
-
-
-{$lang_ipreg}
-
-
-
-
-{foreach item=style from=$styles}
-
-{/foreach}
-{foreach item=script from=$scripts}
-
-{/foreach}
-
-
-
-
-
-
+
+
+
+{$lang_ipreg}
+
+
+
+
+{foreach item=style from=$styles}
+
+{/foreach}
+{foreach item=script from=$scripts}
+
+{/foreach}
+
+
+
+
+
+
diff --git a/tpl/natdel.tpl b/tpl/natdel.tpl
index d190cd8..b6de7f4 100644
--- a/tpl/natdel.tpl
+++ b/tpl/natdel.tpl
@@ -1,53 +1,61 @@
-