]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Forward Firewall: Bugfix: when editing an rule, the default ACTION (ACCEPT,DROP,REJEC...
authorAlexander Marx <amarx@ipfire.org>
Fri, 18 Jan 2013 09:18:25 +0000 (10:18 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:08:12 +0000 (14:08 +0200)
html/cgi-bin/forwardfw.cgi

index 8fae77123c016675fc038f88f46941694be28dc2..b2976e1c352b68c695613a6081072390773c52d8 100755 (executable)
@@ -1014,15 +1014,21 @@ print <<END;
 END
        foreach ("ACCEPT","DROP","REJECT")
        {
-               if($fwdfwsettings{'POLICY'} eq 'MODE2'){
-                       $fwdfwsettings{'RULE_ACTION'} = 'DROP';
-               }
-
-               if ($_ eq $fwdfwsettings{'RULE_ACTION'})
-               {
-                       print"<option selected>$_</option>";
+               if($fwdfwsettings{'updatefwrule'} eq 'on'){
+                       print"<option ";
+                       print "selected='selected'" if ($fwdfwsettings{'RULE_ACTION'} eq $_);
+                       print">$_</option>";
                }else{
-                       print"<option>$_</option>";
+                       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>";