diff --git a/asset.php b/asset.php index a2a9f76..7c7fd89 100644 --- a/asset.php +++ b/asset.php @@ -118,7 +118,7 @@ $smarty->assign("alphabet", $alphabet); // total asset count $sth = $dbh->query("SELECT COUNT(*) FROM asset"); $assetcount = $sth->fetchColumn(); -$smarty->assign("assetcount", $sassetcount); +$smarty->assign("assetcount", $assetcount); // assets for current letter if (isset($_GET['bst'])) { diff --git a/images/brick_add.png b/images/brick_add.png new file mode 100644 index 0000000..2d5f7c4 Binary files /dev/null and b/images/brick_add.png differ diff --git a/images/brick_delete.png b/images/brick_delete.png new file mode 100644 index 0000000..2f82ed5 Binary files /dev/null and b/images/brick_delete.png differ diff --git a/images/brick_edit.png b/images/brick_edit.png new file mode 100644 index 0000000..c0b4b05 Binary files /dev/null and b/images/brick_edit.png differ diff --git a/images/nat.png b/images/nat.png new file mode 100644 index 0000000..b1e017a Binary files /dev/null and b/images/nat.png differ diff --git a/images/tag-blue.png b/images/tag.png similarity index 100% rename from images/tag-blue.png rename to images/tag.png diff --git a/images/tag_add.png b/images/tag_add.png new file mode 100644 index 0000000..614ff9c Binary files /dev/null and b/images/tag_add.png differ diff --git a/images/tag_delete.png b/images/tag_delete.png new file mode 100644 index 0000000..c2ecf39 Binary files /dev/null and b/images/tag_delete.png differ diff --git a/images/tag_edit.png b/images/tag_edit.png new file mode 100644 index 0000000..84e24f9 Binary files /dev/null and b/images/tag_edit.png differ diff --git a/login.php b/login.php index 40e3f38..947351f 100644 --- a/login.php +++ b/login.php @@ -7,9 +7,6 @@ Copyright (C) 2011-2023 Thomas Hooge SPDX-License-Identifier: GPL-3.0-or-later *****************************************************************************/ -session_name('ipreg'); -session_start(); - if (! include("config.php")) { echo "IP Reg\n"; echo "

IP Reg

No configuration

