open (CONN1,"/var/ipfire/red/local-ipaddress");
my $redip = <CONN1>;
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';
}
}
}
+ # 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'});
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 <<END;
<hr><br>
-
<center>
<table width="80%" border="0">
<tr>
<input type='hidden' name='oldorange' value='$fwdfwsettings{'oldorange'}' />
<input type='hidden' name='oldnat' value='$fwdfwsettings{'oldnat'}' />
<input type='hidden' name='oldruletype' value='$fwdfwsettings{'oldruletype'}' />
+ <input type='hidden' name='nat' value='$fwdfwsettings{'nat'}' />
<input type='hidden' name='ACTION' value='saverule' ></form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;'><input type='hidden' name='ACTION' value'reset'></td></td>
</table></form>
END