From cd9d9d8a13405e380ad0422d2b47f48d9ef1f8a4 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Wed, 13 Feb 2013 13:31:55 +0100 Subject: [PATCH] Forward Firewall: added "apply" button to groupmanagement. Now the user can make all changes and finally click apply button to reread firewallrules. Also added a comment in de.pl and en.pl which should remiond the user to click the button. --- html/cgi-bin/forwardfw.cgi | 2 +- html/cgi-bin/fwhosts.cgi | 25 +++++++++++++++++++++++-- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index 3026e00ab..9f89fe7fe 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -552,7 +552,7 @@ sub addrule print ""; print ""; if (-f "${General::swroot}/forward/reread"){ - print ""; + print ""; } print"
$Lang::tr{'fwhost reread'}

"; diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index face57b32..636cf65e4 100755 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -80,6 +80,11 @@ unless (-e $configsrvgrp) { system("touch $configsrvgrp"); } &Header::openbigbox('100%', 'center'); ## ACTION #### +if ($fwhostsettings{'ACTION'} eq $Lang::tr{'fwdfw reread'}) +{ + &reread_rules; + &showmenu; +} # Update if ($fwhostsettings{'ACTION'} eq 'updatenet' ) { @@ -1003,9 +1008,15 @@ sub showmenu -

+
END + + if (-f "${General::swroot}/fwhosts/reread"){ + print "$Lang::tr{'fwhost reread'}"; + } + print""; + &Header::closebox(); } @@ -1876,10 +1887,20 @@ sub getipforgroup } } sub rules +{ + if (!-f "${General::swroot}/fwhosts/reread"){ + system("touch ${General::swroot}/fwhosts/reread"); + } +} +sub reread_rules { system ("/usr/local/bin/forwardfwctrl"); - system("rm ${General::swroot}/forward/reread"); + if ( -f "${General::swroot}/fwhosts/reread"){ + system("rm ${General::swroot}/fwhosts/reread"); + } + } + sub decrease { my $grp=$_[0]; diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index d2c1f0383..141145eae 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1018,6 +1018,7 @@ 'fwhost ovpn_n2n' => 'OpenVPN N-2-N', 'fwhost port' => 'Port(s)', 'fwhost prot' => 'Protokoll', +'fwhost reread' => 'Die Firewallregeln müssen neu eingelesen werden. Bitte Übernehmen klicken.', 'fwhost reset' => 'Abbrechen', 'fwhost services' => 'Dienste', 'fwhost srv_name' => 'Dienstname', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 955d3cfbf..1d0c3e7cf 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1045,6 +1045,7 @@ 'fwhost ovpn_n2n' => 'OpenVPN N-2-N', 'fwhost port' => 'Port(s)', 'fwhost prot' => 'Protocol', +'fwhost reread' => 'Firewallrules need to be updated. Please click applybutton.', 'fwhost reset' => 'Cancel', 'fwhost services' => 'Services', 'fwhost srv_name' => 'Servicename', @@ -2480,7 +2481,6 @@ 'wlan client wpa mode tkip tkip' => 'TKIP-TKIP', 'wlanap access point' => 'Access Point', 'wlanap channel' => 'Channel', -'wlanap country' => 'Country Code', 'wlanap debugging' => 'Debugging', 'wlanap del interface' => 'Remove selected interface?', 'wlanap encryption' => 'Encryption', -- 2.39.2