X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ffirewall.cgi;h=8b02b04467546a8ea728dd772f4b9d929c782dfd;hp=29b70b442c1300e9ac8a58dfc02d3939b9b38eda;hb=f4d5310decf8cd8f16d92bfe0457cc8fb87fc663;hpb=4234ca5d64f8e34c40ee48c58599f00cb3a15862 diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 29b70b442..8b02b0446 100755 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -1426,6 +1426,11 @@ sub newrule open (CONN1,"/var/ipfire/red/local-ipaddress"); my $redip = ; close(CONN1); + if (! $fwdfwsettings{'RULE_ACTION'} && $fwdfwsettings{'POLICY'} eq 'MODE2'){ + $fwdfwsettings{'RULE_ACTION'}='DROP'; + }elsif(! $fwdfwsettings{'RULE_ACTION'} && $fwdfwsettings{'POLICY'} eq 'MODE1'){ + $fwdfwsettings{'RULE_ACTION'}='ACCEPT'; + } $checked{'grp1'}{$fwdfwsettings{'grp1'}} = 'CHECKED'; $checked{'grp2'}{$fwdfwsettings{'grp2'}} = 'CHECKED'; $checked{'grp3'}{$fwdfwsettings{'grp3'}} = 'CHECKED'; @@ -1548,6 +1553,11 @@ sub newrule } } } + # Split manual source and target address and delete the subnet + my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}}); + if ($scidr eq '32'){$fwdfwsettings{$fwdfwsettings{'grp1'}}=$sip;} + my ($dip,$dcidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp2'}}); + if ($scidr eq '32'){$fwdfwsettings{$fwdfwsettings{'grp2'}}=$dip;} &Header::openbox('100%', 'left', $Lang::tr{'fwdfw addrule'}); &Header::closebox(); &Header::openbox('100%', 'left', $Lang::tr{'fwdfw source'}); @@ -1833,23 +1843,9 @@ END END &Header::closebox; - - $checked{"RULE_ACTION"} = (); - foreach ("ACCEPT", "DROP", "REJECT") { - $checked{"RULE_ACTION"}{$_} = ""; - } - - if($fwdfwsettings{'updatefwrule'} eq 'on') { - $checked{"RULE_ACTION"}{$fwdfwsettings{'RULE_ACTION'}} = "checked"; - } elsif ($fwdfwsettings{'POLICY'} eq 'MODE1') { - $checked{"RULE_ACTION"}{"ACCEPT"} = "checked"; - } elsif ($fwdfwsettings{'POLICY'} eq 'MODE2') { - $checked{"RULE_ACTION"}{"DROP"} = "checked"; - } - + $checked{"RULE_ACTION"}{$fwdfwsettings{'RULE_ACTION'}} = 'CHECKED'; print <
-
@@ -2027,6 +2023,7 @@ END +
END