]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Forward Firewall: moved ruleaction-dropdown from top to target area.
authorAlexander Marx <amarx@ipfire.org>
Wed, 13 Mar 2013 07:50:32 +0000 (08:50 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:11:55 +0000 (14:11 +0200)
some layout changes in forwardfw.cgi (when no alias exists, the dropdown after ipfire is not shown)

html/cgi-bin/forwardfw.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 1f3d6a9a600230c9cd9dfa4a761a1010283e5d25..5339f9e67dcb5b5efc278337827d75399258e97a 100755 (executable)
@@ -1388,7 +1388,7 @@ sub newrule
        $selected{'TIME_FROM'}{$fwdfwsettings{'TIME_FROM'}}             = 'selected';
        $selected{'TIME_TO'}{$fwdfwsettings{'TIME_TO'}}                 = 'selected';
        $selected{'ipfire'}{$fwdfwsettings{$fwdfwsettings{'grp2'}}} ='selected';
-       
+
        #check if update and get values
        if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on' && !$errormessage){
                &General::readhasharray("$config", \%hash);
@@ -1482,32 +1482,7 @@ sub newrule
                $fwdfwsettings{'TIME_FROM'} = &timeconvert($fwdfwsettings{'TIME_FROM'},'');
                $fwdfwsettings{'TIME_TO'} = &timeconvert($fwdfwsettings{'TIME_TO'},'');
        }
-print <<END;
-       <form method="post">
-       <table border='0'>
-       <tr><td nowrap>$Lang::tr{'fwdfw rule action'}</td><td><select name='RULE_ACTION'>
-END
-       foreach ("ACCEPT","DROP","REJECT")
-       {
-               if($fwdfwsettings{'updatefwrule'} eq 'on'){
-                       print"<option ";
-                       print "selected='selected'" if ($fwdfwsettings{'RULE_ACTION'} eq $_);
-                       print">$_</option>";
-               }else{
-                       if($fwdfwsettings{'POLICY'} eq 'MODE2'){
-                               $fwdfwsettings{'RULE_ACTION'} = 'DROP';
-                       }
-       
-                       if ($_ eq $fwdfwsettings{'RULE_ACTION'})
-                       {
-                               print"<option selected>$_</option>";
-                       }else{
-                               print"<option>$_</option>";
-                       }
-               }
-       }
-       print"</select></td></tr></table><hr>"; 
-
+print "<form method='post'>";
        &Header::closebox();
        &Header::openbox('100%', 'left', $Lang::tr{'fwdfw source'});
        #------SOURCE-------------------------------------------------------
@@ -1518,7 +1493,6 @@ END
                </table>
 END
        &gen_dd_block('src','grp1');
-
                print<<END;
                <tr><td colspan='8'><hr style='border:dotted #BFBFBF; border-width:1px 0 0 0 ; ' /></td></tr></table>
                <table width='100%' border='0'>
@@ -1557,13 +1531,18 @@ END
                &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'});
                print<<END;
                <table width='100%' border='0'> 
-               <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr'  checked></td><td colspan='2'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16'><td><input type='radio' name='grp2' value='ipfire'  $checked{'grp2'}{'ipfire'}></td><td><b>IPFire ($Lang::tr{'external access'})</b></td><td align='right'><select name='ipfire' style='width:200px;'>
+               <tr><td width='1%'><input type='radio' name='grp2' value='tgt_addr'  checked></td><td width='57%' nowrap='nowrap'>$Lang::tr{'fwdfw targetip'}<input type='TEXT' name='tgt_addr' value='$fwdfwsettings{'tgt_addr'}' size='16'><td width='1%'><input type='radio' name='grp2' value='ipfire'  $checked{'grp2'}{'ipfire'}></td><td><b>IPFire</b></td>
 END