\n"; @@ -19,6 +16,9 @@ if (! include("config.php")) { exit(1); } +session_name($config_app_session); +session_start(); + // connect to database $dbh = new PDO("mysql:host=$config_mysql_host;dbname=$config_mysql_dbname;charset=utf8", $config_mysql_username, $config_mysql_password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); diff --git a/nat.php b/nat.php index 13dd32f..b18c4b8 100644 --- a/nat.php +++ b/nat.php @@ -23,6 +23,16 @@ switch ($submit = form_get_action()) { case 'edit': $action = ACT_EDIT; break; case 'del': $action = ACT_DELETE; break; + case 'exec-edit': + if ($_POST['action'] == 'natadd') { + $action = ACT_ADD; + } elseif ($_POST['action'] == 'natdel') { + $action = ACT_DELETE; + } else { + $g_warning->Add('Invalid action: '. $_POST['action']); + } + break; + case 'insert': $node_id_ext = sanitize($_POST['node_id_ext']); $node_id_int = sanitize($_POST['node_id_int']); @@ -39,7 +49,11 @@ switch ($submit = form_get_action()) { case 'delete': $node_id_ext = sanitize($_POST['node_id_ext']); $sth = $dbh->prepare("DELETE FROM nat WHERE nat_id=?"); - $sth->execute([$id]); + try { + $sth->execute([$id]); + } catch (PDOException $e) { + $g_warning->Add($e->getMessage()); + } // TODO // header_location("node.php?f=view&id=" . $node_id_ext); $action = ACT_DEFAULT; @@ -76,7 +90,7 @@ $smarty->display("nat.tpl"); elseif ($action == ACT_ADD): // ========== VARIANT: add record ============================================= -$node_id = sanitize($_GET['node_id']); +$node_id = sanitize($_REQUEST['node_id']); // node_ext $sql = "SELECT node_ip AS node_ip_ext @@ -151,7 +165,7 @@ $smarty->display("natedit.tpl"); elseif ($action == ACT_DELETE): // ========== VARIANT: delete record ========================================== -$node_id = sanitize($_GET['node_id']); +$node_id = sanitize($_REQUEST['node_id']); // node_ext $sth = $dbh->prepare("SELECT node_id AS id_ext, node_ip AS ip_ext FROM node WHERE node_id=?"); diff --git a/tpl/assetadd.tpl b/tpl/assetadd.tpl index 3706b89..d15744d 100644 --- a/tpl/assetadd.tpl +++ b/tpl/assetadd.tpl @@ -7,7 +7,7 @@ {$lang_cancel} - + @@ -77,7 +77,7 @@ {$lang_assetclass_name} - {html_options name=assetclass_id options=$assetclass_options} + {html_options name=assetclass_id options=$assetclass_options selected=$assetclass_id} diff --git a/tpl/assetclass.tpl b/tpl/assetclass.tpl index 579e255..2668fee 100644 --- a/tpl/assetclass.tpl +++ b/tpl/assetclass.tpl @@ -6,7 +6,7 @@ {if $suser_add || $suser_admin} - {$lang_assetclass_add} + {$lang_assetclass_add} {/if} diff --git a/tpl/assetclassedit.tpl b/tpl/assetclassedit.tpl index 4d63b98..4555b76 100644 --- a/tpl/assetclassedit.tpl +++ b/tpl/assetclassedit.tpl @@ -9,7 +9,7 @@ {$lang_cancel} - + diff --git a/tpl/assetclassgroupadd.tpl b/tpl/assetclassgroupadd.tpl index 5c70ff8..76c6ced 100644 --- a/tpl/assetclassgroupadd.tpl +++ b/tpl/assetclassgroupadd.tpl @@ -7,7 +7,7 @@ {$lang_cancel} - + diff --git a/tpl/assetclassgroupedit.tpl b/tpl/assetclassgroupedit.tpl index 81e04c5..b212b2a 100644 --- a/tpl/assetclassgroupedit.tpl +++ b/tpl/assetclassgroupedit.tpl @@ -9,7 +9,7 @@ {$lang_cancel} - + diff --git a/tpl/assetclassview.tpl b/tpl/assetclassview.tpl index da8dbd1..b6b2ae5 100644 --- a/tpl/assetclassview.tpl +++ b/tpl/assetclassview.tpl @@ -6,13 +6,13 @@ {if $suser_add} - {$lang_asset_add} + {$lang_asset_add} {/if} {if $suser_edit} - {$lang_assetclass_edit} + {$lang_assetclass_edit} {/if} {if $suser_delete} - {$lang_assetclass_add} + {$lang_assetclass_add} {/if} @@ -73,7 +73,9 @@ {$lang_assets} -   +{if $suser_add} + {$lang_asset_add} +{/if} diff --git a/tpl/assetedit.tpl b/tpl/assetedit.tpl index bb680e3..1b82899 100644 --- a/tpl/assetedit.tpl +++ b/tpl/assetedit.tpl @@ -9,7 +9,7 @@ {$lang_cancel} - + diff --git a/tpl/assigniptonode.tpl b/tpl/assigniptonode.tpl index c70afbb..78a8a94 100644 --- a/tpl/assigniptonode.tpl +++ b/tpl/assigniptonode.tpl @@ -9,7 +9,7 @@ {$lang_cancel} - + diff --git a/tpl/nat.tpl b/tpl/nat.tpl index e09a518..0cbacf5 100644 --- a/tpl/nat.tpl +++ b/tpl/nat.tpl @@ -1,6 +1,7 @@ diff --git a/tpl/natedit.tpl b/tpl/natedit.tpl index c12ddf2..db840db 100644 --- a/tpl/natedit.tpl +++ b/tpl/natedit.tpl @@ -8,7 +8,7 @@
+ {$lang_nat_rules} ({$nats|@count}) diff --git a/tpl/natdel.tpl b/tpl/natdel.tpl index 86629b2..7ce2d48 100644 --- a/tpl/natdel.tpl +++ b/tpl/natdel.tpl @@ -7,9 +7,9 @@ {$lang_nat} - {$lang_cancel} + {$lang_cancel} {if $nat_options} - + {/if}
{$lang_cancel} - +
diff --git a/tpl/options.tpl b/tpl/options.tpl index cf8b70b..af77b4b 100644 --- a/tpl/options.tpl +++ b/tpl/options.tpl @@ -32,6 +32,11 @@ {$lang_users} + + + Import + + {/if} diff --git a/tpl/vlan.tpl b/tpl/vlan.tpl index b7e0877..7319e41 100644 --- a/tpl/vlan.tpl +++ b/tpl/vlan.tpl @@ -6,7 +6,7 @@ {if $suser_add || $suser_admin} - {$lang_vlan_add} + {$lang_vlan_add} {/if} diff --git a/tpl/vlanadd.tpl b/tpl/vlanadd.tpl index e8bcaef..f8514f3 100644 --- a/tpl/vlanadd.tpl +++ b/tpl/vlanadd.tpl @@ -7,7 +7,7 @@ {$lang_cancel} - + diff --git a/tpl/vlanview.tpl b/tpl/vlanview.tpl index abceb80..93f425f 100644 --- a/tpl/vlanview.tpl +++ b/tpl/vlanview.tpl @@ -6,13 +6,13 @@ {if $suser_add} - {$lang_assignvlantosubnet} + {$lang_assignvlantosubnet} {/if} {if $suser_edit} - {$lang_vlan_edit} + {$lang_vlan_edit} {/if} {if $suser_delete} - {$lang_vlan_del} + {$lang_vlan_del} {/if} @@ -69,7 +69,7 @@ {if $suser_edit} - {$lang_subnetvlan_edit} + {$lang_subnetvlan_edit} {/if} diff --git a/tpl/zoneadd.tpl b/tpl/zoneadd.tpl index 3e58db1..f2fa603 100644 --- a/tpl/zoneadd.tpl +++ b/tpl/zoneadd.tpl @@ -7,7 +7,7 @@ {$lang_cancel} - + diff --git a/tpl/zoneedit.tpl b/tpl/zoneedit.tpl index 39f17f5..c05bc24 100644 --- a/tpl/zoneedit.tpl +++ b/tpl/zoneedit.tpl @@ -9,7 +9,7 @@ {$lang_cancel} - +