Fixed some display bugs and improved icons

master
Thomas Hooge 2 years ago
parent 34112b8c1c
commit 303c22160d
  1. 2
      asset.php
  2. BIN
      images/brick_add.png
  3. BIN
      images/brick_delete.png
  4. BIN
      images/brick_edit.png
  5. BIN
      images/nat.png
  6. 0
      images/tag.png
  7. BIN
      images/tag_add.png
  8. BIN
      images/tag_delete.png
  9. BIN
      images/tag_edit.png
  10. 6
      login.php
  11. 18
      nat.php
  12. 4
      tpl/assetadd.tpl
  13. 2
      tpl/assetclass.tpl
  14. 2
      tpl/assetclassedit.tpl
  15. 2
      tpl/assetclassgroupadd.tpl
  16. 2
      tpl/assetclassgroupedit.tpl
  17. 10
      tpl/assetclassview.tpl
  18. 2
      tpl/assetedit.tpl
  19. 2
      tpl/assigniptonode.tpl
  20. 1
      tpl/nat.tpl
  21. 4
      tpl/natdel.tpl
  22. 2
      tpl/natedit.tpl
  23. 5
      tpl/options.tpl
  24. 2
      tpl/vlan.tpl
  25. 2
      tpl/vlanadd.tpl
  26. 8
      tpl/vlanview.tpl
  27. 2
      tpl/zoneadd.tpl
  28. 2
      tpl/zoneedit.tpl