-               print "<option value='Default IP' $selected{'ipfire'}{'Default IP'}>Default IP</option>";
+               if (! -z "${General::swroot}/ethernet/aliases"){
+                       print"<td align='right'><select name='ipfire' style='width:200px;'>";
+                       print "<option value='Default IP' $selected{'ipfire'}{'Default IP'}>Default IP</option>";
 
-               foreach my $alias (sort keys %aliases)
-               {
-                       print "<option value='$alias' $selected{'ipfire'}{$alias}>$alias</option>";
+                       foreach my $alias (sort keys %aliases)
+                       {
+                               print "<option value='$alias' $selected{'ipfire'}{$alias}>$alias</option>";
+                       }
+               }else{
+                       print"<td style='width:200px;'>";
                }
                print<<END;
                </td></tr>
@@ -1633,8 +1612,28 @@ END
                &Header::openbox('100%', 'left', $Lang::tr{'fwdfw additional'});
                print<<END;
                <table width='100%' border='0'>
-               <tr><td width='12%'>$Lang::tr{'remark'}:</td><td align='left'><input type='text' name='ruleremark' size='40' maxlength='255' value='$fwdfwsettings{'ruleremark'}'></td></tr>
+               <tr><td nowrap>$Lang::tr{'fwdfw rule action'}</td><td><select name='RULE_ACTION'>
 END
+               foreach ("ACCEPT","DROP","REJECT")
+               {
+                       if($fwdfwsettings{'updatefwrule'} eq 'on'){
+                               print"<option value='$_'";
+                               print "selected='selected'" if ($fwdfwsettings{'RULE_ACTION'} eq $_);
+                               print">$Lang::tr{'fwdfw '.$_}</option>";
+                       }else{
+                               if($fwdfwsettings{'POLICY'} eq 'MODE2'){
+                                       $fwdfwsettings{'RULE_ACTION'} = 'DROP';
+                               }
+                               if ($_ eq $fwdfwsettings{'RULE_ACTION'})
+                               {
+                                       print"<option selected>$Lang::tr{'fwdfw '.$_}</option>";
+                               }else{
+                                       print"<option>$Lang::tr{'fwdfw '.$_}</option>";
+                               }
+                       }
+               }
+               print"</select></td></tr>";     
+               print"<tr><td width='12%'>$Lang::tr{'remark'}:</td><td align='left'><input type='text' name='ruleremark' size='40' maxlength='255' value='$fwdfwsettings{'ruleremark'}'></td></tr>";
                if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on'){
                        print "<tr><td width='12%'>$Lang::tr{'fwdfw rulepos'}:</td><td><select name='rulepos' >";
                        for (my $count =1; $count <= $sum; $count++){ 
index 267737a8a17fbe2a165a3ea909fbf2ea13da6eaa..6aec69d90bc08c968302fe1b6df55d79563d8a39 100644 (file)
 'forwarding rule removed' => 'Weiterleitungsregel entfernt. Starte Weiterleitung neu',
 'forwarding rule updated' => 'Weiterleitungsregel aktualisiert; starte Weiterleitung neu',
 'forward firewall'             => 'Firewall',
+'fwdfw ACCEPT'                 => 'Akzeptieren (ACCEPT)',
 'fwdfw additional'             => 'Zusätzlich',
 'fwdfw action'                 => 'Aktion',
 'fwdfw menu'                   => 'Firewall',
 'fwdfw cust net'               => 'Custom Netzwerke:',
 'fwdfw copy'                   => 'Kopieren',
 'fwdfw delete'                 => 'Löschen',
+'fwdfw DROP'                   => 'Verwerfen (DROP)',
 'fwdfw edit'                   => 'Bearbeiten',
 'fwdfw err nosrc'              => 'Keine Quelle gewählt',
 'fwdfw err nosrcip'            => 'Bitte Quell IP-Adresse angeben',
 'fwdfw pol text'               => 'Standardverhalten für Verbindungen aus den lokalen Netzwerken. Bei "Zugelassen" werden sämtliche Verbindungen zugelassen mit Ausnahme der konfigurierten Regeln. Mit "Blockiert" werden alle Verbindungsversuche blockiert, mit Ausnahme erstellten Regeln. Außerdem werden hier der externe Zugang und der Zugriff auf die DMZ geregelt.',
 'fwdfw pol text1'              => 'Standardverhalten für Verbindungen von IPFire. Bei "Zugelassen" werden sämtliche Verbindungen zugelassen mit Ausnahme konfigurierten Regeln. Mit "Blockiert" werden alle Verbindungsversuche blockiert, mit Ausnahme der erstellten Regeln.Achtung! Mit diesen Einstellungen kann man sich aussperren. Normalerweise ist keine Änderung nötig.',
 'fwdfw red'                            => 'INTERNET',
+'fwdfw REJECT'                 => 'Verweigern (REJECT)',
 'fwdfw reread'                 => 'Übernehmen',
 'fwdfw rules'                  => 'Regeln',
 'fwdfw rule action'    => 'Regelaktion:',
index 48fa3ae830375359d4a91b595ce5e779a4502ea5..0e875bc88033f7c921037e30f6bb8fa457165c2c 100644 (file)
 'forwarding rule removed' => 'Forwarding rule removed; restarting forwarder',
 'forwarding rule updated' => 'Forwarding rule updated; restarting forwarder',
 'forward firewall'             => 'Firewall',
+'fwdfw ACCEPT'                 => 'ACCEPT',
 'fwdfw additional'             => 'Additional',
 'fwdfw action'                 => 'Action',
 'fwdfw menu'                   => 'Firewall',
 'fwdfw cust net'               => 'Custom networks:',
 'fwdfw copy'                   => 'Copy',
 'fwdfw delete'                 => 'Delete',
+'fwdfw DROP'                   => 'DROP',
 'fwdfw edit'                   => 'Edit',
 'fwdfw err nosrc'              => 'No source selected.',
 'fwdfw err nosrcip'            => 'Please provide source IP address.',
 'fwdfw pol text'               => 'Default behavior for connections from local networks. "Allowed" allows all connections from local networks except the defined rules. "Blocked" prohibits all connections except the defined ones. Also external access and connections to/from the demilitarized zone are configurable here.',
 'fwdfw pol text1'              => 'Default behavior for connections from IPFire. "Allowed" allows all connections from local networks except the defined rules. "Blocked" prohibits all connections except the defined ones. Attention! You can lock yourself out with these settings. Normally there is no need to change anything here.',
 'fwdfw red'                            => 'INTERNET',
+'fwdfw REJECT'                 => 'REJECT',
 'fwdfw reread'                 => 'Apply',
 'fwdfw rules'                  => 'Rules',
 'fwdfw rule action'    => 'Rule action:',