From 303c22160df6821a1956e67f52cbdf5965d89593 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Tue, 14 Mar 2023 18:58:28 +0100 Subject: [PATCH] Fixed some display bugs and improved icons --- asset.php | 2 +- images/brick_add.png | Bin 0 -> 841 bytes images/brick_delete.png | Bin 0 -> 792 bytes images/brick_edit.png | Bin 0 -> 849 bytes images/nat.png | Bin 0 -> 744 bytes images/{tag-blue.png => tag.png} | Bin images/tag_add.png | Bin 0 -> 822 bytes images/tag_delete.png | Bin 0 -> 770 bytes images/tag_edit.png | Bin 0 -> 802 bytes login.php | 6 +++--- nat.php | 20 +++++++++++++++++--- tpl/assetadd.tpl | 4 ++-- tpl/assetclass.tpl | 2 +- tpl/assetclassedit.tpl | 2 +- tpl/assetclassgroupadd.tpl | 2 +- tpl/assetclassgroupedit.tpl | 2 +- tpl/assetclassview.tpl | 10 ++++++---- tpl/assetedit.tpl | 2 +- tpl/assigniptonode.tpl | 2 +- tpl/nat.tpl | 1 + tpl/natdel.tpl | 4 ++-- tpl/natedit.tpl | 2 +- tpl/options.tpl | 5 +++++ tpl/vlan.tpl | 2 +- tpl/vlanadd.tpl | 2 +- tpl/vlanview.tpl | 8 ++++---- tpl/zoneadd.tpl | 2 +- tpl/zoneedit.tpl | 2 +- 28 files changed, 52 insertions(+), 30 deletions(-) create mode 100644 images/brick_add.png create mode 100644 images/brick_delete.png create mode 100644 images/brick_edit.png create mode 100644 images/nat.png rename images/{tag-blue.png => tag.png} (100%) create mode 100644 images/tag_add.png create mode 100644 images/tag_delete.png create mode 100644 images/tag_edit.png 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 0000000000000000000000000000000000000000..2d5f7c4f6e515d64693466733303b084393db834 GIT binary patch literal 841 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2v2c#_Rx}5LfpCpA{=sm}N--5sY15`mnKE_iRPSQrs491$$^ZZVzj*QD-@ku%@7{gu)~#y?K3}_b?ZANp zpFe*-e*8Gl*o_-E9zJ~d%$YOKpFjWj@#B*xPww8m3v}C!8#f+2cmQeb7aFCRU6^!M-IK(Af8bm{u_>xJh# zX0GlloEmff{Q1etJ5qc78dfE2xiTfT&Go{wUGW|68!z|w?au64SiAAs#Jzj>dRG~Q z_33o)N!fN~wso#t*RDjfwX528#@~D&st=5tijp9|V1^$ZpME|0*LMH!cd^vlY`a^3 ziUFPSd%o0r?PW`UfB5&o?ZdtwM^--W0R|Ek!KdQAo6>=9_~7Z{7$R{wIe~$(EX>R- ztc=Y%w=Un1%+ub_SH<@`!m!L*w_L`-l>D(y>Mg|?$u9?}=mKIi4 z5;u<@v-ULZxLL6)L$djd!8IdejR~m&rafDVwq3h=?b=qq3l}{nCJPvD;ovv^bm5Yb z@kK*}g1`g;Gag=^jaRlBUe(;N&Fn)!k^m2v!FHa$3+5aAy!=j|2~K>V|6#kq_Dfgw zJ$%ofIHenu{^0RL(}MEiYu8VnJ9%B_+cTzJJ<$%AuAaTSW&=yc)_(aLUxSQ3&0}4f zDmqIvK~!PEiZ!dAJ$?Q7_0q-OLj$=)0=Yy2y-WlD|Nqg^(f$4XySuyE+S=B@^VZhZz`(%s^Yh2Y$E&NWv9Ynk z!^6zX%;)Fl@$vEG&d$#3>+9&~ z=*`W|%gf8e#Khy{hSRJ;o;%m-{0=;?&<02)z#J0)6=S|s{8x< z+uPgH($dAn#n;!@z*9QU&(Fe-bh&f{z*-`?QybBAI=n#y!HR3TQWw3wz4x_@_O*<> zLIk!>6aLMv{?@qvkxcZQV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P;1t~jGcqtVHPqKumgi`N zCPew$3qwp(Q!UDlmsenrm4X_tqFj)fD5Jz6rwHP;G*=WCYPp9bM~6qaNCE{Kfre-K z_M6)adWUX;zn`0C_fXL=eRhq ac^LpY`6U)j$85I%0000D4g)#~ z=n|j^q&wC&L{r&s*ojZ3fU%m`<*o)7lfGIx#h|fpx-xM?)R=Th;Mhl z@NCz{YZGnr6t-QN-M2flae8raUrN`m#IQb{?ma1|_wH%i8NarO#Sa)gl_f!b!3?6J zqTfYDdpbUy{U-X;_S++C>u=WIM8ACl(xMjMEP#Z(959%u4Mdyfh13BZansYqF+}2W zazV+Z;tN+pl9L)3%R>bW!jfA#U#!f^UbT8v*6j_BtRNRvgJ=CAmZb%W5pEtE;&~0=hy2 zxkLiFL;}4`1O5H|&CSi=;NZ^A&f?l`}6bj)6>)F^ZV=T z>-_xu>FMeE`ud5_{)o>0=kxpM=;-S8{nP9F+}zxm)&G~&|CQAL=jZ3Zz`*6@<=WcX zy}iBJ+1ZHB|Ao!{o7Vrixw*RG{ic_c)$IGFmX*+SJhip8x?3o;RwLKf*S&>jyi^(Y zwT$+)jP#sh=5`>xRT{W}Vd{7U{>`rb*0}$LApdp{^`~+Fei#3dO!##G?sWj`i9hdt z7vX0D-D3b7F0f<(001m>QchC<70vb)6%~5^75P2(;yXL`JN6a!J3ICjIQA7d_Bi$x z9(erU{2$(J4HV%M2+}dKwzaZ}Pu9uKPymYX3q^uN5>qnm zii*`h#t4c;>lh`ZrRSAZs%n635*4@5NzKZyt|+flhd4$|%0S1i)Y#a#o&)M$Nm;$z zf~uO@22GfkWaM*{3riZc+2OvHQ&dvn&|+r*034SpUmWn1-T(jq07*qoM6N<$f-8%! ACIA2c literal 0 HcmV?d00001 diff --git a/images/tag_edit.png b/images/tag_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..84e24f94daa9ffab3fc499a8997fe332fbfdab86 GIT binary patch literal 802 zcmV+-1Ks?IP)Z#l*zK%F4>h z%F3#$s>{pE$jHdY$H&OX$iu_K!NI}Nlq$f$z^kjP$BRd+tE<4kz|)>(y}iA`nr^+l zy{W0Gyu7@dXdJq_y0@i*si~=gWGcOfNUoK4R6G!dUMIYaLH+&x&CSiu&d%WA;Ly;} z($do6;^O!B_kzs-yyE@V?EC%q$K>SX)z#I}(b3e@)XU4u)6>)Q^Yi=r`|IoL{QUgs z>FN6V`snlf=kxpO_5H`k$LQ$j(40ky&;E$c{=MV<)9d?{)c@Yz-tW?@+p&bh!^8jc z<^15pyRV?wq*s^J|GuuAnbrU2=jXe!rn|AE=fH~e$+G@Y8ti(|G;%!u8);m(~B})Ufs3 zUHIZ$_updV$yB$hoW++&sfa?=wt3dMb;*Q4`N@#cw~znw;Q7assb(U+c^TN5Q{iAL zA^-pYBy>_vQvf~oI~C3OAr%$&;`TdU6(8s!_V*PyJ0bRCJNX{_`&0M(!8R|CO8@`> z*hxe|R2b7^Ff`UQ(oj?7V1NNr6%a5`<%9`ns%WXHtEgz1us{VgR8$#Q&CFHQ?fD@B zYAWh%+}buSD(+sQU;$MX6-#Y9Cmmgt=omjwM?MB73l(cyXScva-LTjMZx2BRMlLHA zR~`SP^ql@qk^_VwR!hsYS2s3P76r3I9VgY+)l^ef5(48hw08IRwGIP 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} - +