@ -118,7 +118,7 @@ $smarty->assign("alphabet", $alphabet);
// total asset count // total asset count
$sth = $dbh->query("SELECT COUNT(*) FROM asset"); $sth = $dbh->query("SELECT COUNT(*) FROM asset");
$assetcount = $sth->fetchColumn(); $assetcount = $sth->fetchColumn();
$smarty->assign("assetcount", $sassetcount); $smarty->assign("assetcount", $assetcount);
// assets for current letter // assets for current letter
if (isset($_GET['bst'])) { if (isset($_GET['bst'])) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

@ -7,9 +7,6 @@ Copyright (C) 2011-2023 Thomas Hooge
SPDX-License-Identifier: GPL-3.0-or-later SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/ *****************************************************************************/
session_name('ipreg');
session_start();
if (! include("config.php")) { if (! include("config.php")) {
echo "<!DOCTYPE html><html><head><title>IP Reg</title></head><body>\n"; echo "<!DOCTYPE html><html><head><title>IP Reg</title></head><body>\n";
echo "<h1>IP Reg</h1><h2>No configuration</h2>\n"; echo "<h1>IP Reg</h1><h2>No configuration</h2>\n";
@ -19,6 +16,9 @@ if (! include("config.php")) {
exit(1); exit(1);
} }
session_name($config_app_session);
session_start();
// connect to database // connect to database
$dbh = new PDO("mysql:host=$config_mysql_host;dbname=$config_mysql_dbname;charset=utf8", $config_mysql_username, $config_mysql_password); $dbh = new PDO("mysql:host=$config_mysql_host;dbname=$config_mysql_dbname;charset=utf8", $config_mysql_username, $config_mysql_password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

@ -23,6 +23,16 @@ switch ($submit = form_get_action()) {
case 'edit': $action = ACT_EDIT; break; case 'edit': $action = ACT_EDIT; break;
case 'del': $action = ACT_DELETE; 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': case 'insert':
$node_id_ext = sanitize($_POST['node_id_ext']); $node_id_ext = sanitize($_POST['node_id_ext']);
$node_id_int = sanitize($_POST['node_id_int']); $node_id_int = sanitize($_POST['node_id_int']);
@ -39,7 +49,11 @@ switch ($submit = form_get_action()) {
case 'delete': case 'delete':
$node_id_ext = sanitize($_POST['node_id_ext']); $node_id_ext = sanitize($_POST['node_id_ext']);
$sth = $dbh->prepare("DELETE FROM nat WHERE nat_id=?"); $sth = $dbh->prepare("DELETE FROM nat WHERE nat_id=?");
try {
$sth->execute([$id]); $sth->execute([$id]);
} catch (PDOException $e) {
$g_warning->Add($e->getMessage());
}
// TODO // TODO
// header_location("node.php?f=view&id=" . $node_id_ext); // header_location("node.php?f=view&id=" . $node_id_ext);
$action = ACT_DEFAULT; $action = ACT_DEFAULT;
@ -76,7 +90,7 @@ $smarty->display("nat.tpl");
elseif ($action == ACT_ADD): elseif ($action == ACT_ADD):
// ========== VARIANT: add record ============================================= // ========== VARIANT: add record =============================================
$node_id = sanitize($_GET['node_id']); $node_id = sanitize($_REQUEST['node_id']);
// node_ext // node_ext
$sql = "SELECT node_ip AS node_ip_ext $sql = "SELECT node_ip AS node_ip_ext
@ -151,7 +165,7 @@ $smarty->display("natedit.tpl");
elseif ($action == ACT_DELETE): elseif ($action == ACT_DELETE):
// ========== VARIANT: delete record ========================================== // ========== VARIANT: delete record ==========================================
$node_id = sanitize($_GET['node_id']); $node_id = sanitize($_REQUEST['node_id']);
// node_ext // node_ext
$sth = $dbh->prepare("SELECT node_id AS id_ext, node_ip AS ip_ext FROM node WHERE node_id=?"); $sth = $dbh->prepare("SELECT node_id AS id_ext, node_ip AS ip_ext FROM node WHERE node_id=?");

@ -7,7 +7,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
<input type="image" name="submit[insert]" src="images/page_save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/> <input type="image" name="submit[insert]" src="images/save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/>
</td> </td>
</tr> </tr>
</table> </table>
@ -77,7 +77,7 @@
{$lang_assetclass_name} {$lang_assetclass_name}
</td> </td>
<td class="value"> <td class="value">
{html_options name=assetclass_id options=$assetclass_options} {html_options name=assetclass_id options=$assetclass_options selected=$assetclass_id}
</td> </td>
</tr> </tr>
</table> </table>

@ -6,7 +6,7 @@
</td> </td>
<td align="right"> <td align="right">
{if $suser_add || $suser_admin} {if $suser_add || $suser_admin}
<a href="assetclass.php?f=add"><img src="images/add.png" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_assetclass_add}" {/if}/></a> <a href="assetclass.php?f=add"><img src="images/brick_add.png" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_assetclass_add}" {/if}/></a>
{/if} {/if}
</td> </td>
</tr> </tr>

@ -9,7 +9,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
<input type="image" name="submit[update]" src="images/page_save.png" alt="{$lang_save}" {if $suser_tooltips}title="{$lang_save}" {/if}/> <input type="image" name="submit[update]" src="images/save.png" alt="{$lang_save}" {if $suser_tooltips}title="{$lang_save}" {/if}/>
</td> </td>
</tr> </tr>
</table> </table>

@ -7,7 +7,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
<input type="image" name="submit[insert]" src="images/page_save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/> <input type="image" name="submit[insert]" src="images/save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/>
</td> </td>
</tr> </tr>
</table> </table>

@ -9,7 +9,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}" {if $suser_tooltips}title="{$lang_cancel}" {/if}/></a>
<input type="image" name="submit[update]" src="images/page_save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/> <input type="image" name="submit[update]" src="images/save.png" alt="{$lang_submit}" {if $suser_tooltips}title="{$lang_submit}" {/if}/>
</td> </td>
</tr> </tr>
</table> </table>

@ -6,13 +6,13 @@
</td> </td>
<td align="right"> <td align="right">
{if $suser_add} {if $suser_add}
<a href="asset.php?f=add&assetclass_id={$assetclass->assetclass_id}"><img src="images/add.png" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_asset_add}" {/if}/></a> <a href="assetclass.php?f=add"><img src="images/brick_add.png" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_assetclass_add}" {/if}/></a>
{/if} {/if}
{if $suser_edit} {if $suser_edit}
<a href="assetclass.php?f=edit&id={$assetclass->assetclass_id}"><img src="images/edit.png" alt="{$lang_assetclass_edit}" {if $suser_tooltips}title="{$lang_asset_edit}" {/if}/></a> <a href="assetclass.php?f=edit&id={$assetclass->assetclass_id}"><img src="images/brick_edit.png" alt="{$lang_assetclass_edit}" {if $suser_tooltips}title="{$lang_assetclass_edit}" {/if}/></a>
{/if} {/if}
{if $suser_delete} {if $suser_delete}
<a href="assetclass.php?f=del&id={$assetclass->assetclass_id}"><img src="images/delete.png" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_asset_delete}" {/if}/></a> <a href="assetclass.php?f=del&id={$assetclass->assetclass_id}"><img src="images/brick_delete.png" alt="{$lang_assetclass_add}" {if $suser_tooltips}title="{$lang_assetclass_del}" {/if}/></a>
{/if} {/if}
</td> </td>
</tr> </tr>
@ -73,7 +73,9 @@
{$lang_assets} {$lang_assets}
</td> </td>
<td class="header_right"> <td class="header_right">
&nbsp; {if $suser_add}
<a href="asset.php?f=add&assetclass_id={$assetclass->assetclass_id}"><img src="images/add.png" alt="{$lang_asset_add}" {if $suser_tooltips}title="{$lang_asset_add}" {/if}/></a>
{/if}
</td> </td>
</tr> </tr>
<tr> <tr>

@ -9,7 +9,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"></a>
<input type="image" name="submit[update]" src="images/page_save.png" alt="{$lang_submit}"> <input type="image" name="submit[update]" src="images/save.png" alt="{$lang_submit}">
</td> </td>
</tr> </tr>
</table> </table>

@ -9,7 +9,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a>
<input type="image" name="submit[link]" src="images/fastforward" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}> <input type="image" name="submit[link]" src="images/fastforward.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}>
</td> </td>
</tr> </tr>
</table> </table>

@ -1,6 +1,7 @@
<table class="title"> <table class="title">
<tr> <tr>
<td class="header"> <td class="header">
<img class="icon" src="images/nat.png" alt="" />
{$lang_nat_rules} ({$nats|@count}) {$lang_nat_rules} ({$nats|@count})
</td> </td>
<td align="right"> <td align="right">

