diff --git a/about.php b/about.php
index 918338a..5f3cde2 100644
--- a/about.php
+++ b/about.php
@@ -1,47 +1,43 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/about.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup page
- // set vars
- $tp->set("config_version", $config_version);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup page
+ // set vars
+ $smarty->assign("config_version", $config_version);
+
+ // end page
+ // output
+ $smarty->display("about.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/asset.php b/asset.php
index 6845b9c..2efa16e 100644
--- a/asset.php
+++ b/asset.php
@@ -1,129 +1,84 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/asset.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // create letter links
- // build query
- $query = "SELECT
- SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
- FROM
- asset
- GROUP BY
- asset_letter
- ORDER BY
- asset_letter";
-
- // run query
- $alphabet = $db->db_select($query);
-
- // count results
- $alphabet_counter = count($alphabet);
-
- // any letters?
- if ($alphabet_counter>0) {
- // get objects
- foreach($alphabet AS $alphabet_letter) {
- // to tpl
- $tp->set("asset_letter", strtoupper($alphabet_letter['asset_letter']));
-
- // parse every row
- $tp->parse("letter_row");
- }
- }
-
- // parse block
- $tp->parse("letter_table");
-
- // setup asset
- // setup current letter
- if(isset($_GET['asset_letter'])) {
- $asset_letter = sanitize($_GET['asset_letter']);
- } else {
- $asset_letter = $alphabet[0]['asset_letter'];
- }
-
- // build query
- $query = "SELECT
- asset.asset_id AS asset_id,
- asset.asset_name AS asset_name,
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- asset,
- assetclass
- WHERE
- SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "'
- AND assetclass.assetclass_id=asset.assetclass_id
- ORDER BY
- asset.asset_name";
-
- // run query
- $assets = $db->db_select($query);
-
- // count results
- $asset_counter = count($assets);
-
- // counter to tpl
- $tp->set("asset_counter", $asset_counter);
-
- // any assets?
- if ($asset_counter>0) {
- // get objects
- foreach($assets AS $asset) {
- // send to tpl
- $tp->set("asset_id", $asset['asset_id']);
- $tp->set("asset_name", $asset['asset_name']);
-
- $tp->set("assetclass_id", $asset['assetclass_id']);
- $tp->set("assetclass_name", $asset['assetclass_name']);
-
- // parse row
- $tp->parse("asset_row");
- }
-
- // parse block
- $tp->parse("asset_table");
- } else {
- // hide block
- $tp->hide("asset_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // create letter links
+ // build query
+ $query = "SELECT
+ SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
+ FROM
+ asset
+ GROUP BY
+ asset_letter
+ ORDER BY
+ asset_letter";
+
+ // run query
+ $alphabet = $db->db_select($query);
+ $smarty->assign("alphabet", $alphabet);
+
+ // setup asset
+ // setup current letter
+ if(isset($_GET['asset_letter'])) {
+ $asset_letter = sanitize($_GET['asset_letter']);
+ } else {
+ $asset_letter = $alphabet[0]['asset_letter'];
+ }
+
+ // 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
+ FROM
+ asset,
+ assetclass
+ WHERE
+ SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "'
+ AND assetclass.assetclass_id=asset.assetclass_id
+ ORDER BY
+ asset.asset_name";
+
+ // run query
+ $assets = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("assets", $assets);
+
+ // end page
+ // output
+ $smarty->display("asset.tpl");
+
+ // end output
+ include("footer.php");
+?>
diff --git a/assetadd.php b/assetadd.php
index d9e3b1d..e85f5cc 100644
--- a/assetadd.php
+++ b/assetadd.php
@@ -1,77 +1,59 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = "");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetadd.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclass
- // build query
- $query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- assetclass
- ORDER BY
- assetclass.assetclass_name";
-
- // run query
- $assetclasses = $db->db_select($query);
-
- foreach($assetclasses AS $assetclass) {
- // send to tpl
- $tp->set("assetclass_id", $assetclass['assetclass_id']);
- $tp->set("assetclass_name", $assetclass['assetclass_name']);
-
- if($assetclass['assetclass_id']==$assetclass_id) {
- $tp->set("assetclass_selected", "selected");
- } else {
- $tp->set("assetclass_selected", "");
- }
-
- // parse block
- $tp->parse("assetclass_row");
- }
-
- // parse block
- $tp->parse("assetclass_table");
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = "");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclass
+ // build query
+ $query = "SELECT
+ assetclass.assetclass_id AS assetclass_id,
+ assetclass.assetclass_name AS assetclass_name
+ FROM
+ assetclass
+ ORDER BY
+ assetclass.assetclass_name";
+
+ // run query
+ $assetclasses = $db->db_select($query);
+ foreach ($assetclasses as $assetclass) {
+ $assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name'];
+ }
+ $smarty->assign("assetclass_options", $assetclass_options);
+
+ // end page
+ // output
+ $smarty->display("assetadd.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclass.php b/assetclass.php
index 795b204..c9fb73a 100644
--- a/assetclass.php
+++ b/assetclass.php
@@ -1,89 +1,61 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclass.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // 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
- FROM
- assetclass,
- assetclassgroup
- WHERE
- assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id
- ORDER BY
- assetclass.assetclass_name";
-
- // run query
- $assetclasses = $db->db_select($query);
-
- // count results
- $assetclass_counter = count($assetclasses);
-
- // counter to tpl
- $tp->set("assetclass_counter", $assetclass_counter);
-
- // any assetclasses?
- if ($assetclass_counter>0) {
- // get objects
- foreach($assetclasses AS $assetclass) {
- // send to tpl
- $tp->set("assetclass_id", $assetclass['assetclass_id']);
- $tp->set("assetclass_name", $assetclass['assetclass_name']);
-
- $tp->set("assetclassgroup_id", $assetclass['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclass['assetclassgroup_name']);
-
- // parse row
- $tp->parse("assetclass_row");
- }
-
- // parse block
- $tp->parse("assetclass_table");
- } else {
- // hide block
- $tp->hide("assetclass_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // 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
+ FROM
+ assetclass,
+ assetclassgroup
+ WHERE
+ assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id
+ ORDER BY
+ assetclass.assetclass_name";
+
+ // run query
+ $assetclasses = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("assetclasses", $assetclasses);
+
+
+ // end page
+ // output
+ $smarty->display("assetclass.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassadd.php b/assetclassadd.php
index 48446b8..4ea4ad9 100644
--- a/assetclassadd.php
+++ b/assetclassadd.php
@@ -1,78 +1,45 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = "");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassadd.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
- FROM
- assetclassgroup
- ORDER BY
- assetclassgroup.assetclassgroup_name";
-
- // run query
- $assetclassgroup = $db->db_select($query);
-
- // get objects
- foreach($assetclassgroup AS $assetclassgroup) {
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
-
- if($assetclassgroup['assetclassgroup_id']==$assetclassgroup_id) {
- $tp->set("assetclassgroup_selected", "selected");
- } else {
- $tp->set("assetclassgroup_selected", "");
- }
-
- // parse block
- $tp->parse("assetclassgroup_row");
- }
-
- // parse block
- $tp->parse("assetclassgroup_table");
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = "");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclassgroup
+ $smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
+
+ // end page
+ // output
+ $smarty->display("assetclassadd.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassdel.php b/assetclassdel.php
index 0894729..e00749e 100644
--- a/assetclassdel.php
+++ b/assetclassdel.php
@@ -1,63 +1,59 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclass_id = sanitize($_GET['assetclass_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassdel.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclass
- // build query
- $query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- assetclass
- WHERE
- assetclass.assetclass_id=" . $assetclass_id;
-
- // run query
- $assetclass = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
- $tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclass_id = sanitize($_GET['assetclass_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclass
+ // build query
+ $query = "SELECT
+ assetclass.assetclass_id AS assetclass_id,
+ assetclass.assetclass_name AS assetclass_name
+ FROM
+ assetclass
+ WHERE
+ assetclass.assetclass_id=" . $assetclass_id;
+
+ // run query
+ $assetclass = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
+ $smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
+
+ // end page
+ // output
+ $smarty->display("assetclassdel.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassedit.php b/assetclassedit.php
index 34e4ed7..9fe4a52 100644
--- a/assetclassedit.php
+++ b/assetclassedit.php
@@ -1,96 +1,65 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclass_id = sanitize($_GET['assetclass_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassedit.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclass
- // build query
- $query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name,
- assetclass.assetclassgroup_id AS assetclassgroup_id
- FROM
- assetclass
- WHERE
- assetclass.assetclass_id=" . $assetclass_id;
-
- // run query
- $assetclass = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
- $tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
- FROM
- assetclassgroup
- ORDER BY
- assetclassgroup.assetclassgroup_name";
-
- // run query
- $assetclassgroups = $db->db_select($query);
-
- // get objects
- foreach($assetclassgroups AS $assetclassgroup) {
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
-
- if($assetclassgroup['assetclassgroup_id']==$assetclass[0]['assetclassgroup_id']) {
- $tp->set("assetclassgroup_selected", "selected");
- } else {
- $tp->set("assetclassgroup_selected", "");
- }
-
- // parse block
- $tp->parse("assetclassgroup_row");
- }
-
- // parse block
- $tp->parse("assetclassgroup_table");
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclass_id = sanitize($_GET['assetclass_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclass
+ // build query
+ $query = "SELECT
+ assetclass.assetclass_id AS assetclass_id,
+ assetclass.assetclass_name AS assetclass_name,
+ assetclass.assetclassgroup_id AS assetclassgroup_id
+ FROM
+ assetclass
+ WHERE
+ assetclass.assetclass_id=" . $assetclass_id;
+
+ // run query
+ $assetclass = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']);
+ $smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']);
+ $smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
+
+ // setup assetclassgroup
+ // build query
+ $smarty->assign("assetclassgroup_options", $db->options_assetclassgroup());
+
+ // end page
+ // output
+ $smarty->display("assetclassedit.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassgroup.php b/assetclassgroup.php
index e0f35aa..b1babb3 100644
--- a/assetclassgroup.php
+++ b/assetclassgroup.php
@@ -1,84 +1,54 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassgroup.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
- FROM
- assetclassgroup
- ORDER BY
- assetclassgroup.assetclassgroup_name";
-
- // run query
- $assetclassgroups = $db->db_select($query);
-
- // count results
- $assetclassgroup_counter = count($assetclassgroups);
-
- // counter to tpl
- $tp->set("assetclassgroup_counter", $assetclassgroup_counter);
-
- // any assetclassgroups?
- if ($assetclassgroup_counter>0) {
- // get objects
- foreach($assetclassgroups AS $assetclassgroup) {
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
-
- $tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
-
- // parse row
- $tp->parse("assetclassgroup_row");
- }
-
- // parse block
- $tp->parse("assetclassgroup_table");
- } else {
- // hide block
- $tp->hide("assetclassgroup_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclassgroup
+ // build query
+ $query = "SELECT
+ assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
+ assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
+ assetclassgroup.assetclassgroup_color AS assetclassgroup_color
+ FROM
+ assetclassgroup
+ ORDER BY
+ assetclassgroup.assetclassgroup_name";
+
+ // run query
+ $assetclassgroups = $db->db_select($query);
+ $smarty->assign("assetclassgroups", $assetclassgroups);
+
+ // end page
+ // output
+ $smarty->display("assetclassgroup.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassgroupadd.php b/assetclassgroupadd.php
index b2fdb2a..13e5a51 100644
--- a/assetclassgroupadd.php
+++ b/assetclassgroupadd.php
@@ -1,43 +1,39 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassgroupadd.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // end page
+ // output
+ $smarty->display("assetclassgroupadd.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassgroupdel.php b/assetclassgroupdel.php
index 961a008..3232eba 100644
--- a/assetclassgroupdel.php
+++ b/assetclassgroupdel.php
@@ -1,63 +1,59 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassgroupdel.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name
- FROM
- assetclassgroup
- WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
-
- // run query
- $assetclassgroup = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclassgroup
+ // build query
+ $query = "SELECT
+ assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
+ assetclassgroup.assetclassgroup_name AS assetclassgroup_name
+ FROM
+ assetclassgroup
+ WHERE
+ assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+
+ // run query
+ $assetclassgroup = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
+ $smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
+
+ // end page
+ // output
+ $smarty->display("assetclassgroupdel.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassgroupedit.php b/assetclassgroupedit.php
index 0307fc2..27557ee 100644
--- a/assetclassgroupedit.php
+++ b/assetclassgroupedit.php
@@ -1,65 +1,62 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassgroupedit.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
- assetclassgroup.assetclassgroup_color AS assetclassgroup_color
- FROM
- assetclassgroup
- WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
-
- // run query
- $assetclassgroup = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
- $tp->set("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
+
+ // start output
+ $smarty->assign("scripts", 'jscolor.js');
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclassgroup
+ // build query
+ $query = "SELECT
+ assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
+ assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
+ assetclassgroup.assetclassgroup_color AS assetclassgroup_color
+ FROM
+ assetclassgroup
+ WHERE
+ assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+
+ // run query
+ $assetclassgroup = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
+ $smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
+ $smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
+
+ // end page
+ // output
+ $smarty->display("assetclassgroupedit.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassgroupview.php b/assetclassgroupview.php
index e836406..6820e07 100644
--- a/assetclassgroupview.php
+++ b/assetclassgroupview.php
@@ -1,105 +1,77 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassgroupview.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup assetclassgroup
- // build query
- $query = "SELECT
- assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
- assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
- assetclassgroup.assetclassgroup_color AS assetclassgroup_color
- FROM
- assetclassgroup
- WHERE
- assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
-
- // run query
- $assetclassgroup = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
- $tp->set("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
-
- // setup assetclass
- // build query
- $query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- assetclass
- WHERE
- assetclass.assetclassgroup_id=" . $assetclassgroup_id . "
- ORDER BY
- assetclass.assetclass_name";
-
- // run query
- $assetclasses = $db->db_select($query);
-
- // count results
- $assetclass_counter = count($assetclasses);
-
- // counter to tpl
- $tp->set("assetclass_counter", $assetclass_counter);
-
- // any assets?
- if ($assetclass_counter>0) {
- // get objects
- foreach($assetclasses AS $assetclass) {
- // send to tpl
- $tp->set("assetclass_id", $assetclass['assetclass_id']);
- $tp->set("assetclass_name", $assetclass['assetclass_name']);
-
- // parse row
- $tp->parse("assetclass_row");
- }
-
- // parse block
- $tp->parse("assetclass_table");
- } else {
- // hide block
- $tp->hide("assetclass_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclassgroup
+ // build query
+ $query = "SELECT
+ assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
+ assetclassgroup.assetclassgroup_name AS assetclassgroup_name,
+ assetclassgroup.assetclassgroup_color AS assetclassgroup_color
+ FROM
+ assetclassgroup
+ WHERE
+ assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
+
+ // run query
+ $assetclassgroup = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
+ $smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
+ $smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
+
+ // setup assetclass
+ // build query
+ $query = "SELECT
+ assetclass.assetclass_id AS assetclass_id,
+ assetclass.assetclass_name AS assetclass_name
+ FROM
+ assetclass
+ WHERE
+ assetclass.assetclassgroup_id=" . $assetclassgroup_id . "
+ ORDER BY
+ assetclass.assetclass_name";
+
+ // run query
+ $assetclasses = $db->db_select($query);
+ $smarty->assign("assetclasses", $assetclasses);
+
+ // end page
+ // output
+ $smarty->display("assetclassgroupview.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetclassview.php b/assetclassview.php
index 340e1b4..af3796c 100644
--- a/assetclassview.php
+++ b/assetclassview.php
@@ -1,114 +1,85 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $assetclass_id = sanitize($_GET['assetclass_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetclassview.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // 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
- FROM
- assetclass,
- assetclassgroup
- WHERE
- assetclass.assetclass_id=" . $assetclass_id . "
- AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
-
- // run query
- $assetclass = $db->db_select($query);
-
- // send to tpl
- $tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
- $tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
- $tp->set("assetclass_selected", "");
-
- $tp->set("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
- $tp->set("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
-
- // setup asset
- // build query
- $query = "SELECT
- asset.asset_id AS asset_id,
- asset.asset_name AS asset_name
- FROM
- asset
- WHERE
- asset.assetclass_id='" . $assetclass_id . "'
- ORDER BY
- asset.asset_name";
-
- // run query
- $assets = $db->db_select($query);
-
- // count results
- $asset_counter = count($assets);
-
- // counter to tpl
- $tp->set("asset_counter", $asset_counter);
-
- // any assets?
- if ($asset_counter>0) {
- // sort using "natural order"
- // ksort($assets);
-
- // get objects
- foreach($assets AS $asset) {
- // send to tpl
- $tp->set("asset_id", $asset['asset_id']);
- $tp->set("asset_name", $asset['asset_name']);
-
- // parse row
- $tp->parse("asset_row");
- }
-
- // parse block
- $tp->parse("asset_table");
- } else {
- // hide block
- $tp->hide("asset_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // footer
- include("footer.php");
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $assetclass_id = sanitize($_GET['assetclass_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup assetclass
+ // build query
+ $query = "SELECT
+ assetclass.assetclass_id,
+ assetclass.assetclass_name,
+ assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
+ assetclassgroup.assetclassgroup_name AS assetclassgroup_name
+ FROM
+ assetclass,
+ assetclassgroup
+ WHERE
+ assetclass.assetclass_id=" . $assetclass_id . "
+ AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
+
+ // run query
+ $assetclass = $db->db_select($query);
+
+ // send to tpl
+ $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']);
+
+ // send to tpl
+ // setup asset
+ // build query
+ $query = "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";
+
+ // run query
+ $assets = $db->db_select($query);
+ $smarty->assign("assets", $assets);
+
+ // end page
+ // output
+ $smarty->display("assetclassview.tpl");
+
+ // footer
+ include("footer.php");
+?>
diff --git a/assetdel.php b/assetdel.php
index 3847389..0ef868c 100644
--- a/assetdel.php
+++ b/assetdel.php
@@ -1,99 +1,74 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $asset_id = sanitize($_GET['asset_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetdel.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup asset
- // build query
- $query = "SELECT
- asset.asset_name AS asset_name
- FROM
- asset
- WHERE
- asset.asset_id=" . $asset_id;
-
- // run query
- $asset = $db->db_select($query);
-
- // send to tpl
- $tp->set("asset_id", $asset_id);
- $tp->set("asset_name", $asset[0]['asset_name']);
-
- // setup node
- // build query
- $query = "SELECT
- node.node_id AS node_id,
- node.node_ip AS node_ip
- FROM
- node
- WHERE
- node.asset_id=" . $asset_id . "
- ORDER BY
- INET_ATON(node.node_ip)";
-
- // run query
- $nodes = $db->db_select($query);
-
- // count results
- $node_counter = count($nodes);
-
- // any nodes?
- if ($node_counter>0) {
- // get objects
- foreach($nodes AS $node) {
- // set id
- $tp->set("node_id", $node['node_id']);
- $tp->set("node_ip", $node['node_ip']);
-
- // parse row
- $tp->parse("node_row");
- }
-
- // parse block
- $tp->parse("node_table");
- } else {
- // hide block
- $tp->hide("node_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // footer
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $asset_id = sanitize($_GET['asset_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup asset
+ // build query
+ $query = "SELECT
+ asset.asset_name AS asset_name
+ FROM
+ asset
+ WHERE
+ asset.asset_id=" . $asset_id;
+
+ // run query
+ $asset = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("asset_id", $asset_id);
+ $smarty->assign("asset_name", $asset[0]['asset_name']);
+
+ // setup node
+ // build query
+ $query = "SELECT
+ node.node_id AS node_id,
+ node.node_ip AS node_ip
+ FROM
+ node
+ WHERE
+ node.asset_id=" . $asset_id . "
+ ORDER BY
+ INET_ATON(node.node_ip)";
+
+ // run query
+ $nodes = $db->db_select($query);
+ $smarty->assign("nodes", $nodes);
+
+ // end page
+ // output
+ $smarty->display("assetdel.tpl");
+
+ // footer
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetedit.php b/assetedit.php
index aa5a141..d8bc853 100644
--- a/assetedit.php
+++ b/assetedit.php
@@ -1,108 +1,62 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $asset_id = sanitize($_GET['asset_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetedit.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup asset
- // build query
- $query = "SELECT
- asset.asset_name AS asset_name,
- asset.asset_hostname AS asset_hostname,
- asset.asset_info AS asset_info,
- asset.assetclass_id AS assetclass_id
- FROM
- asset
- WHERE
- asset.asset_id=" . $asset_id;
-
- // run query
- $asset = $db->db_select($query);
-
- // send to tpl
- $tp->set("asset_id", $asset_id);
- $tp->set("asset_name", $asset[0]['asset_name']);
- $tp->set("asset_hostname", $asset[0]['asset_hostname']);
- $tp->set("asset_info", $asset[0]['asset_info']);
-
- // setup assetclass
- // build query
- $query = "SELECT
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- assetclass
- ORDER BY
- assetclass.assetclass_name";
-
- // run query
- $assetclasses = $db->db_select($query);
-
- // count results
- $assetclass_counter = count($assetclasses);
-
- // any nodes?
- if ($assetclass_counter>0) {
- // get objects
- foreach($assetclasses AS $assetclass) {
- // send to tpl
- $tp->set("assetclass_id", $assetclass['assetclass_id']);
- $tp->set("assetclass_name", $assetclass['assetclass_name']);
-
- // set select box
- if($assetclass['assetclass_id']==$asset[0]['assetclass_id']) {
- $tp->set("assetclass_selected", "selected");
- } else {
- $tp->set("assetclass_selected", "");
- }
-
- // parse block
- $tp->parse("assetclass_row");
- }
- // parse block
- $tp->parse("assetclass_table");
- } else {
- // parse block
- $tp->hide("assetclass_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // footer
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $asset_id = sanitize($_GET['asset_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // 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
+ FROM
+ asset
+ WHERE
+ asset.asset_id=" . $asset_id;
+
+ // run query
+ $asset = $db->db_select($query);
+ $smarty->assign("asset", $asset[0]);
+
+ // setup assetclass
+ $smarty->assign("assetclass_options", $db->options_assetclass());
+
+ // end page
+ // output
+ $smarty->display("assetedit.tpl");
+
+ // footer
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assetview.php b/assetview.php
index 5cf7d50..adf1bb4 100644
--- a/assetview.php
+++ b/assetview.php
@@ -1,113 +1,86 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $asset_id = sanitize($_GET['asset_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assetview.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup asset
- // build query
- $query = "SELECT
- asset.asset_name AS asset_name,
- asset.asset_hostname AS asset_hostname,
- asset.asset_info AS asset_info,
- assetclass.assetclass_id AS assetclass_id,
- assetclass.assetclass_name AS assetclass_name
- FROM
- asset,
- assetclass
- WHERE
- asset.asset_id=" . $asset_id . "
- AND assetclass.assetclass_id=asset.assetclass_id";
-
- // run query
- $asset = $db->db_select($query);
-
- // send to tpl
- $tp->set("asset_id", $asset_id);
- $tp->set("asset_name", $asset[0]['asset_name']);
- $tp->set("asset_hostname", $asset[0]['asset_hostname']);
- $tp->set("asset_info", nl2br($asset[0]['asset_info']));
-
- $tp->set("assetclass_id", $asset[0]['assetclass_id']);
- $tp->set("assetclass_name", $asset[0]['assetclass_name']);
-
- // setup node
- // build query
- $query = "SELECT
- node.node_id AS node_id,
- node.node_ip AS node_ip
- FROM
- node
- WHERE
- node.asset_id=" . $asset_id . "
- ORDER BY
- INET_ATON(node.node_ip)";
-
- // run query
- $nodes = $db->db_select($query);
-
- // count results
- $node_counter = count($nodes);
-
- // counter to tpl
- $tp->set("node_counter", $node_counter);
-
- // any nodes?
- if ($node_counter>0) {
- // get objects
- foreach($nodes AS $node) {
- // send to tpl
- $tp->set("node_id", $node['node_id']);
- $tp->set("node_ip", $node['node_ip']);
-
- // parse row
- $tp->parse("node_row");
- }
-
- // parse block
- $tp->parse("node_table");
- } else {
- // hide block
- $tp->hide("node_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // footer
- include("footer.php");
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $asset_id = sanitize($_GET['asset_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // 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
+ FROM
+ asset,
+ assetclass
+ WHERE
+ asset.asset_id=" . $asset_id . "
+ AND assetclass.assetclass_id=asset.assetclass_id";
+
+ // run query
+ $asset = $db->db_select($query);
+
+ // send to tpl
+ $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']);
+
+ // setup node
+ // build query
+ $query = "SELECT
+ node_id,
+ node_ip,
+ LEFT(node_info, 40) as node_info
+ FROM
+ node
+ WHERE
+ node.asset_id=" . $asset_id . "
+ ORDER BY
+ INET_ATON(node.node_ip)";
+
+ // run query
+ $nodes = $db->db_select($query);
+ $smarty->assign("nodes", $nodes);
+
+ // end page
+ // output
+ $smarty->display("assetview.tpl");
+
+ // footer
+ include("footer.php");
+?>
diff --git a/assigniptonode.php b/assigniptonode.php
index 1230e5b..0ae77c7 100644
--- a/assigniptonode.php
+++ b/assigniptonode.php
@@ -1,65 +1,61 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get ip and id
- $node_ip = sanitize($_GET['node_ip']);
- $subnet_id = sanitize($_GET['subnet_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assigniptonode.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // build query
- $query = "SELECT
- subnet.subnet_address AS subnet_address,
- subnet.subnet_mask AS subnet_mask
- FROM
- subnet
- WHERE
- subnet.subnet_id=" . $subnet_id;
-
- // run query
- $subnet = $db->db_select($query);
-
- // send to tpl
- $tp->set("subnet_id", $subnet_id);
- $tp->set("subnet_address", $subnet[0]['subnet_address']);
- $tp->set("subnet_mask", $subnet[0]['subnet_mask']);
- $tp->set("node_ip", $node_ip);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get ip and id
+ $node_ip = sanitize($_GET['node_ip']);
+ $subnet_id = sanitize($_GET['subnet_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // build query
+ $query = "SELECT
+ subnet.subnet_address AS subnet_address,
+ subnet.subnet_mask AS subnet_mask
+ FROM
+ subnet
+ WHERE
+ subnet.subnet_id=" . $subnet_id;
+
+ // run query
+ $subnet = $db->db_select($query);
+
+ // send to tpl
+ $smarty->assign("subnet_id", $subnet_id);
+ $smarty->assign("subnet_address", $subnet[0]['subnet_address']);
+ $smarty->assign("subnet_mask", $subnet[0]['subnet_mask']);
+ $smarty->assign("node_ip", $node_ip);
+
+ // end page
+ // output
+ $smarty->display("assigniptonode.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/assignnodetoasset.php b/assignnodetoasset.php
index b426fe8..9fed1ef 100644
--- a/assignnodetoasset.php
+++ b/assignnodetoasset.php
@@ -1,133 +1,79 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // get id
- $asset_id = sanitize($_GET['asset_id']);
- $node_ip = sanitize($_GET['node_ip']);
- $subnet_id = sanitize($_GET['subnet_id']);
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/assignnodetoasset.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // to tpl
- $tp->set("node_ip", $node_ip);
-
- // setup asset
- // build query
- $query = "SELECT
- asset.asset_id AS asset_id,
- asset.asset_name AS asset_name
- FROM
- asset
- ORDER BY
- asset.asset_name";
-
- // run query
- $assets = $db->db_select($query);
-
- // count results
- $asset_counter = count($assets);
-
- // any assets?
- if ($asset_counter>0) {
- // get objects
- foreach($assets AS $asset) {
- // send to tpl
- $tp->set("asset_id", $asset['asset_id']);
- $tp->set("asset_name", $asset['asset_name']);
-
- if($asset['asset_id']==$asset_id) {
- $tp->set("asset_selected", "selected");
- } else {
- $tp->set("asset_selected", "");
- }
-
- // parse block
- $tp->parse("asset_row");
- }
- // parse block
- $tp->parse("asset_table");
- } else {
- // parse block
- $tp->hide("asset_table");
- }
-
- // setup subnet
- // build query
- $query = "SELECT
- subnet.subnet_id AS subnet_id,
- subnet.subnet_address AS subnet_address,
- subnet.subnet_mask AS subnet_mask
- FROM
- subnet
- ORDER BY
- INET_ATON(subnet.subnet_address)";
-
- // run query
- $subnets = $db->db_select($query);
-
- // count results
- $subnet_counter = count($subnets);
-
- // any subnets?
- if ($subnet_counter>0) {
- // get objects
- foreach($subnets AS $subnet) {
- // send to tpl
- $tp->set("subnet_id", $subnet['subnet_id']);
- $tp->set("subnet_address", $subnet['subnet_address']);
- $tp->set("subnet_mask", $subnet['subnet_mask']);
-
- if($subnet['subnet_id']==$subnet_id) {
- $tp->set("subnet_selected", "selected");
- } else {
- $tp->set("subnet_selected", "");
- }
-
- // parse block
- $tp->parse("subnet_row");
- }
- // parse block
- $tp->parse("subnet_table");
- } else {
- // parse block
- $tp->hide("subnet_table");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // end output
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // get id
+ $asset_id = sanitize($_GET['asset_id']);
+ $node_ip = sanitize($_GET['node_ip']);
+ $subnet_id = sanitize($_GET['subnet_id']);
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // to tpl
+ $smarty->assign("node_ip", $node_ip);
+
+ // setup asset
+ $smarty->assign("asset_id", $asset_id);
+ // build query
+ $query = "SELECT
+ asset.asset_id AS asset_id,
+ asset.asset_name AS asset_name
+ FROM
+ asset
+ ORDER BY
+ asset.asset_name";
+
+ // run query
+ $assets = $db->db_select($query);
+ foreach ($assets as $asset) {
+ $asset_options[$asset['asset_id']] = $asset['asset_name'];
+ }
+ $smarty->assign("asset_options", $asset_options);
+
+ // setup subnet
+ // build query
+ $query = "SELECT subnet_id,
+ CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name
+ FROM subnet
+ ORDER BY INET_ATON(subnet_address)";
+
+ // run query
+ $subnets = $db->db_select($query);
+ foreach ($subnets as $subnet) {
+ $subnet_options[$subnet['subnet_id']] = $subnet['subnet_name'];
+ }
+ $smarty->assign("subnet_options", $subnet_options);
+
+ // end page
+ // output
+ $smarty->display("assignnodetoasset.tpl");
+
+ // end output
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/comments.php b/comments.php
index 97e523b..a7850c6 100644
--- a/comments.php
+++ b/comments.php
@@ -1,46 +1,42 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/comments.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // get error
- $comments = sanitize($_GET['comments']);
-
- // set veriables
- $tp->set("comments", $lang['lang_comments_' . $comments]);
-
- // output
- $tp->parse();
- $tp->spit();
-
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // get error
+ $comments = sanitize($_GET['comments']);
+
+ // set veriables
+ $smarty->assign("comments", $lang['lang_comments_' . $comments]);
+
+ // output
+ $smarty->display("comments.tpl");
+
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/config.php b/config.php
index 5f23a2f..7108104 100644
--- a/config.php
+++ b/config.php
@@ -1,38 +1,41 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // version
- $config_version = 'v0.5';
-
- // db connection
- $config_mysql_host = 'localhost';
- $config_mysql_username = 'db_user';
- $config_mysql_password = 'db_pass';
- $config_mysql_dbname = 'db_name';
-
- // error reporting
- $config_yapter_error = 15; // see yapter.php for more information
-
- // default values for IP blocks
- $config_color_blocked = 'dcdcdc';
- $config_color_unused = 'ffffff';
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // version
+ $config_version = 'v0.7';
+
+ // db connection
+ $config_mysql_host = 'localhost';
+ $config_mysql_username = 'ipreg';
+ $config_mysql_password = 'changeme!';
+ $config_mysql_dbname = 'ipreg';
+
+ // default values for IP blocks
+ $config_color_blocked = 'dcdcdc';
+ $config_color_unused = 'ffffff';
+ $config_color_dynamic = 'e0e0e0';
+
+ // language
+ $config_lang = array('de', 'en');
+ $config_lang_default = 'en';
+
?>
\ No newline at end of file
diff --git a/dbconnect.php b/dbconnect.php
index 55ccaaa..d03236d 100644
--- a/dbconnect.php
+++ b/dbconnect.php
@@ -1,28 +1,28 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // build connection
- mysql_connect($config_mysql_host,$config_mysql_username,$config_mysql_password);
-
- // select db
- mysql_select_db($config_mysql_dbname);
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // build connection
+ $dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password);
+
+ // select db
+ mysqli_select_db($dblink, $config_mysql_dbname);
+?>
diff --git a/footer.php b/footer.php
index bde3c8e..dc460f3 100644
--- a/footer.php
+++ b/footer.php
@@ -1,34 +1,31 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // set template
- $tp = new Template("tpl/footer.tpl", $config_yapter_error);
-
- // get version for the footer-stamp
- $tp->set("config_version", $config_version);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+
+ // get version for the footer-stamp
+ $smarty->assign("config_version", $config_version);
+
+ // end page
+ // output
+ $smarty->display("footer.tpl");
?>
\ No newline at end of file
diff --git a/header.php b/header.php
index 0bc67a3..2d25135 100644
--- a/header.php
+++ b/header.php
@@ -1,112 +1,69 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // include language file
- include('lang/en.php');
-
- // set template
- $tp = new Template("tpl/header.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // search box
- // new search?
- if (isset($_POST['search'])) {
- // set var
- $search = sanitize($_POST['search']);
-
- // store var
- $_SESSION['search'] = $search;
- } else {
- // check for stored var
- if(isset($_SESSION['search'])) {
- // set var
- $search = $_SESSION['search'];
- } else {
- // empty var
- $search = '';
- }
- }
-
- // to tpl
- // set global template vars
- $tp->set("config_version", $config_version);
- $tp->set("suser_name", $_SESSION['suser_displayname']);
- $tp->set("search", $search);
-
- // menu
- // assets
- if($_SESSION['suser_menu_assets']=='on') {
- $tp->parse("menu_assets");
- } else {
- $tp->hide("menu_assets");
- }
- // assetclasses
- if($_SESSION['suser_menu_assetclasses']=='on') {
- $tp->parse("menu_assetclasses");
- } else {
- $tp->hide("menu_assetclasses");
- }
- // assetclassgroups
- if($_SESSION['suser_menu_assetclassgroups']=='on') {
- $tp->parse("menu_assetclassgroups");
- } else {
- $tp->hide("menu_assetclassgroups");
- }
- // locations
- if($_SESSION['suser_menu_locations']=='on') {
- $tp->parse("menu_locations");
- } else {
- $tp->hide("menu_locations");
- }
- // nodes
- if($_SESSION['suser_menu_nodes']=='on') {
- $tp->parse("menu_nodes");
- } else {
- $tp->hide("menu_nodes");
- }
- // subnets
- if($_SESSION['suser_menu_subnets']=='on') {
- $tp->parse("menu_subnets");
- } else {
- $tp->hide("menu_subnets");
- }
- // users
- if($_SESSION['suser_menu_users']=='on') {
- $tp->parse("menu_users");
- } else {
- $tp->hide("menu_users");
- }
- // vlans
- if($_SESSION['suser_menu_vlans']=='on') {
- $tp->parse("menu_vlans");
- } else {
- $tp->hide("menu_vlans");
- }
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // include language file
+ include('lang/' . $_SESSION['suser_language'] . '.php');
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // search box
+ // new search?
+ if (isset($_POST['search'])) {
+ // set var
+ $search = sanitize($_POST['search']);
+
+ // store var
+ $_SESSION['search'] = $search;
+ } else {
+ // check for stored var
+ if(isset($_SESSION['search'])) {
+ // set var
+ $search = $_SESSION['search'];
+ } else {
+ // empty var
+ $search = '';
+ }
+ }
+
+ // to tpl
+ // set global template vars
+ $smarty->assign("config_version", $config_version);
+ $smarty->assign("suser_name", $_SESSION['suser_displayname']);
+ $smarty->assign("search", $search);
+
+ // menu
+ $smarty->assign("menu_assets", $_SESSION['suser_menu_assets']=='on');
+ $smarty->assign("menu_assetclasses", $_SESSION['suser_menu_assetclasses']=='on');
+ $smarty->assign("menu_assetclassgroups", $_SESSION['suser_menu_assetclassgroups']=='on');
+ $smarty->assign("menu_locations", $_SESSION['suser_menu_locations']=='on');
+ $smarty->assign("menu_nodes", $_SESSION['suser_menu_nodes']=='on');
+ $smarty->assign("menu_subnets", $_SESSION['suser_menu_subnets']=='on');
+ $smarty->assign("menu_users", $_SESSION['suser_menu_users']=='on');
+ $smarty->assign("menu_vlans", $_SESSION['suser_menu_vlans']=='on');
+ $smarty->assign("menu_zones", $_SESSION['suser_menu_zones']=='on');
+
+ // end page
+ // output
+ $smarty->display("header.tpl");
?>
\ No newline at end of file
diff --git a/image.php b/image.php
index e3d3039..163be86 100644
--- a/image.php
+++ b/image.php
@@ -1,106 +1,109 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // icon image
- if(isset($_GET['icon'])) {
- // get desired image
- $icon = sanitize($_GET['icon']);
-
- // switch selected
- switch($icon) {
- case ("add") :
- $png = 'page_add';
- break;
- case ("back") :
- $png = 'control_rewind_blue';
- break;
- case ("cancel") :
- $png = 'control_rewind_blue';
- break;
- case ("comment") :
- $png = 'comment';
- break;
- case ("delete") :
- $png = 'page_delete';
- break;
- case ("edit") :
- $png = 'page_edit';
- break;
- case ("error") :
- $png = 'error';
- break;
- case ("help") :
- $png = 'help';
- break;
- case ("logo") :
- $png = 'logo';
- break;
- case ("next") :
- $png = 'control_fastforward_blue';
- break;
- case ("save") :
- $png = 'page_save';
- break;
- case ("search") :
- $png = 'magnifier';
- break;
- }
-
- // get image
- $image = imagecreatefrompng("images/" . $png . ".png");
-
- // alpha blending
- imagealphablending($image, true);
-
- // save alphablending setting
- imagesavealpha($image, true);
-
- // display image
- header('Content-type: image/png');
- imagepng($image);
- imagedestroy($image);
- }
-
- // colored block
- if(isset($_GET['color'])) {
- // get desired color
- $color = sanitize($_GET['color']);
-
- // create base image
- $image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']);
-
- // build color
- $color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));
-
- // fill image with color
- imagefill($image, 0, 0, $color);
-
- // display image
- header('Content-type: image/png');
- imagepng($image);
- imagedestroy($image);
- }
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // icon image
+ if(isset($_GET['icon'])) {
+ // get desired image
+ $icon = sanitize($_GET['icon']);
+
+ // switch selected
+ switch($icon) {
+ case ("add") :
+ $png = 'page_add';
+ break;
+ case ("back") :
+ $png = 'control_rewind_blue';
+ break;
+ case ("cancel") :
+ $png = 'control_rewind_blue';
+ break;
+ case ("comment") :
+ $png = 'comment';
+ break;
+ case ("delete") :
+ $png = 'page_delete';
+ break;
+ case ("shred") :
+ $png = 'bin';
+ break;
+ case ("edit") :
+ $png = 'page_edit';
+ break;
+ case ("error") :
+ $png = 'error';
+ break;
+ case ("help") :
+ $png = 'help';
+ break;
+ case ("logo") :
+ $png = 'logo';
+ break;
+ case ("next") :
+ $png = 'control_fastforward_blue';
+ break;
+ case ("save") :
+ $png = 'page_save';
+ break;
+ case ("search") :
+ $png = 'magnifier';
+ break;
+ }
+
+ // get image
+ $image = imagecreatefrompng("images/" . $png . ".png");
+
+ // alpha blending
+ imagealphablending($image, true);
+
+ // save alphablending setting
+ imagesavealpha($image, true);
+
+ // display image
+ header('Content-type: image/png');
+ imagepng($image);
+ imagedestroy($image);
+ }
+
+ // colored block
+ if(isset($_GET['color'])) {
+ // get desired color
+ $color = sanitize($_GET['color']);
+
+ // create base image
+ $image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']);
+
+ // build color
+ $color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2)));
+
+ // fill image with color
+ imagefill($image, 0, 0, $color);
+
+ // display image
+ header('Content-type: image/png');
+ imagepng($image);
+ imagedestroy($image);
+ }
?>
\ No newline at end of file
diff --git a/images/bin.png b/images/bin.png
new file mode 100644
index 0000000..375b8bf
Binary files /dev/null and b/images/bin.png differ
diff --git a/images/breadcrumb.gif b/images/breadcrumb.gif
new file mode 100644
index 0000000..03ee6c0
Binary files /dev/null and b/images/breadcrumb.gif differ
diff --git a/images/building.png b/images/building.png
new file mode 100644
index 0000000..11a017c
Binary files /dev/null and b/images/building.png differ
diff --git a/images/building_add.png b/images/building_add.png
new file mode 100644
index 0000000..d88e2b9
Binary files /dev/null and b/images/building_add.png differ
diff --git a/images/building_delete.png b/images/building_delete.png
new file mode 100644
index 0000000..db6455d
Binary files /dev/null and b/images/building_delete.png differ
diff --git a/images/building_edit.png b/images/building_edit.png
new file mode 100644
index 0000000..646db36
Binary files /dev/null and b/images/building_edit.png differ
diff --git a/images/exclamation.png b/images/exclamation.png
new file mode 100644
index 0000000..c37bd06
Binary files /dev/null and b/images/exclamation.png differ
diff --git a/images/link.gif b/images/link.gif
new file mode 100644
index 0000000..f37289a
Binary files /dev/null and b/images/link.gif differ
diff --git a/images/minus.gif b/images/minus.gif
new file mode 100644
index 0000000..cb0d42c
Binary files /dev/null and b/images/minus.gif differ
diff --git a/images/network-ethernet.ico b/images/network-ethernet.ico
new file mode 100644
index 0000000..9fba0e0
Binary files /dev/null and b/images/network-ethernet.ico differ
diff --git a/images/network-ethernet.png b/images/network-ethernet.png
new file mode 100644
index 0000000..24ca737
Binary files /dev/null and b/images/network-ethernet.png differ
diff --git a/images/page.png b/images/page.png
new file mode 100644
index 0000000..03ddd79
Binary files /dev/null and b/images/page.png differ
diff --git a/images/plus.gif b/images/plus.gif
new file mode 100644
index 0000000..ccdc157
Binary files /dev/null and b/images/plus.gif differ
diff --git a/images/report.png b/images/report.png
new file mode 100644
index 0000000..779ad58
Binary files /dev/null and b/images/report.png differ
diff --git a/images/table.png b/images/table.png
new file mode 100644
index 0000000..abcd936
Binary files /dev/null and b/images/table.png differ
diff --git a/images/table_add.png b/images/table_add.png
new file mode 100644
index 0000000..2a3e5c4
Binary files /dev/null and b/images/table_add.png differ
diff --git a/images/table_delete.png b/images/table_delete.png
new file mode 100644
index 0000000..b85916d
Binary files /dev/null and b/images/table_delete.png differ
diff --git a/images/table_edit.png b/images/table_edit.png
new file mode 100644
index 0000000..bfcb024
Binary files /dev/null and b/images/table_edit.png differ
diff --git a/images/table_go.png b/images/table_go.png
new file mode 100644
index 0000000..0528dfa
Binary files /dev/null and b/images/table_go.png differ
diff --git a/images/table_save.png b/images/table_save.png
new file mode 100644
index 0000000..25b74d1
Binary files /dev/null and b/images/table_save.png differ
diff --git a/images/user.png b/images/user.png
new file mode 100644
index 0000000..79f35cc
Binary files /dev/null and b/images/user.png differ
diff --git a/images/user_add.png b/images/user_add.png
new file mode 100644
index 0000000..deae99b
Binary files /dev/null and b/images/user_add.png differ
diff --git a/images/user_delete.png b/images/user_delete.png
new file mode 100644
index 0000000..acbb563
Binary files /dev/null and b/images/user_delete.png differ
diff --git a/images/user_edit.png b/images/user_edit.png
new file mode 100644
index 0000000..c1974cd
Binary files /dev/null and b/images/user_edit.png differ
diff --git a/images/user_female.png b/images/user_female.png
new file mode 100644
index 0000000..7c71de0
Binary files /dev/null and b/images/user_female.png differ
diff --git a/includes.php b/includes.php
index 412a677..856b5e3 100644
--- a/includes.php
+++ b/includes.php
@@ -1,45 +1,50 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // session
- // start session
- session_start();
-
- // check for user_id, if unnkown, redirect to login
- if(empty($_SESSION['suser_id'])) {
- // redirect
- header("Location: login.php");
- exit;
- }
-
- // headers
- // raw http headers
- header("Content-Type: text/html; charset=utf-8");
-
- // includes
- // includes
- include("config.php");
- include("dbconnect.php");
-
- // load lib
- include("lib.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // session
+ // start session
+ session_name('ipreg');
+ session_start();
+
+ // check for user_id, if unnkown, redirect to login
+ if(empty($_SESSION['suser_id'])) {
+ // redirect
+ header("Location: login.php");
+ exit;
+ }
+
+ // headers
+ // raw http headers
+ header("Content-Type: text/html; charset=utf-8");
+
+ // includes
+ // includes
+ include("config.php");
+ include("dbconnect.php");
+
+ // load lib
+ include("lib.php");
+
+ // set language
+ $language = lang_getfrombrowser($config_lang, $config_lang_default, null, false);
+
?>
\ No newline at end of file
diff --git a/index.php b/index.php
index a758ba4..ba3367f 100644
--- a/index.php
+++ b/index.php
@@ -1,108 +1,118 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // start page
- // includes
- include("includes.php");
-
- // start output
- include("header.php");
-
- // set template
- $tp = new Template("tpl/index.tpl", $config_yapter_error);
-
- // set language variables
- $tp->setvars($lang);
-
- // setup asset
- // build query
- $query = "SELECT
- COUNT(asset.asset_id) AS asset_counter
- FROM
- asset";
-
- // run query
- $assets = $db->db_select($query);
-
- // counter to tpl
- $tp->set("asset_counter", $assets[0]['asset_counter']);
-
- // setup location
- // build query
- $query = "SELECT
- COUNT(location.location_id) AS location_counter
- FROM
- location";
-
- // run query
- $locations = $db->db_select($query);
-
- // counter to tpl
- $tp->set("location_counter", $locations[0]['location_counter']);
-
- // setup node
- // build query
- $query = "SELECT
- COUNT(node.node_id) AS node_counter
- FROM
- node";
-
- // run query
- $nodes = $db->db_select($query);
-
- // counter to tpl
- $tp->set("node_counter", $nodes[0]['node_counter']);
-
- // setup subnet
- // build query
- $query = "SELECT
- COUNT(subnet.subnet_id) AS subnet_counter
- FROM
- subnet";
-
- // run query
- $subnets = $db->db_select($query);
-
- // counter to tpl
- $tp->set("subnet_counter", $subnets[0]['subnet_counter']);
-
- // setup vlan
- // build query
- $query = "SELECT
- COUNT(vlan.vlan_id) AS vlan_counter
- FROM
- vlan";
-
- // run query
- $vlans = $db->db_select($query);
-
- // counter to tpl
- $tp->set("vlan_counter", $vlans[0]['vlan_counter']);
-
- // end page
- // output
- $tp->parse();
- $tp->spit();
-
- // footer
- include("footer.php");
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // start page
+ // includes
+ include("includes.php");
+
+ // start output
+ include("header.php");
+
+ // set language variables
+ $smarty->assign($lang);
+
+ // setup asset
+ // build query
+ $query = "SELECT
+ COUNT(asset.asset_id) AS asset_counter
+ FROM
+ asset";
+
+ // run query
+ $assets = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("asset_counter", $assets[0]['asset_counter']);
+
+ // setup location
+ // build query
+ $query = "SELECT
+ COUNT(location.location_id) AS location_counter
+ FROM
+ location";
+
+ // run query
+ $locations = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("location_counter", $locations[0]['location_counter']);
+
+ // setup node
+ // build query
+ $query = "SELECT
+ COUNT(node.node_id) AS node_counter
+ FROM
+ node";
+
+ // run query
+ $nodes = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("node_counter", $nodes[0]['node_counter']);
+
+ // setup subnet
+ // build query
+ $query = "SELECT
+ COUNT(subnet.subnet_id) AS subnet_counter
+ FROM
+ subnet";
+
+ // run query
+ $subnets = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("subnet_counter", $subnets[0]['subnet_counter']);
+
+ // setup vlan
+ // build query
+ $query = "SELECT
+ COUNT(vlan.vlan_id) AS vlan_counter
+ FROM
+ vlan";
+
+ // run query
+ $vlans = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("vlan_counter", $vlans[0]['vlan_counter']);
+
+ // setup zone
+ // build query
+ $query = "SELECT
+ COUNT(zone_id) AS zone_counter
+ FROM
+ zone";
+
+ // run query
+ $zones = $db->db_select($query);
+
+ // counter to tpl
+ $smarty->assign("zone_counter", $zones[0]['zone_counter']);
+
+
+ // end page
+ // output
+ $smarty->display("index.tpl");
+
+ // footer
+ include("footer.php");
?>
\ No newline at end of file
diff --git a/install/install.txt b/install/install.txt
index a684c1f..97022ae 100644
--- a/install/install.txt
+++ b/install/install.txt
@@ -1,16 +1,37 @@
IP Reg Installation
-1. Create database
-Create a database for IP Reg on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
+1. Install requirements
+IP Reg version 0.6 and up depends on smarty template engine.
+In Debian install ist with: "apt-get install smarty3".
+The GHP-GD module is also required: "apt-get install php-gd".
-2. Run import
-Import the mysql.sql file into your database, which will create the tables and some sample data.
+2. Create database
+Create a database for IP Reg on your web server, as well as a MySQL user who
+has all privileges for accessing and modifying it.
-3. Edit config file
+ CREATE DATABASE ipreg;
+
+Create database-user for application with minimum necessary rights.
+
+ CREATE USER 'ipreg'@'localhost' IDENTIFIED BY '********';
+ GRANT SELECT, INSERT, UPDATE, DELETE ON ipreg.* TO 'ipreg'@'localhost';
+
+3. Run import
+Import the mysql.sql file into your database, which will create the tables
+and some sample data.
+
+ mysql ipreg < mysql.sql
+
+4. Edit config file
Open config.php in a text editor and fill in your database details.
-4. Upload files
-Upload all files and directory's (except the install directory) to your webserver.
+5. Upload files
+Upload all files and directory's (except the install directory) to your
+webserver.
+
+6. Check file access rights for security
+Only directory tpl_c should be writeble by webserver
-5. Start using IP Reg
-Start your browser and login to IP Reg with the default username/password: admin/admin
\ No newline at end of file
+7. Start using IP Reg
+Start your browser and login to IP Reg with the default username/password:
+admin/admin
diff --git a/install/mysql.sql b/install/mysql.sql
index a3027dd..d7715d2 100644
--- a/install/mysql.sql
+++ b/install/mysql.sql
@@ -1,143 +1,177 @@
-CREATE TABLE asset (
- asset_id int(10) NOT NULL auto_increment,
- asset_name varchar(100) NOT NULL,
- asset_hostname varchar(100) NOT NULL,
- assetclass_id int(10) NOT NULL,
- asset_info text NOT NULL,
- PRIMARY KEY (asset_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO asset (asset_name, assetclass_id) VALUES
-('My Computer', 1),
-('My Server', 2);
-
-
-CREATE TABLE assetclass (
- assetclass_id int(10) NOT NULL auto_increment,
- assetclassgroup_id int(10) NOT NULL,
- assetclass_name varchar(100) NOT NULL,
- PRIMARY KEY (assetclass_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
-(1, 'PC'),
-(2, 'Server');
-
-
-CREATE TABLE assetclassgroup (
- assetclassgroup_id int(10) NOT NULL auto_increment,
- assetclassgroup_name varchar(100) NOT NULL,
- assetclassgroup_color varchar(6) NOT NULL,
- PRIMARY KEY (assetclassgroup_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
-('Workstations', 000000);
-
-
-CREATE TABLE location (
- location_id int(10) NOT NULL auto_increment,
- location_name varchar(100) NOT NULL,
- location_parent int(1) NOT NULL default 0,
- location_info text NOT NULL,
- PRIMARY KEY (location_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO location (location_name, location_parent) VALUES
-('Main Office', 0);
-
-
-CREATE TABLE nat (
- nat_id int(10) NOT NULL auto_increment,
- nat_type int(1) NOT NULL,
- nat_ext int(10) NOT NULL,
- nat_int int(10) NOT NULL,
- PRIMARY KEY (nat_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-
-CREATE TABLE node (
- node_id int(10) NOT NULL auto_increment,
- node_ip varchar(15) NOT NULL,
- node_mac varchar(12) NOT NULL,
- node_dns1 varchar(100) NOT NULL,
- node_dns2 varchar(100) NOT NULL,
- subnet_id int(10) NOT NULL,
- asset_id int(10) NOT NULL,
- node_info text NOT NULL,
- PRIMARY KEY (node_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
-('192.168.1.2', '001122334455', 1, 1),
-('192.168.1.1', 'aabbccddeeff', 1, 2);
-
-
-CREATE TABLE subnet (
- subnet_id int(10) NOT NULL auto_increment,
- subnet_address varchar(15) NOT NULL,
- subnet_mask int(2) NOT NULL,
- subnet_info text NOT NULL,
- PRIMARY KEY (subnet_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-
-INSERT INTO subnet (subnet_address, subnet_mask) VALUES
-('192.168.0.0', 24);
-
-
-CREATE TABLE subnetlocation (
- subnetlocation_id int(10) NOT NULL auto_increment,
- subnet_id int(10) NOT NULL,
- location_id int(10) NOT NULL,
- PRIMARY KEY (subnetlocation_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO subnetlocation (subnet_id, location_id) VALUES
-(1, 1);
-
-
-CREATE TABLE subnetvlan (
- subnetvlan_id int(10) NOT NULL auto_increment,
- subnet_id int(10) NOT NULL,
- vlan_id int(10) NOT NULL,
- PRIMARY KEY (subnetvlan_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-
-CREATE TABLE user (
- user_id int(10) NOT NULL auto_increment,
- user_name varchar(100) NOT NULL,
- user_pass varchar(32) NOT NULL,
- user_displayname varchar(100) NOT NULL,
- user_imagesize int(3) NOT NULL default 6,
- user_imagecount int(3) NOT NULL default 64,
- user_mac varchar(25) NOT NULL default 'xxxxxxxxxxxx',
- user_dateformat varchar(10) NOT NULL default 'd M Y H:i',
- user_dns1suffix varchar(100) NOT NULL,
- user_dns2suffix varchar(100) NOT NULL,
- user_menu_assets varchar(2) NOT NULL default 'on',
- user_menu_assetclasses varchar(2) NOT NULL default 'on',
- user_menu_assetclassgroups varchar(2) NOT NULL default 'on',
- user_menu_locations varchar(2) NOT NULL default 'on',
- user_menu_nodes varchar(2) NOT NULL default 'on',
- user_menu_subnets varchar(2) NOT NULL default 'on',
- user_menu_users varchar(2) NOT NULL default 'on',
- user_menu_vlans varchar(2) NOT NULL default 'on',
- PRIMARY KEY (user_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO user (user_name, user_pass, user_displayname, user_imagesize, user_imagecount, user_mac, user_dateformat, user_menu_assets, user_menu_assetclasses, user_menu_assetclassgroups, user_menu_locations, user_menu_nodes, user_menu_subnets, user_menu_users, user_menu_vlans) VALUES
-('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator', 6, 64, 'xxxxxxxxxxxx', 'd M Y H:i', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on');
-
-
-CREATE TABLE vlan (
- vlan_id int(10) NOT NULL auto_increment,
- vlan_number int(3) NOT NULL,
- vlan_name varchar(100) NOT NULL,
- vlan_info text NOT NULL,
- PRIMARY KEY (vlan_id)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-
-INSERT INTO vlan (vlan_number, vlan_name) VALUES
-(1, 'DEFAULT_VLAN');
\ No newline at end of file
+CREATE TABLE asset (
+ asset_id int(10) NOT NULL AUTO_INCREMENT,
+ asset_name varchar(100) NOT NULL,
+ asset_hostname varchar(100) DEFAULT NULL,
+ assetclass_id int(10) NOT NULL,
+ asset_info text DEFAULT NULL,
+ PRIMARY KEY (asset_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO asset (asset_name, assetclass_id) VALUES
+('My Computer', 1),
+('My Server', 2);
+
+
+CREATE TABLE assetclass (
+ assetclass_id int(10) NOT NULL AUTO_INCREMENT,
+ assetclassgroup_id int(10) NOT NULL,
+ assetclass_name varchar(100) NOT NULL,
+ PRIMARY KEY (assetclass_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO assetclass (assetclassgroup_id, assetclass_name) VALUES
+(1, 'PC'),
+(2, 'Server');
+
+
+CREATE TABLE assetclassgroup (
+ assetclassgroup_id int(10) NOT NULL AUTO_INCREMENT,
+ assetclassgroup_name varchar(100) NOT NULL,
+ assetclassgroup_color varchar(6) NOT NULL DEFAULT '000000',
+ PRIMARY KEY (assetclassgroup_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO assetclassgroup (assetclassgroup_name, assetclassgroup_color) VALUES
+('Workstations', '000000'),
+('Servers', '0000CC');
+
+
+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,
+ PRIMARY KEY (location_id),
+ KEY location_sort (location_sort)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO location (location_name, location_parent) VALUES
+('Main Office', 0);
+
+
+CREATE TABLE nat (
+ nat_id int(10) NOT NULL AUTO_INCREMENT,
+ nat_type int(1) NOT NULL,
+ nat_ext int(10) NOT NULL,
+ nat_int int(10) NOT NULL,
+ PRIMARY KEY (nat_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE node (
+ node_id int(10) NOT NULL AUTO_INCREMENT,
+ node_ip varchar(45) NOT NULL,
+ node_mac varchar(12) NOT NULL,
+ node_dns1 varchar(100) DEFAULT NULL,
+ node_dns2 varchar(100) DEFAULT NULL,
+ subnet_id int(10) NOT NULL,
+ asset_id int(10) NOT NULL,
+ zone_id int(10) DEFAULT NULL,
+ node_info text DEFAULT NULL,
+ node_type enum('v4','v6') NOT NULL DEFAULT 'v4',
+ PRIMARY KEY (node_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO node (node_ip, node_mac, subnet_id, asset_id) VALUES
+('192.168.1.2', '001122334455', 1, 1),
+('192.168.1.1', 'aabbccddeeff', 1, 2);
+
+
+CREATE TABLE subnet (
+ subnet_id int(10) NOT NULL AUTO_INCREMENT,
+ subnet_address varchar(45) NOT NULL,
+ subnet_mask int(2) NOT NULL,
+ subnet_dhcp_start varchar(15) DEFAULT NULL,
+ subnet_dhcp_end varchar(15) DEFAULT NULL,
+ subnet_info text DEFAULT NULL,
+ protocol_version tinyint(1) NOT NULL DEFAULT 4,
+ ntp_server varchar(45) DEFAULT NULL,
+ PRIMARY KEY (subnet_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO subnet (subnet_address, subnet_mask) VALUES
+('192.168.0.0', 24);
+
+
+CREATE TABLE subnetlocation (
+ subnetlocation_id int(10) NOT NULL AUTO_INCREMENT,
+ subnet_id int(10) NOT NULL,
+ location_id int(10) NOT NULL,
+ PRIMARY KEY (subnetlocation_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE subnetvlan (
+ subnetvlan_id int(10) NOT NULL AUTO_INCREMENT,
+ subnet_id int(10) NOT NULL,
+ vlan_id int(10) NOT NULL,
+ PRIMARY KEY (subnetvlan_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO subnetvlan (subnet_id, vlan_id) VALUES
+(1, 1);
+
+
+CREATE TABLE user (
+ user_id int(10) NOT NULL AUTO_INCREMENT,
+ user_name varchar(100) NOT NULL,
+ user_pass varchar(32) NOT NULL,
+ user_displayname varchar(100) NOT NULL,
+ user_language char(2) NOT NULL DEFAULT 'en',
+ user_imagesize int(3) NOT NULL DEFAULT 6,
+ user_imagecount int(3) NOT NULL DEFAULT 64,
+ user_mac varchar(25) NOT NULL DEFAULT 'xx:xx:xx:xx:xx:xx',
+ user_dateformat varchar(10) NOT NULL DEFAULT 'd M Y H:i',
+ user_dns1suffix varchar(100) DEFAULT NULL,
+ user_dns2suffix varchar(100) DEFAULT NULL,
+ user_menu_assets varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_assetclasses varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_assetclassgroups varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_locations varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_nodes varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_subnets varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_users varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_vlans varchar(2) NOT NULL DEFAULT 'on',
+ user_menu_zones varchar(2) NOT NULL DEFAULT 'on',
+ user_tooltips varchar(2) NOT NULL DEFAULT 'on',
+ PRIMARY KEY (user_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO user (user_name, user_pass, user_displayname, user_imagesize, user_imagecount, user_mac, user_dateformat, user_menu_assets, user_menu_assetclasses, user_menu_assetclassgroups, user_menu_locations, user_menu_nodes, user_menu_subnets, user_menu_users, user_menu_vlans) VALUES
+('admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator', 6, 64, 'xxxxxxxxxxxx', 'd M Y H:i', 'on', 'on', 'on', 'on', 'on', 'on', 'on', 'on');
+
+
+CREATE TABLE vlan (
+ vlan_id int(10) NOT NULL AUTO_INCREMENT,
+ vlan_number int(3) NOT NULL,
+ vlan_name varchar(100) NOT NULL,
+ vlan_info text DEFAULT NULL,
+ PRIMARY KEY (vlan_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO vlan (vlan_number, vlan_name) VALUES
+(1, 'DEFAULT_VLAN');
+
+
+CREATE TABLE zone (
+ zone_id int(10) NOT NULL AUTO_INCREMENT,
+ zone_soa varchar(40) CHARACTER SET utf8 NOT NULL,
+ zone_hostmaster varchar(40) CHARACTER SET utf8 NOT NULL,
+ zone_origin varchar(40) CHARACTER SET utf8 NOT NULL,
+ zone_ttl_default varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '3D',
+ zone_refresh varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '8H',
+ zone_retry varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '2H',
+ zone_expire varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '4W',
+ zone_ttl varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '1D',
+ zone_serial int(10) unsigned NOT NULL,
+ zone_ns1 varchar(20) CHARACTER SET utf8 NOT NULL,
+ zone_ns2 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
+ zone_ns3 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
+ zone_mx1 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
+ zone_mx2 varchar(20) CHARACTER SET utf8 DEFAULT NULL,
+ zone_info text CHARACTER SET utf8 DEFAULT NULL,
+ PRIMARY KEY (zone_id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO zone (zone_soa, zone_origin, zone_hostmaster, zone_serial, zone_ns1) VALUES
+('ns1.example.com.', 'example.com.', 'hostmaster@example.com', '2023021301', 'ns1.example.com');
diff --git a/lang/de.php b/lang/de.php
new file mode 100644
index 0000000..c961b50
--- /dev/null
+++ b/lang/de.php
@@ -0,0 +1,222 @@
+ 'IP Reg',
+
+ 'lang_asset' => 'Objekt',
+ 'lang_assets' => 'Objekte',
+ 'lang_assetclass' => 'Objektklasse',
+ 'lang_assetclasses' => 'Objektklassen',
+ 'lang_assetclassgroup' => 'Objektklassengruppe',
+ 'lang_assetclassgroups' => 'Objektklassengruppen',
+ 'lang_location' => 'Standort',
+ 'lang_locations' => 'Standorte',
+ 'lang_menu' => 'Menü',
+ 'lang_node' => 'Knoten',
+ 'lang_nodes' => 'Knoten',
+ 'lang_user' => 'Benutzer',
+ 'lang_users' => 'Benutzer',
+ 'lang_zone' => 'Zone',
+ 'lang_zones' => 'Zonen',
+ 'lang_sublocation' => 'Unterstandort',
+ 'lang_sublocations' => 'Unterstandorte',
+ 'lang_subnet' => 'Subnetz',
+ 'lang_subnets' => 'Subnetze',
+ 'lang_tooltips' => 'Tooltips',
+ 'lang_vlan' => 'VLAN',
+ 'lang_vlans' => 'VLANs',
+
+ 'lang_about' => 'Ãœber',
+ 'lang_all' => 'Allw',
+ 'lang_cancel' => 'Abbruch',
+ 'lang_color' => 'Farbe',
+ 'lang_error' => 'Fehler',
+ 'lang_item' => 'Gegenstand',
+ 'lang_language' => 'Sprache',
+ 'lang_login' => 'Anmelden',
+ 'lang_logout' => 'Abmelden',
+ 'lang_options' => 'Optionen',
+ 'lang_option_none' => '(kein)',
+ 'lang_reset' => 'Zurücksetzen',
+ 'lang_search' => 'Suche',
+ 'lang_statistics' => 'Statistik',
+ 'lang_subitem' => 'Sub-Item',
+ 'lang_submit' => 'Absenden',
+ 'lang_unassigned' => 'Nicht zugeordnet',
+ 'lang_warning' => 'Warnung',
+
+ 'lang_asset_add' => 'Objekt hinzufügen',
+ 'lang_asset_del' => 'Objekt löschen',
+ 'lang_asset_edit' => 'Objekt ändern',
+ 'lang_asset_info' => 'Objektinfo',
+ 'lang_asset_name' => 'Objektname',
+ 'lang_asset_hostname' => 'Hostname',
+ 'lang_asset_none' => 'Es sind keine Objekte vorhanden',
+
+ 'lang_assetclass_add' => 'Objektklasse hinzufügen',
+ 'lang_assetclass_del' => 'Objektklasse löschen',
+ 'lang_assetclass_edit' => 'Objektklasse ändern',
+ 'lang_assetclass_name' => 'Objektklassenname',
+ 'lang_assetclass_none' => 'Es sind keine Objektklassen vorhanden',
+
+ 'lang_assetclassgroup_add' => 'Objektklassengruppe hinzufügen',
+ 'lang_assetclassgroup_del' => 'Objektklassengruppe löschen',
+ 'lang_assetclassgroup_edit' => 'Objektklassengruppe ändern',
+ 'lang_assetclassgroup_name' => 'Objektklassengruppenname',
+ 'lang_assetclassgroup_none' => 'Es sind keine Objektklassengruppen vorhanden',
+
+ 'lang_assignnodetoasset' => 'Knoten zu Objekt hinzufügen',
+ 'lang_assignnodetoasset_existing' => 'Knoten zu existierendem Objekt hinzufügen',
+ 'lang_assignnodetoasset_new' => 'Knoten zu neuem Objekt hinzufügen',
+ 'lang_assigniptonode' => 'IP zu Knoten hinzufügen',
+ 'lang_assigniptonode_existing' => 'IP zu existierendem Knoten hinzufügen',
+ 'lang_assigniptonode_new' => 'IP zu neuem Knoten hinzufügen',
+ 'lang_assignlocationtosubnet' => 'Standort zu Subnetz hinzufügen',
+ 'lang_assignlocationtosubnet_existing' => 'Assign location to existing subnet',
+ 'lang_assignlocationtosubnet_new' => 'Assign location to new subnet',
+ 'lang_assignsubnettovlan' => 'Assign subnet to VLAN',
+ 'lang_assignsubnettovlan_existing' => 'Assign subnet to existing VLAN',
+ 'lang_assignsubnettovlan_new' => 'Assign subnet to new VLAN',
+ 'lang_assignvlantosubnet' => 'Assign VLAN to subnet',
+ 'lang_assignvlantosubnet_existing' => 'Assign VLAN to existing subnet',
+ 'lang_assignvlantosubnet_new' => 'Assign VLAN to new subnet',
+
+ 'lang_location_add' => 'Standort hinzufügen',
+ 'lang_location_del' => 'Standort löschen',
+ 'lang_location_edit' => 'Standort ändern',
+ 'lang_location_info' => 'Standortinfo',
+ 'lang_location_name' => 'Standortname',
+ 'lang_location_parent' => 'Ãœbergeordneter Standort',
+ 'lang_sublocation_add' => 'Unterstandort hinzufügen',
+
+ 'lang_locationsubnet' => 'Standort/Subnetz',
+ 'lang_locationsubnet_edit' => 'Standort/Subnetz bearbeiten',
+
+ 'lang_node_add' => 'Knoten hinzufügen',
+ 'lang_node_del' => 'Knoten löschen',
+ 'lang_node_edit' => 'Knoten ändern',
+ 'lang_node_info' => 'Knoteninfo',
+ 'lang_dns1' => 'DNS-Name',
+ 'lang_dns2' => 'DNS-Alias',
+ 'lang_ip' => 'IP-Adresse',
+ 'lang_mac' => 'MAC-Adresse',
+ 'lang_proto_vers' => 'Protokollversion',
+
+ 'lang_nat' => 'NAT',
+ 'lang_nat_add' => 'NAT hinzufügen',
+ 'lang_nat_del' => 'NAT löschen',
+ 'lang_nat_edit' => 'NAT ändern',
+ 'lang_nat_rules' => 'NAT Regeln',
+ 'lang_nat_type' => 'Typ',
+ 'lang_nat_type_1' => 'Verbergen',
+ 'lang_nat_type_2' => 'Statisch',
+ 'lang_nat_type_3' => 'Dynamisch',
+
+ 'lang_search_results_found' => 'Anzahl der gefundenen Ergebnisse: ',
+
+ 'lang_subnet_add' => 'Subnetz hinzufügen',
+ 'lang_subnet_subnetaddress' => 'Subnetzadresse',
+ 'lang_subnet_subnetaddress_mask' => 'Subnetzadresse/Maske',
+ 'lang_subnet_broadcastaddress' => 'Broadcastadresse',
+ 'lang_subnet_nodesinsubnet' => 'Nodes im Subnetz',
+ 'lang_subnet_subnetused' => 'Subnetz benutzt',
+ 'lang_subnet_del' => 'Subnetz löschen',
+ 'lang_subnet_edit' => 'Subnetz ändern',
+ 'lang_subnet_info' => 'Subnetzinfo',
+ 'lang_subnet_mask' => 'Subnetzmaske',
+ 'lang_subnet_dhcp' => 'DHCP ausschließen',
+ 'lang_subnet_dhcpstart' => 'DHCP Anfang',
+ 'lang_subnet_dhcpend' => 'DHCP Ende',
+ 'lang_subnet_ntp_server' => 'NTP-Server',
+
+ 'lang_subnetlocation' => 'Subnetz/Ort',
+ 'lang_subnetlocation_edit' => 'Subnetz/Ort bearbeiten',
+ 'lang_subnetvlan' => 'Subnetz/VLAN',
+ 'lang_subnetvlan_edit' => 'Subnetz/VLAN bearbeiten',
+
+ 'lang_user_add' => 'Benutzer hinzufügen',
+ 'lang_user_del' => 'Benutzer löschen',
+ 'lang_user_displayname' => 'Anzeigename',
+ 'lang_user_edit' => 'Benutzer bearbeiten',
+ 'lang_user_name' => 'Benutzername',
+ 'lang_user_password' => 'Kennwort',
+ 'lang_user_language' => 'Sprache',
+
+ 'lang_zone_add' => 'Zone hinzufügen',
+ 'lang_zone_del' => 'Zone löschen',
+ 'lang_zone_edit' => 'Zone bearbeiten',
+
+
+ 'lang_vlan_add' => 'VLAN hinzufügen',
+ 'lang_vlan_del' => 'VLAN löschen',
+ 'lang_vlan_edit' => 'VLAN ändern',
+ 'lang_vlan_number' => 'VLAN ID',
+ 'lang_vlan_info' => 'VLAN Info',
+ 'lang_vlan_new' => 'VLAN Info',
+ 'lang_vlan_name' => 'VLAN Name',
+
+ 'lang_vlansubnet' => 'VLAN/Subnetz',
+ 'lang_vlansubnet_edit' => 'VLAN/Subnetz bearbeiten',
+
+ 'lang_comments' => 'Kommentare',
+ 'lang_comments_error' => 'Fehler',
+ 'lang_comments_asset_del_nodes' => 'Diese Knoten werden ebenfalls gelöscht!',
+ 'lang_comments_ipinuse' => 'IP wird bereits verwendet',
+ 'lang_comments_notallowed' => 'Nicht erlaubt',
+ 'lang_comments_search_nosearch' => 'Es gibt nichts zu suchen!',
+ 'lang_comments_usernameinuse' => 'Benutzername wird bereits verwendet',
+ 'lang_comments_invalidpass' => 'Das Kennwort ist falsch',
+ 'lang_comments_invalidnewpass' => 'Das neue Kennwort wurde nicht korrekt eingegeben',
+
+ 'lang_options_ipreg' => 'IP Reg Optionen',
+ 'lang_options_display' => 'Anzeigeeinstellungen',
+ 'lang_options_password' => 'Kennwort ändern',
+ 'lang_options_imagesize' => 'Bildgröße',
+ 'lang_options_imagesize_help' => 'Größe (in Pixel) der farbigen Quadrate in der Subnetzanzeige',
+ 'lang_options_imagecount' => 'Bildanzahl',
+ 'lang_options_imagecount_help' => 'Anzahl der farbigen Quadrate je Zeile in der Subnetzanzeige',
+ 'lang_options_mac' => 'MAC-Adresse',
+ 'lang_options_mac_help' => 'Format in der eine MAC-Adresse dargestellt wird (z.B. xx-xx-xx-xx-xx-xx)',
+ 'lang_options_menu_help' => 'Select items to be displayed in menu',
+ 'lang_options_dateformat' => 'Datumsformat',
+ 'lang_options_dateformat_help' => 'Format in which dates are displayed using the php-date-format (see http://www.php.net/date for more info)',
+ 'lang_options_dns1suffix' => 'DNS Name suffix',
+ 'lang_options_dns1suffix_help' => 'Default DNS Name suffix für neue Knoten',
+ 'lang_options_dns2suffix' => 'DNS Alias suffix',
+ 'lang_options_dns2suffix_help' => 'Default DNS Alias suffix für neue Knoten',
+ 'lang_options_currentpassword' => 'Aktuelles Kennwort',
+ 'lang_options_currentpassword_help' => 'Bitte geben Sie hier Ihr bisheriges Kennwort ein',
+ 'lang_options_newpassword1' => 'Neues Kennwort',
+ 'lang_options_newpassword1_help' => 'Bitte geben Sie hier Ihr neues Kennwort ein',
+ 'lang_options_newpassword2' => 'Neues Kennwort (Wiederholung)',
+ 'lang_options_newpassword2_help' => 'Bitte geben Sie hier nochmals Ihr neues Kennwort ein',
+ 'lang_options_tooltips_help' => 'Tooltips anzeigen',
+ 'lang_options_language_help' => 'Sprache für diesen Benutzer',
+
+ 'lang_about_sfprojectpage' => 'Sourceforge Project Page',
+ 'lang_about_license' => 'Lizenz',
+ 'lang_about_gpl' => 'GNU General Public License (GPL)',
+ 'lang_about_smarty' => 'Smarty Template Engine',
+ 'lang_about_iconset' => 'Silk icon set 1.3',
+ 'lang_about_ipreg_ext' => 'IP Reg, a PHP/MySQL IPAM tool',
+ 'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) Copyright (C) 2011-2023 Thomas Hooge
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/.',
+
+ 'lang_about_changelog' => 'Changelog (major changes only)',
+ 'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
+ 'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
+ 'lang_about_changelog_v06' => 'v0.6 (may 2011)',
+ 'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine - language support finalized - added german language - some small bug fixes',
+ 'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
+ 'lang_about_changelog_v05_ext' => '- Complete code rewrite - Input sanitation - Background image - Added multiple counters - HTML is now 100% W3C valid More user options',
+ 'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
+ 'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed - PHP-generated images in subnet overview',
+ 'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
+ 'lang_about_changelog_v03_ext' => '- Class A subnet support - Multi-language support - User defined options - All configuration options in one file (config.php)',
+ 'lang_about_changelog_v02' => 'v0.2 (dec 2007)',
+ 'lang_about_changelog_v02_ext' => '- Fixed ordering of IP addresses - Fixed info fields',
+ 'lang_about_changelog_v01' => 'v0.1 (dec 2007)',
+ 'lang_about_changelog_v01_ext' => '- First beta release',
+
+);
+
+?>
diff --git a/lang/en.php b/lang/en.php
index b1c8d9f..0c69ecc 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -1,196 +1,221 @@
- 'IP Reg',
-
- 'lang_asset' => 'Asset',
- 'lang_assets' => 'Assets',
- 'lang_assetclass' => 'Assetclass',
- 'lang_assetclasses' => 'Assetclasses',
- 'lang_assetclassgroup' => 'Assetclassgroup',
- 'lang_assetclassgroups' => 'Assetclassgroups',
- 'lang_location' => 'Location',
- 'lang_locations' => 'Locations',
- 'lang_menu' => 'Menu',
- 'lang_node' => 'Node',
- 'lang_nodes' => 'Nodes',
- 'lang_user' => 'User',
- 'lang_users' => 'Users',
- 'lang_sublocation' => 'Sub-location',
- 'lang_sublocations' => 'Sub-locations',
- 'lang_subnet' => 'Subnet',
- 'lang_subnets' => 'Subnets',
- 'lang_vlan' => 'VLAN',
- 'lang_vlans' => 'VLANs',
-
- 'lang_about' => 'About',
- 'lang_all' => 'All',
- 'lang_cancel' => 'Cancel',
- 'lang_color' => 'Color',
- 'lang_error' => 'Error',
- 'lang_item' => 'Item',
- 'lang_language' => 'Language',
- 'lang_login' => 'Login',
- 'lang_logout' => 'Logout',
- 'lang_options' => 'Options',
- 'lang_reset' => 'Reset',
- 'lang_search' => 'Search',
- 'lang_statistics' => 'Statistics',
- 'lang_subitem' => 'Sub-Item',
- 'lang_submit' => 'Submit',
- 'lang_unassigned' => 'Unassigned',
- 'lang_warning' => 'Warning',
-
- 'lang_asset_add' => 'Add asset',
- 'lang_asset_del' => 'Delete asset',
- 'lang_asset_edit' => 'Modify asset',
- 'lang_asset_info' => 'Asset info',
- 'lang_asset_name' => 'Asset name',
- 'lang_asset_hostname' => 'Hostname',
-
- 'lang_assetclass_add' => 'Add assetclass',
- 'lang_assetclass_del' => 'Delete assetclass',
- 'lang_assetclass_edit' => 'Mofidy assetclass',
- 'lang_assetclass_name' => 'Assetclass name',
-
- 'lang_assetclassgroup_add' => 'Add assetclassgroup',
- 'lang_assetclassgroup_del' => 'Delete assetclassgroup',
- 'lang_assetclassgroup_edit' => 'Modify assetclassgroup',
- 'lang_assetclassgroup_name' => 'Assetclass Groupname',
-
- 'lang_assignnodetoasset' => 'Assign node to asset',
- 'lang_assignnodetoasset_existing' => 'Assign node to existing asset',
- 'lang_assignnodetoasset_new' => 'Assign node to new asset',
- 'lang_assigniptonode' => 'Assign IP to node',
- 'lang_assigniptonode_existing' => 'Assign IP to existing node',
- 'lang_assigniptonode_new' => 'Assign IP to new node',
- 'lang_assignlocationtosubnet' => 'Assign location to subnet',
- 'lang_assignlocationtosubnet_existing' => 'Assign location to existing subnet',
- 'lang_assignlocationtosubnet_new' => 'Assign location to new subnet',
- 'lang_assignsubnettovlan' => 'Assign subnet to VLAN',
- 'lang_assignsubnettovlan_existing' => 'Assign subnet to existing VLAN',
- 'lang_assignsubnettovlan_new' => 'Assign subnet to new VLAN',
- 'lang_assignvlantosubnet' => 'Assign VLAN to subnet',
- 'lang_assignvlantosubnet_existing' => 'Assign VLAN to existing subnet',
- 'lang_assignvlantosubnet_new' => 'Assign VLAN to new subnet',
-
- 'lang_location_add' => 'Add location',
- 'lang_location_del' => 'Delete location',
- 'lang_location_edit' => 'Mofidy location',
- 'lang_location_info' => 'Location info',
- 'lang_location_name' => 'Location name',
- 'lang_location_parent' => 'Parent',
- 'lang_sublocation_add' => 'Add Sub-location',
-
- 'lang_locationsubnet' => 'Location/Subnet',
- 'lang_locationsubnet_edit' => 'Edit Location/Subnet',
-
- 'lang_node_add' => 'Add node',
- 'lang_node_del' => 'Delete node',
- 'lang_node_edit' => 'Modify node',
- 'lang_node_info' => 'Node info',
- 'lang_dns1' => 'DNS name',
- 'lang_dns2' => 'DNS Alias',
- 'lang_ip' => 'IP Address',
- 'lang_mac' => 'MAC Address',
-
- 'lang_nat' => 'NAT',
- 'lang_nat_add' => 'Add NAT',
- 'lang_nat_del' => 'Delete NAT',
- 'lang_nat_edit' => 'Modify NAT',
- 'lang_nat_rules' => 'NAT Rules',
- 'lang_nat_type' => 'Type',
- 'lang_nat_type_1' => 'Hide',
- 'lang_nat_type_2' => 'Static',
- 'lang_nat_type_3' => 'Dynamic',
-
- 'lang_search_results_found' => 'Total results found',
-
- 'lang_subnet_add' => 'Add subnet',
- 'lang_subnet_subnetaddress' => 'Subnet address',
- 'lang_subnet_subnetaddress_mask' => 'Subnet address/Mask',
- 'lang_subnet_broadcastaddress' => 'Broadcast address',
- 'lang_subnet_nodesinsubnet' => 'Nodes in subnet',
- 'lang_subnet_subnetused' => 'Subnet used',
- 'lang_subnet_del' => 'Delete subnet',
- 'lang_subnet_edit' => 'Modify subnet',
- 'lang_subnet_info' => 'Subnet info',
- 'lang_subnet_mask' => 'Subnet mask',
-
- 'lang_subnetlocation' => 'Subnet/Location',
- 'lang_subnetlocation_edit' => 'Edit Subnet/Location',
- 'lang_subnetvlan' => 'Subnet/VLAN',
- 'lang_subnetvlan_edit' => 'Edit Subnet/VLAN',
-
- 'lang_user_add' => 'Add user',
- 'lang_user_del' => 'Delete user',
- 'lang_user_displayname' => 'Displayname',
- 'lang_user_edit' => 'Mofidy user',
- 'lang_user_name' => 'Username',
- 'lang_user_password' => 'Password',
-
- 'lang_vlan_add' => 'Add VLAN',
- 'lang_vlan_del' => 'Delete VLAN',
- 'lang_vlan_edit' => 'Modify VLAN',
- 'lang_vlan_number' => 'VLAN ID',
- 'lang_vlan_info' => 'VLAN info',
- 'lang_vlan_new' => 'VLAN info',
- 'lang_vlan_name' => 'VLAN name',
-
- 'lang_vlansubnet' => 'VLAN/Subnet',
- 'lang_vlansubnet_edit' => 'Edit VLAN/Subnet',
-
- 'lang_comments' => 'Comments',
- 'lang_comments_error' => 'Error',
- 'lang_comments_asset_del_nodes' => 'These nodes will also be deleted!',
- 'lang_comments_ipinuse' => 'IP in use',
- 'lang_comments_notallowed' => 'Not allowed',
- 'lang_comments_search_nosearch' => 'Nothing to search for!',
- 'lang_comments_usernameinuse' => 'Username in use',
-
- 'lang_options_ipreg' => 'IP Reg options',
- 'lang_options_display' => 'Display options',
- 'lang_options_password' => 'Change password',
- 'lang_options_imagesize' => 'Imagesize',
- 'lang_options_imagesize_help' => 'Size (in pixels) of colored square on subnetview',
- 'lang_options_imagecount' => 'Imagecount',
- 'lang_options_imagecount_help' => 'Nr of colored squares per row on subnetview',
- 'lang_options_mac' => 'MAC Address',
- 'lang_options_mac_help' => 'Format in which a MAC address is displayed (e.g. xx-xx-xx-xx-xx-xx)',
- 'lang_options_menu_help' => 'Select items to be displayed in menu',
- 'lang_options_dateformat' => 'Date format',
- 'lang_options_dateformat_help' => 'Format in which dates are displayed using the php-date-format (see http://www.php.net/date for more info)',
- 'lang_options_dns1suffix' => 'DNS Name suffix',
- 'lang_options_dns1suffix_help' => 'Default DNS Name suffix when creating a new node',
- 'lang_options_dns2suffix' => 'DNS Alias suffix',
- 'lang_options_dns2suffix_help' => 'Default DNS Alias suffix when creating a new node',
- 'lang_options_currentpassword' => 'Current password',
- 'lang_options_currentpassword_help' => 'Enter your current password',
- 'lang_options_newpassword1' => 'New password',
- 'lang_options_newpassword1_help' => 'Enter your new password',
- 'lang_options_newpassword2' => 'Retype new password',
- 'lang_options_newpassword2_help' => 'Re-type your new password',
-
- 'lang_about_sfprojectpage' => 'Sourceforge Project Page',
- 'lang_about_license' => 'lang_about_license',
- 'lang_about_gpl' => 'GNU General Public License (GPL)',
- 'lang_about_yapter' => 'Yapter Template Engine',
- 'lang_about_iconset' => 'Silk icon set 1.3',
- 'lang_about_ipreg_ext' => 'IP Reg, a PHP/MySQL IPAM tool',
- 'lang_about_license_ext' => '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/.',
-
- 'lang_about_changelog' => 'Changelog (major changes only)',
- 'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
- 'lang_about_changelog_v05_ext' => '- Complete code rewrite - Input sanitation - Background image - Added multiple counters - HTML is now 100% W3C valid More user options',
- 'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
- 'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed - PHP-generated images in subnet overview',
- 'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
- 'lang_about_changelog_v03_ext' => '- Class A subnet support - Multi-language support - User defined options - All configuration options in one file (config.php)',
- 'lang_about_changelog_v02' => 'v0.2 (dec 2007)',
- 'lang_about_changelog_v02_ext' => '- Fixed ordering of IP addresses - Fixed info fields',
- 'lang_about_changelog_v01' => 'v0.1 (dec 2007)',
- 'lang_about_changelog_v01_ext' => '- First beta release',
-
-);
-
-?>
\ No newline at end of file
+ 'IP Reg',
+
+ 'lang_asset' => 'Asset',
+ 'lang_assets' => 'Assets',
+ 'lang_assetclass' => 'Assetclass',
+ 'lang_assetclasses' => 'Assetclasses',
+ 'lang_assetclassgroup' => 'Assetclassgroup',
+ 'lang_assetclassgroups' => 'Assetclassgroups',
+ 'lang_location' => 'Location',
+ 'lang_locations' => 'Locations',
+ 'lang_menu' => 'Menu',
+ 'lang_node' => 'Node',
+ 'lang_nodes' => 'Nodes',
+ 'lang_user' => 'User',
+ 'lang_users' => 'Users',
+ 'lang_zone' => 'Zone',
+ 'lang_zones' => 'Zones',
+ 'lang_sublocation' => 'Sub-location',
+ 'lang_sublocations' => 'Sub-locations',
+ 'lang_subnet' => 'Subnet',
+ 'lang_subnets' => 'Subnets',
+ 'lang_tooltips' => 'Tooltips',
+ 'lang_vlan' => 'VLAN',
+ 'lang_vlans' => 'VLANs',
+
+ 'lang_about' => 'About',
+ 'lang_all' => 'All',
+ 'lang_cancel' => 'Cancel',
+ 'lang_color' => 'Color',
+ 'lang_error' => 'Error',
+ 'lang_item' => 'Item',
+ 'lang_language' => 'Language',
+ 'lang_login' => 'Login',
+ 'lang_logout' => 'Logout',
+ 'lang_options' => 'Options',
+ 'lang_option_none' => '(none)',
+ 'lang_reset' => 'Reset',
+ 'lang_search' => 'Search',
+ 'lang_statistics' => 'Statistics',
+ 'lang_subitem' => 'Sub-Item',
+ 'lang_submit' => 'Submit',
+ 'lang_unassigned' => 'Unassigned',
+ 'lang_warning' => 'Warning',
+
+ 'lang_asset_add' => 'Add asset',
+ 'lang_asset_del' => 'Delete asset',
+ 'lang_asset_edit' => 'Modify asset',
+ 'lang_asset_info' => 'Asset info',
+ 'lang_asset_name' => 'Asset name',
+ 'lang_asset_hostname' => 'Hostname',
+ 'lang_asset_none' => 'There are no assets defined',
+
+ 'lang_assetclass_add' => 'Add assetclass',
+ 'lang_assetclass_del' => 'Delete assetclass',
+ 'lang_assetclass_edit' => 'Mofidy assetclass',
+ 'lang_assetclass_name' => 'Assetclass name',
+ 'lang_assetclass_none' => 'There are no assetclasses defined',
+
+ 'lang_assetclassgroup_add' => 'Add assetclassgroup',
+ 'lang_assetclassgroup_del' => 'Delete assetclassgroup',
+ 'lang_assetclassgroup_edit' => 'Modify assetclassgroup',
+ 'lang_assetclassgroup_name' => 'Assetclass Groupname',
+ 'lang_assetclassgroup_none' => 'There are no assetclassegroups defined',
+
+ 'lang_assignnodetoasset' => 'Assign node to asset',
+ 'lang_assignnodetoasset_existing' => 'Assign node to existing asset',
+ 'lang_assignnodetoasset_new' => 'Assign node to new asset',
+ 'lang_assigniptonode' => 'Assign IP to node',
+ 'lang_assigniptonode_existing' => 'Assign IP to existing node',
+ 'lang_assigniptonode_new' => 'Assign IP to new node',
+ 'lang_assignlocationtosubnet' => 'Assign location to subnet',
+ 'lang_assignlocationtosubnet_existing' => 'Assign location to existing subnet',
+ 'lang_assignlocationtosubnet_new' => 'Assign location to new subnet',
+ 'lang_assignsubnettovlan' => 'Assign subnet to VLAN',
+ 'lang_assignsubnettovlan_existing' => 'Assign subnet to existing VLAN',
+ 'lang_assignsubnettovlan_new' => 'Assign subnet to new VLAN',
+ 'lang_assignvlantosubnet' => 'Assign VLAN to subnet',
+ 'lang_assignvlantosubnet_existing' => 'Assign VLAN to existing subnet',
+ 'lang_assignvlantosubnet_new' => 'Assign VLAN to new subnet',
+
+ 'lang_location_add' => 'Add location',
+ 'lang_location_del' => 'Delete location',
+ 'lang_location_edit' => 'Mofidy location',
+ 'lang_location_info' => 'Location info',
+ 'lang_location_name' => 'Location name',
+ 'lang_location_parent' => 'Parent',
+ 'lang_sublocation_add' => 'Add Sub-location',
+
+ 'lang_locationsubnet' => 'Location/Subnet',
+ 'lang_locationsubnet_edit' => 'Edit Location/Subnet',
+
+ 'lang_node_add' => 'Add node',
+ 'lang_node_del' => 'Delete node',
+ 'lang_node_edit' => 'Modify node',
+ 'lang_node_info' => 'Node info',
+ 'lang_dns1' => 'DNS name',
+ 'lang_dns2' => 'DNS Alias',
+ 'lang_ip' => 'IP Address',
+ 'lang_mac' => 'MAC Address',
+ 'lang_proto_vers' => 'Protocol version',
+
+ 'lang_nat' => 'NAT',
+ 'lang_nat_add' => 'Add NAT',
+ 'lang_nat_del' => 'Delete NAT',
+ 'lang_nat_edit' => 'Modify NAT',
+ 'lang_nat_rules' => 'NAT Rules',
+ 'lang_nat_type' => 'Type',
+ 'lang_nat_type_1' => 'Hide',
+ 'lang_nat_type_2' => 'Static',
+ 'lang_nat_type_3' => 'Dynamic',
+
+ 'lang_search_results_found' => 'Total results found',
+
+ 'lang_subnet_add' => 'Add subnet',
+ 'lang_subnet_subnetaddress' => 'Subnet address',
+ 'lang_subnet_subnetaddress_mask' => 'Subnet address/Mask',
+ 'lang_subnet_broadcastaddress' => 'Broadcast address',
+ 'lang_subnet_nodesinsubnet' => 'Nodes in subnet',
+ 'lang_subnet_subnetused' => 'Subnet used',
+ 'lang_subnet_del' => 'Delete subnet',
+ 'lang_subnet_edit' => 'Modify subnet',
+ 'lang_subnet_info' => 'Subnet info',
+ 'lang_subnet_mask' => 'Subnet mask',
+ 'lang_subnet_dhcp' => 'Exclude DHCP',
+ 'lang_subnet_dhcpstart' => 'DHCP Start',
+ 'lang_subnet_dhcpend' => 'DHCP End',
+ 'lang_subnet_ntp_server' => 'NTP Server',
+
+ 'lang_subnetlocation' => 'Subnet/Location',
+ 'lang_subnetlocation_edit' => 'Edit Subnet/Location',
+ 'lang_subnetvlan' => 'Subnet/VLAN',
+ 'lang_subnetvlan_edit' => 'Edit Subnet/VLAN',
+
+ 'lang_user_add' => 'Add user',
+ 'lang_user_del' => 'Delete user',
+ 'lang_user_displayname' => 'Displayname',
+ 'lang_user_edit' => 'Mofidy user',
+ 'lang_user_name' => 'Username',
+ 'lang_user_password' => 'Password',
+
+ 'lang_zone_add' => 'Add zone',
+ 'lang_zone_del' => 'Delete zone',
+ 'lang_zone_edit' => 'Mofidy zone',
+
+ 'lang_vlan_add' => 'Add VLAN',
+ 'lang_vlan_del' => 'Delete VLAN',
+ 'lang_vlan_edit' => 'Modify VLAN',
+ 'lang_vlan_number' => 'VLAN ID',
+ 'lang_vlan_info' => 'VLAN info',
+ 'lang_vlan_new' => 'VLAN info',
+ 'lang_vlan_name' => 'VLAN name',
+ 'lang_user_language' => 'Language',
+
+ 'lang_vlansubnet' => 'VLAN/Subnet',
+ 'lang_vlansubnet_edit' => 'Edit VLAN/Subnet',
+
+ 'lang_comments' => 'Comments',
+ 'lang_comments_error' => 'Error',
+ 'lang_comments_asset_del_nodes' => 'These nodes will also be deleted!',
+ 'lang_comments_ipinuse' => 'IP in use',
+ 'lang_comments_notallowed' => 'Not allowed',
+ 'lang_comments_search_nosearch' => 'Nothing to search for!',
+ 'lang_comments_usernameinuse' => 'Username in use',
+ 'lang_comments_invalidpass' => 'Invalid password',
+ 'lang_comments_invalidnewpass' => 'Invalid new password',
+
+ 'lang_options_ipreg' => 'IP Reg options',
+ 'lang_options_display' => 'Display options',
+ 'lang_options_password' => 'Change password',
+ 'lang_options_imagesize' => 'Imagesize',
+ 'lang_options_imagesize_help' => 'Size (in pixels) of colored square on subnetview',
+ 'lang_options_imagecount' => 'Imagecount',
+ 'lang_options_imagecount_help' => 'Nr of colored squares per row on subnetview',
+ 'lang_options_mac' => 'MAC Address',
+ 'lang_options_mac_help' => 'Format in which a MAC address is displayed (e.g. xx-xx-xx-xx-xx-xx)',
+ 'lang_options_menu_help' => 'Select items to be displayed in menu',
+ 'lang_options_dateformat' => 'Date format',
+ 'lang_options_dateformat_help' => 'Format in which dates are displayed using the php-date-format (see http://www.php.net/date for more info)',
+ 'lang_options_dns1suffix' => 'DNS Name suffix',
+ 'lang_options_dns1suffix_help' => 'Default DNS Name suffix when creating a new node',
+ 'lang_options_dns2suffix' => 'DNS Alias suffix',
+ 'lang_options_dns2suffix_help' => 'Default DNS Alias suffix when creating a new node',
+ 'lang_options_currentpassword' => 'Current password',
+ 'lang_options_currentpassword_help' => 'Enter your current password',
+ 'lang_options_newpassword1' => 'New password',
+ 'lang_options_newpassword1_help' => 'Enter your new password',
+ 'lang_options_newpassword2' => 'Retype new password',
+ 'lang_options_newpassword2_help' => 'Re-type your new password',
+ 'lang_options_tooltips_help' => 'Show tooltips',
+ 'lang_options_language_help' => 'Language for this user',
+
+ 'lang_about_sfprojectpage' => 'Sourceforge Project Page',
+ 'lang_about_license' => 'License',
+ 'lang_about_gpl' => 'GNU General Public License (GPL)',
+ 'lang_about_smarty' => 'Smarty Template Engine',
+ 'lang_about_iconset' => 'Silk icon set 1.3',
+ 'lang_about_ipreg_ext' => 'IP Reg, a PHP/MySQL IPAM tool',
+ 'lang_about_license_ext' => 'Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) Copyright (C) 2011-2023 Thomas Hooge
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/.',
+
+ 'lang_about_changelog' => 'Changelog (major changes only)',
+ 'lang_about_changelog_v07' => 'v0.7 (oct 2018)',
+ 'lang_about_changelog_v07_ext' => '- Added support for PHP7, switched to mysqli',
+ 'lang_about_changelog_v06' => 'v0.6 (may 2011)',
+ 'lang_about_changelog_v06_ext' => '- Moved towards smarty template engine - language support finalized - added german language - some small bug fixes',
+ 'lang_about_changelog_v05' => 'v0.5 (dec 2009)',
+ 'lang_about_changelog_v05_ext' => '- Complete code rewrite - Input sanitation - Background image - Added multiple counters - HTML is now 100% W3C valid More user options',
+ 'lang_about_changelog_v04' => 'v0.4 (jun 2008)',
+ 'lang_about_changelog_v04_ext' => '- SQL vulnerability fixed - PHP-generated images in subnet overview',
+ 'lang_about_changelog_v03' => 'v0.3 (dec 2007)',
+ 'lang_about_changelog_v03_ext' => '- Class A subnet support - Multi-language support - User defined options - All configuration options in one file (config.php)',
+ 'lang_about_changelog_v02' => 'v0.2 (dec 2007)',
+ 'lang_about_changelog_v02_ext' => '- Fixed ordering of IP addresses - Fixed info fields',
+ 'lang_about_changelog_v01' => 'v0.1 (dec 2007)',
+ 'lang_about_changelog_v01_ext' => '- First beta release',
+
+);
+
+?>
diff --git a/lib.php b/lib.php
index 0ac5bbf..d050091 100644
--- a/lib.php
+++ b/lib.php
@@ -1,44 +1,48 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // functions
- include("lib/functions.php");
-
- // classes
- // db
- // load class
- require("lib/db.class.php");
-
- // create instance
- $db = new Db();
-
- // user
- // load class
- require("lib/user.class.php");
-
- // create instance
- $user = new User();
-
- // tpl
- // load class
- include("lib/yapter.php");
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // functions
+ include("lib/functions.php");
+
+ // classes
+ // db
+ // load class
+ require("lib/db.class.php");
+
+ // create instance
+ $db = new Db($dblink);
+
+ // user
+ // load class
+ require("lib/user.class.php");
+
+ // create instance
+ $user = new User();
+
+ // tpl
+ require_once('smarty3/Smarty.class.php');
+ $smarty = new Smarty();
+ $smarty->template_dir = 'tpl';
+ $smarty->compile_dir = 'tpl_c';
+ $smarty->registerPlugin('function', 'treelist', 'print_tree');
+ $smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']);
+?>
diff --git a/lib/arrow.gif b/lib/arrow.gif
new file mode 100644
index 0000000..246478a
Binary files /dev/null and b/lib/arrow.gif differ
diff --git a/lib/changelink.js b/lib/changelink.js
index 7b0455a..bc6d10e 100644
--- a/lib/changelink.js
+++ b/lib/changelink.js
@@ -1,5 +1,5 @@
- function changelink(optVal){
- if(optVal=="")
- return false;
- window.location='subnetview.php?subnet_id='+optVal;
- }
\ No newline at end of file
+function changelink(optVal) {
+ if(optVal=="")
+ return false;
+ window.location='subnetview.php?subnet_id='+optVal;
+}
\ No newline at end of file
diff --git a/lib/changetext.js b/lib/changetext.js
index babe973..0ab85d3 100644
--- a/lib/changetext.js
+++ b/lib/changetext.js
@@ -1,3 +1,3 @@
- function changetext(id,newtext) {
- document.getElementById(id).innerHTML=newtext
- }
\ No newline at end of file
+function changetext(id,newtext) {
+ document.getElementById(id).innerHTML=newtext
+}
\ No newline at end of file
diff --git a/lib/cross.gif b/lib/cross.gif
new file mode 100644
index 0000000..0ee9c7a
Binary files /dev/null and b/lib/cross.gif differ
diff --git a/lib/db.class.php b/lib/db.class.php
index d6f0e74..b64247b 100644
--- a/lib/db.class.php
+++ b/lib/db.class.php
@@ -1,55 +1,173 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- class Db {
- function db_delete($query) {
- // run query
- $sql = mysql_query($query) or die(mysql_error());
- }
-
- function db_insert($query) {
- // run query
- $sql = mysql_query($query) or die(mysql_error());
-
- // return result
- return mysql_insert_id();
- }
-
- function db_select($query) {
- // run query
- $sql = mysql_query($query) or die(mysql_error());
-
- // loop results
- while($record = mysql_fetch_assoc($sql)) {
- $result[] = $record;
- }
-
- // return array
- return $result;
- }
-
- function db_update($query) {
- // run query
- $sql = mysql_query($query) or die(mysql_error());
- }
- }
-?>
\ No newline at end of file
+.
+
+ 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
+ echo "
$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;
+ }
+
+ }
+?>
diff --git a/lib/functions.php b/lib/functions.php
index 51a4e13..486ceea 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1,94 +1,170 @@
-.
-
- For more information, visit http://sourceforge.net/projects/ipreg,
- or contact me at wietsew@users.sourceforge.net
- *****************************************************************************/
-
- // strip mac address to 12 char string
- function strip_mac($mac) {
- // strip chars we don't need
- $mac = preg_replace("|[^a-fA-F0-9]|", "", $mac);
-
- // capitalize (just because it looks better eh)
- $mac = strtoupper($mac);
-
- // and return
- return ($mac);
- }
-
- // rebuild mac address
- function write_mac($mac) {
- // check string length
- if (strlen($mac)!=12) {
- // if the MAC is empty, or for whatever reason incorrect, just return
- return $mac;
- } else {
- // count to 12...
- for($i=0;$i<12;$i++) {
- // ... and strip mac to pieces
- ${"mac".$i} = $mac{$i};
- }
-
- // get user preference
- $user_mac = $_SESSION['suser_mac'];
-
- // count to 12 again...
- for($i=0;$i<12;$i++) {
- // ... and replace user preference with pieces
- $user_mac = preg_replace("/x/", ${"mac".$i}, $user_mac, 1);
- }
-
- // and return
- return $user_mac;
- }
- }
-
- // redirect page
- function header_location($location) {
- // send header
- header("location: " . $location);
-
- // exit to be sure
- exit;
- }
-
- // sanitize input
- function sanitize($input) {
- // trim whitespaces
- $input = @trim($input);
-
- // magic quotes enabled?
- if(get_magic_quotes_gpc()) {
- // strip slashes
- $input = stripslashes($input);
- }
-
- // convert to utf-8
- iconv("UTF-8", "UTF-8", $input);
-
- // convert special chars
- $input = htmlentities($input,ENT_QUOTES,'UTF-8');
-
- // make sql ready
- $input = mysql_real_escape_string($input);
-
- // and return
- return $input;
- }
-?>
\ No newline at end of file
+.
+
+ For more information, visit http://sourceforge.net/projects/ipreg,
+ or contact me at wietsew@users.sourceforge.net
+ *****************************************************************************/
+
+ // strip mac address to 12 char string
+ function strip_mac($mac) {
+ // strip chars we don't need
+ $mac = preg_replace("|[^a-fA-F0-9]|", "", $mac);
+
+ // capitalize (just because it looks better eh)
+ $mac = strtoupper($mac);
+
+ // and return
+ return ($mac);
+ }
+
+ // rebuild mac address
+ function write_mac($mac) {
+ // check string length
+ if (strlen($mac)!=12) {
+ // if the MAC is empty, or for whatever reason incorrect, just return
+ return $mac;
+ } else {
+ // count to 12...
+ for($i=0;$i<12;$i++) {
+ // ... and strip mac to pieces
+ ${"mac".$i} = $mac{$i};
+ }
+
+ // get user preference
+ $user_mac = $_SESSION['suser_mac'];
+
+ // count to 12 again...
+ for($i=0;$i<12;$i++) {
+ // ... and replace user preference with pieces
+ $user_mac = preg_replace("/x/", ${"mac".$i}, $user_mac, 1);
+ }
+
+ // and return
+ return $user_mac;
+ }
+ }
+
+ // redirect page
+ function header_location($location) {
+ // send header
+ header("location: " . $location);
+
+ // exit to be sure
+ exit;
+ }
+
+ // sanitize input
+ function sanitize($input) {
+ global $dblink;
+
+ // trim whitespaces
+ $input = @trim($input);
+
+ // magic quotes enabled?
+ if(get_magic_quotes_gpc()) {
+ // strip slashes
+ $input = stripslashes($input);
+ }
+
+ // convert to utf-8
+ iconv("UTF-8", "UTF-8", $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;
+ }
+
+ function mysql_nullstring($input) {
+ if (isset($input)) {
+ return $input;
+ } else {
+ return '';
+ }
+ }
+
+ function lang_getfrombrowser ($allowed_languages, $default_language, $lang_variable = null, $strict_mode = true) {
+ if ($lang_variable === null) {
+ $lang_variable = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ }
+ if (empty($lang_variable)) {
+ return $default_language;
+ }
+ $accepted_languages = preg_split('/,\s*/', $lang_variable);
+ $current_lang = $default_language;
+ $current_q = 0;
+ foreach ($accepted_languages as $accepted_language) {
+ $res = preg_match ('/^([a-z]{1,8}(?:-[a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i',
+ $accepted_language, $matches);
+ if (!$res) {
+ continue;
+ }
+ $lang_code = explode ('-', $matches[1]);
+ if (isset($matches[2])) {
+ $lang_quality = (float)$matches[2];
+ } else {
+ $lang_quality = 1.0;
+ }
+ while (count ($lang_code)) {
+ if (in_array (strtolower (join ('-', $lang_code)), $allowed_languages)) {
+ if ($lang_quality > $current_q) {
+ $current_lang = strtolower (join ('-', $lang_code));
+ $current_q = $lang_quality;
+ break;
+ }
+ }
+ if ($strict_mode) {
+ break;
+ }
+ array_pop ($lang_code);
+ }
+ }
+ return $current_lang;
+ }
+
+ function print_tree_rec($tree, $level) {
+ $output = '
\ No newline at end of file
diff --git a/tpl/asset.tpl b/tpl/asset.tpl
index 5e77752..4be1b9e 100644
--- a/tpl/asset.tpl
+++ b/tpl/asset.tpl
@@ -1,49 +1,53 @@
-
diff --git a/tpl/assetadd.tpl b/tpl/assetadd.tpl
index 002e786..c7fce4b 100644
--- a/tpl/assetadd.tpl
+++ b/tpl/assetadd.tpl
@@ -1,80 +1,70 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclass.tpl b/tpl/assetclass.tpl
index a482acb..e83da6c 100644
--- a/tpl/assetclass.tpl
+++ b/tpl/assetclass.tpl
@@ -1,35 +1,31 @@
-
-
-
- {lang_assetclasses} ({assetclass_counter})
-
-
-
-
-
-
-
-
-
- [BLOCK assetclass_table AS assetclass_table]
-
diff --git a/tpl/assetclassadd.tpl b/tpl/assetclassadd.tpl
index a437295..0d320ba 100644
--- a/tpl/assetclassadd.tpl
+++ b/tpl/assetclassadd.tpl
@@ -1,63 +1,54 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassdel.tpl b/tpl/assetclassdel.tpl
index 695d08e..54b93d1 100644
--- a/tpl/assetclassdel.tpl
+++ b/tpl/assetclassdel.tpl
@@ -1,38 +1,36 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassedit.tpl b/tpl/assetclassedit.tpl
index 5dafb45..2ee448d 100644
--- a/tpl/assetclassedit.tpl
+++ b/tpl/assetclassedit.tpl
@@ -1,69 +1,55 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassgroup.tpl b/tpl/assetclassgroup.tpl
index 5d305cb..93bd932 100644
--- a/tpl/assetclassgroup.tpl
+++ b/tpl/assetclassgroup.tpl
@@ -1,29 +1,26 @@
-
diff --git a/tpl/assetclassgroupadd.tpl b/tpl/assetclassgroupadd.tpl
index 15eaecc..370517f 100644
--- a/tpl/assetclassgroupadd.tpl
+++ b/tpl/assetclassgroupadd.tpl
@@ -1,44 +1,42 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassgroupdel.tpl b/tpl/assetclassgroupdel.tpl
index 27240cf..11d1d9e 100644
--- a/tpl/assetclassgroupdel.tpl
+++ b/tpl/assetclassgroupdel.tpl
@@ -1,38 +1,38 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassgroupedit.tpl b/tpl/assetclassgroupedit.tpl
index ae7016d..d24b6f0 100644
--- a/tpl/assetclassgroupedit.tpl
+++ b/tpl/assetclassgroupedit.tpl
@@ -1,48 +1,44 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetclassgroupview.tpl b/tpl/assetclassgroupview.tpl
index defc79d..02d2c42 100644
--- a/tpl/assetclassgroupview.tpl
+++ b/tpl/assetclassgroupview.tpl
@@ -1,70 +1,60 @@
-
-
-
- {assetclassgroup_name}
-
-
-
-
-
-
-
-
-
-
-
- [BLOCK assetclassgroup_table AS assetclassgroup_table]
-
\ No newline at end of file
diff --git a/tpl/assetclassview.tpl b/tpl/assetclassview.tpl
index 2c7cdb0..c8055ae 100644
--- a/tpl/assetclassview.tpl
+++ b/tpl/assetclassview.tpl
@@ -1,86 +1,73 @@
-
-
-
- {assetclass_name}
-
-
-
-
-
-
-
-
-
-
-
- [BLOCK assetclass_table AS assetclass_table]
-
+{/if}
diff --git a/tpl/assetedit.tpl b/tpl/assetedit.tpl
index eb216d2..c6359b8 100644
--- a/tpl/assetedit.tpl
+++ b/tpl/assetedit.tpl
@@ -1,86 +1,72 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/assetview.tpl b/tpl/assetview.tpl
index 096a6a0..1fc068c 100644
--- a/tpl/assetview.tpl
+++ b/tpl/assetview.tpl
@@ -1,101 +1,89 @@
-
diff --git a/tpl/assigniptonode.tpl b/tpl/assigniptonode.tpl
index daf38f7..a4fd913 100644
--- a/tpl/assigniptonode.tpl
+++ b/tpl/assigniptonode.tpl
@@ -1,67 +1,63 @@
-
diff --git a/tpl/assignnodetoasset.tpl b/tpl/assignnodetoasset.tpl
index 90e9518..b4be354 100644
--- a/tpl/assignnodetoasset.tpl
+++ b/tpl/assignnodetoasset.tpl
@@ -1,127 +1,105 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/comments.tpl b/tpl/comments.tpl
index 526a334..d1db562 100644
--- a/tpl/comments.tpl
+++ b/tpl/comments.tpl
@@ -1,25 +1,23 @@
-
-
-
- {lang_comments}
-
-
-
-
-
-
-
-
-
-
-
-
- {lang_comments}
-
-
-
-
- {comments}
-
-
-
\ No newline at end of file
+
+
+
+ {$lang_comments}
+
+
+
+
+
+
+
+
+
+
+ {$lang_comments}
+
+
+
+
+ {$comments}
+
+
+
\ No newline at end of file
diff --git a/tpl/footer.tpl b/tpl/footer.tpl
index 1a995c7..134c8c3 100644
--- a/tpl/footer.tpl
+++ b/tpl/footer.tpl
@@ -1,11 +1,9 @@
-