Forward Firewall: added new line at bottom of all ruletables with the "final rule"
authorAlexander Marx <amarx@ipfire.org>
Thu, 27 Jun 2013 05:28:06 +0000 (07:28 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:15:30 +0000 (14:15 +0200)
html/cgi-bin/forwardfw.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index e3ea5bdb1441a2082a129d39fd7ba70b60c85a1d..0725e2542c7af3a470e2d7882a6574d9d2b7bd85 100755 (executable)
@@ -75,7 +75,7 @@ my %aliases=();
 my %optionsfw=();
 my %ifaces=();
 
-my $VERSION='0.9.9.8';
+my $VERSION='0.9.9.9';
 my $color;
 my $confignet          = "${General::swroot}/fwhosts/customnetworks";
 my $confighost         = "${General::swroot}/fwhosts/customhosts";
@@ -2319,20 +2319,61 @@ END
                                        my $weekdays=join(",",@days);
                                        if (@days){
                                                print"<tr bgcolor='$color'>";
-                                               print"<td>&nbsp</td><td bgcolor='$rulecolor'></td><td align='left' colspan='10'>$weekdays &nbsp $$hash{$key}[26] - $$hash{$key}[27] </td></tr>";
+                                               print"<td>&nbsp</td><td bgcolor='$rulecolor'></td><td align='left' colspan='10'>&nbsp $weekdays &nbsp $$hash{$key}[26] - $$hash{$key}[27] </td></tr>";
                                        }
                                }
                        }
                        print"<tr bgcolor='FFFFFF'><td colspan='13' height='1'></td></tr>";
                }
+               my $col;
+               if ($config eq '/var/ipfire/forward/config'){
+                       my $pol='fwdfw '.$fwdfwsettings{'POLICY'};
+                       if ($fwdfwsettings{'POLICY'} eq 'MODE1'){
+                               $col="bgcolor='darkred'";
+                       }else{
+                               $col="bgcolor='green'";
+                       }
+                       print"<tr><td colspan='13' $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{$pol}</font></td></tr>";
+               }elsif ($config eq '/var/ipfire/forward/outgoing'){
+                       my $pol='fwdfw '.$fwdfwsettings{'POLICY1'};
+                       if ($fwdfwsettings{'POLICY1'} eq 'MODE1'){
+                               $col="bgcolor='darkred'";
+                       }else{
+                               $col="bgcolor='green'";
+                       }
+                       print"<tr><td colspan='13' $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{$pol}</font></td></tr>";
+               }else{
+                       print"<tr><td colspan='13' bgcolor='darkred' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{'fwdfw MODE1'}</font></td></tr>";
+               }
                print"</table>";
-               &Header::closebox();
                print "<hr>";
                print "<br><br>";
+               &Header::closebox();
        }else{
                if ($optionsfw{'SHOWTABLES'} eq 'on'){
                        print "<b>$title1</b><br>";
-                       print"<table width='100%' border='0' rules='none'><tr><td height='30' bgcolor=$color{'color22'} align='center'>$Lang::tr{'fwhost empty'}</td></tr></table><br><br>";
+                       print"<table width='100%' border='0' rules='none'><tr><td height='30' bgcolor=$color{'color22'} align='center'>$Lang::tr{'fwhost empty'}</td></tr>";
+                       my $col;
+                       if ($config eq '/var/ipfire/forward/config'){
+                               my $pol='fwdfw '.$fwdfwsettings{'POLICY'};
+                               if ($fwdfwsettings{'POLICY'} eq 'MODE1'){
+                                       $col="bgcolor='darkred'";
+                               }else{
+                                       $col="bgcolor='green'";
+                               }
+                               print"<tr><td colspan='13' $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{$pol}</font></td></tr>";
+                       }elsif ($config eq '/var/ipfire/forward/outgoing'){
+                               my $pol='fwdfw '.$fwdfwsettings{'POLICY1'};
+                               if ($fwdfwsettings{'POLICY1'} eq 'MODE1'){
+                                       $col="bgcolor='darkred'";
+                               }else{
+                                       $col="bgcolor='green'";
+                               }
+                               print"<tr><td colspan='13' $col align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{$pol}</font></td></tr>";
+                       }else{
+                               print"<tr><td colspan='13' bgcolor='darkred' align='center'><font color='#FFFFFF'>$Lang::tr{'fwdfw final_rule'} $Lang::tr{'fwdfw MODE1'}</font></td></tr>";
+                       }
+                       print"</table><br><br>";
                }
        }
 }
index 9587258f90436b9669b6ebd7fc3432fbef1349e0..0445dda97481856ce0f851e9e53002b7476f3d67 100644 (file)
 'fwdfw err tgt_grp'            => 'Ziel-Dienstgruppe ist leer',
 'fwdfw err time'               => 'Es muss mindestens ein Tag gewählt werden',
 'fwdfw from'                   => 'Von:',
+'fwdfw final_rule'             => 'Letzte Regel: ',
 'fwdfw hint ip1'               => 'Die zuletzt erzeugte Regel wird vielleicht nicht aktiviert, weil Quelle und Ziel evtl im selben Netz sind',
 'fwdfw hint ip2'               => 'Bitte überprüfen Sie ob diese Regel Sinn macht: ',
 'fwdfw ipsec network'  => 'IPsec Netzwerke:',
 'fwdfw man port'               => 'Port(s) manuell:',
 'fwdfw moveup'                 => 'Hoch',
 'fwdfw movedown'               => 'Runter',
+'fwdfw MODE1'                  => 'Alle Pakete verwerfen',
+'fwdfw MODE2'                  => 'Alle Pakete annehmen',
 'fwdfw p2p txt'                        => 'Hier können einzelne P2P Netzwerke erlaubt oder verboten werden. Das System setzt die Regeln automatisch unabhängig vom aktuellen Firewall Modus. Unter Umständen können einzelne aktivierte P2P Netzewerke einen erheblichen Teil der Bandbreite beanspruchen.',
 'fwdfw pol allow'              => 'Zugelassen',
 'fwdfw pol block'              => 'Blockiert',
index d66c202c5275c14514395b1e8c6cfba57a30dd36..37c3b12572cfc0593cad4b57edfa3f82ff0732f1 100644 (file)
 'fwdfw err tgt_grp'            => 'Target servicegroup is empty',
 'fwdfw err time'               => 'You have to define at least one day.',
 'fwdfw from'                   => 'From:',
+'fwdfw final_rule'             => 'Last rule: ',
 'fwdfw hint ip1'               => 'The last generated rule may never be activated because source and target probably are in same subnet.',
 'fwdfw hint ip2'               => 'Please doublecheck if this rule makes sense: ',
 'fwdfw ipsec network'  => 'IpSec networks:',
 'fwdfw man port'               => 'Port(s) manual:',
 'fwdfw moveup'                 => 'Move up',
 'fwdfw movedown'               => 'Move down',
+'fwdfw MODE1'                  => 'Drop all packets',
+'fwdfw MODE2'                  => 'Accept all packets',
 'fwdfw p2p txt'                        => 'Here you can admit or deny or allow single p2p networks. Just define which networks are allowed or denied and the system takes care of the rules depending on the firewall mode. An allowed p2p network may use a lot of bandwith.',
 'fwdfw pol allow'              => 'Allowed',
 'fwdfw pol block'              => 'Blocked',