@ -7,9 +7,9 @@
{$lang_nat} {$lang_nat}
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="image.php?icon=back" alt="{$lang_cancel}"></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"></a>
{if $nat_options} {if $nat_options}
<input type="image" name="submit[delete]" src="image.php?icon=delete" alt="{$lang_submit}"> <input type="image" name="submit[delete]" src="images/delete.png" alt="{$lang_submit}">
{/if} {/if}
</td> </td>
</tr> </tr>

@ -8,7 +8,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a>
<input type="image" name="submit[next]" src="images/fastforward.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_cancel}"{/if}> <input type="image" name="submit[next]" src="images/fastforward.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}>
</td> </td>
</tr> </tr>
</table> </table>

@ -32,6 +32,11 @@
<a href="user.php">{$lang_users}</a> <a href="user.php">{$lang_users}</a>
</td> </td>
</tr> </tr>
<tr>
<td class="label">
<a href="import.php">Import</a>
</td>
</tr>
{/if} {/if}
</table> </table>

@ -6,7 +6,7 @@
</td> </td>
<td align="right"> <td align="right">
{if $suser_add || $suser_admin} {if $suser_add || $suser_admin}
<a href="vlan.php?f=add"><img src="images/add.png" alt="{$lang_vlan_add}" {if $suser_tooltips}title="{$lang_vlan_add}" {/if}/></a> <a href="vlan.php?f=add"><img src="images/tag_add.png" alt="{$lang_vlan_add}" {if $suser_tooltips}title="{$lang_vlan_add}" {/if}/></a>
{/if} {/if}
</td> </td>
</tr> </tr>

@ -7,7 +7,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a>
<input type="image" name="submit[insert]" src="images/page_save.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}> <input type="image" name="submit[insert]" src="images/save.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}>
</td> </td>
</tr> </tr>
</table> </table>

@ -6,13 +6,13 @@
</td> </td>
<td align="right"> <td align="right">
{if $suser_add} {if $suser_add}
<a href="assignvlantosubnet.php?vlan_id={$vlan->id}"><img src="images/add.png" alt="{$lang_assignvlantosubnet}"{if $suser_tooltips} title="{$lang_assignvlantosubnet}"{/if}></a> <a href="assignvlantosubnet.php?vlan_id={$vlan->id}"><img src="images/tag_add.png" alt="{$lang_assignvlantosubnet}"{if $suser_tooltips} title="{$lang_assignvlantosubnet}"{/if}></a>
{/if} {/if}
{if $suser_edit} {if $suser_edit}
<a href="vlan.php?f=edit&id={$vlan->id}"><img src="images/edit.png" alt="{$lang_vlan_edit}"{if $suser_tooltips} title="{$lang_vlan_edit}"{/if}></a> <a href="vlan.php?f=edit&id={$vlan->id}"><img src="images/tag_edit.png" alt="{$lang_vlan_edit}"{if $suser_tooltips} title="{$lang_vlan_edit}"{/if}></a>
{/if} {/if}
{if $suser_delete} {if $suser_delete}
<a href="vlan.php?f=del&id={$vlan->id}"><img src="images/delete.png" alt="{$lang_vlan_del}"{if $suser_tooltips} title="{$lang_vlan_del}"{/if}></a> <a href="vlan.php?f=del&id={$vlan->id}"><img src="images/tag_delete.png" alt="{$lang_vlan_del}"{if $suser_tooltips} title="{$lang_vlan_del}"{/if}></a>
{/if} {/if}
</td> </td>
</tr> </tr>
@ -69,7 +69,7 @@
</td> </td>
<td class="header" align="right"> <td class="header" align="right">
{if $suser_edit} {if $suser_edit}
<a href="vlan.php?f=sedit&id={$vlan->id}"><img src="image.php?icon=edit" alt="{$lang_subnetvlan_edit}"></a> <a href="vlan.php?f=sedit&id={$vlan->id}"><img src="images/edit.png" alt="{$lang_subnetvlan_edit}"></a>
{/if} {/if}
</td> </td>
</tr> </tr>

@ -7,7 +7,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a>
<input type="image" name="submit[insert]" src="images/page_save.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}> <input type="image" name="submit[insert]" src="images/save.png" alt="{$lang_submit}"{if $suser_tooltips} title="{$lang_submit}"{/if}>
</td> </td>
</tr> </tr>
</table> </table>

@ -9,7 +9,7 @@
</td> </td>
<td align="right"> <td align="right">
<a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a> <a href="#" onClick="history.go(-1)"><img src="images/rewind.png" alt="{$lang_cancel}"{if $suser_tooltips} title="{$lang_cancel}"{/if}></a>
<input type="image" name="submit[update]" src="images/page_save.png" alt="{$lang_save}"{if $suser_tooltips} title="{$lang_submit}"{/if}> <input type="image" name="submit[update]" src="images/save.png" alt="{$lang_save}"{if $suser_tooltips} title="{$lang_submit}"{/if}>
</td> </td>
</tr> </tr>
</table> </table>