X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fforwardfw.cgi;h=fde7e5e8298f58fe31332fd9420ae80ec8e8eed7;hp=afd5ece35aa01ee6ba01caac30effa71e7a24bed;hb=8cdfbf5aeb365378deb2ff2b5f18a83a2fcfe82c;hpb=79bb8c75f29a5321692ae0f02b7b2ca3cbe2d94c diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index afd5ece35..fde7e5e82 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -137,13 +137,21 @@ print<
    $Lang::tr{'fwhost reread'}

"; - } + &Header::openbox('100%', 'left', $Lang::tr{'fwdfw menu'}); - print "
"; - print ""; - print ""; - print"

"; + print < + + + + +
+ + +END + + if (&General::firewall_needs_reload()) { + print < +END + } + + print < +
+ + +
+END &Header::closebox(); &viewtablerule; } @@ -569,10 +595,6 @@ sub checktarget #check DNAT settings (has to be single Host and single Port or portrange) if ($fwdfwsettings{'USE_NAT'} eq 'ON' && $fwdfwsettings{'nat'} eq 'dnat'){ if($fwdfwsettings{'grp2'} eq 'tgt_addr' || $fwdfwsettings{'grp2'} eq 'cust_host_tgt' || $fwdfwsettings{'grp2'} eq 'ovpn_host_tgt'){ - if ($fwdfwsettings{'USESRV'} eq '' && $fwdfwsettings{'dnatport'} eq ''){ - $errormessage=$Lang::tr{'fwdfw target'}.": ".$Lang::tr{'fwdfw dnat porterr'}."
"; - return $errormessage; - } #check if manual ip is a single Host (if set) if ($fwdfwsettings{'grp2'} eq 'tgt_addr'){ my @tmp= split (/\./,$fwdfwsettings{$fwdfwsettings{'grp2'}}); @@ -986,7 +1008,7 @@ sub deleterule delete $delhash{$last_key}; &General::writehasharray($fwdfwsettings{'config'}, \%delhash); - &rules; + &General::firewall_config_changed(); if($fwdfwsettings{'nobase'} ne 'on'){ &base; @@ -1002,7 +1024,7 @@ sub disable_rule } } &General::writehasharray("$configfwdfw", \%configfwdfw); - &rules; + &General::firewall_config_changed(); } sub dec_counter { @@ -1630,11 +1652,18 @@ END #---SNAT / DNAT ------------------------------------------------ &Header::openbox('100%', 'left', 'NAT'); print< -
$Lang::tr{'fwdfw use nat'}
-
- - + +
+
$Lang::tr{'fwdfw dnat'}
+ + + + END print""; - $fwdfwsettings{'dnatport'}=~ tr/|/,/; - print""; - print""; #SNAT print""; print"
+ + $Lang::tr{'fwdfw dnat'}Firewall:
Port:

$Lang::tr{'fwdfw snat'}Firewall:
"; - print"


"; + print""; &Header::closebox(); #---TARGET------------------------------------------------------ &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'}); @@ -1729,14 +1755,14 @@ END
- +
- + + + + + +
$Lang::tr{'fwhost icmptype'}$Lang::tr{'fwhost icmptype'}
$Lang::tr{'fwdfw external port nat'}: + +
@@ -1834,31 +1873,67 @@ 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"; + } + + print <
+ +
+ + + + + + + + + + + +
+  
  +
+  
  +
+  
  +
+ + + + + +
+
+ +
+END + #---Activate/logging/remark------------------------------------- &Header::openbox('100%', 'left', $Lang::tr{'fwdfw additional'}); print< - $Lang::tr{'fwdfw rule action'}"; print"$Lang::tr{'remark'}:"; if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on'){ print "$Lang::tr{'fwdfw rulepos'}:$Lang::tr{'fwdfw rule activate'} - $Lang::tr{'fwdfw log rule'} -

+ + + END - &Header::closebox(); - #---ADD TIMEFRAME----------------------------------------------- - &Header::openbox('100%', 'left', $Lang::tr{'fwdfw timeframe'}); - print< - - - - - - - - - - - - - - - - - - + +END + } else { + print < + + +END + } + + print < + + + + + + + + + + + +
$Lang::tr{'fwdfw timeframe'}
 
$Lang::tr{'time'}: $Lang::tr{'advproxy monday'} $Lang::tr{'advproxy tuesday'} $Lang::tr{'advproxy wednesday'} $Lang::tr{'advproxy thursday'} $Lang::tr{'advproxy friday'} $Lang::tr{'advproxy saturday'} $Lang::tr{'advproxy sunday'}$Lang::tr{'advproxy from'}$Lang::tr{'advproxy to'}
+ $Lang::tr{'fwdfw rule activate'}
+ + $Lang::tr{'fwdfw log rule'}
+ + $Lang::tr{'fwdfw timeframe'}
+ + + + + + + + + + + + + + + + + + + + + + -
 $Lang::tr{'advproxy monday'}$Lang::tr{'advproxy tuesday'}$Lang::tr{'advproxy wednesday'}$Lang::tr{'advproxy thursday'}$Lang::tr{'advproxy friday'}$Lang::tr{'advproxy saturday'}$Lang::tr{'advproxy sunday'} 
  + ‐ +


+ +
+ + + +

END + #---ACTION------------------------------------------------------ if($fwdfwsettings{'updatefwrule'} ne 'on'){ print< $fwdfwsettings{'oldrulenumber'}){ my %tmp=(); my $val=$fwdfwsettings{'rulepos'}-$fwdfwsettings{'oldrulenumber'}; @@ -2195,7 +2294,7 @@ sub saverule $fwdfwsettings{'oldrulenumber'}++; } &General::writehasharray("$config", $hash); - &rules; + &General::firewall_config_changed(); } } } @@ -2247,9 +2346,34 @@ sub viewtablenew my $tooltip; my @tmpsrc=(); my $coloryellow=''; - print"$title1
"; - print""; - print""; + print <$title1 +
+ +
#$Lang::tr{'fwdfw source'}Log$Lang::tr{'fwdfw target'}$Lang::tr{'fwdfw action'}
+ + + + + + + + + +END + foreach my $key (sort {$a <=> $b} keys %$hash){ $tdcolor=''; @tmpsrc=(); @@ -2300,11 +2424,13 @@ sub viewtablenew $color="$color{'color20'}"; } } - print""; - #KEY print<$key   + + END + #RULETYPE (A,R,D) if ($$hash{$key}[0] eq 'ACCEPT'){ $ruletype='A'; @@ -2319,7 +2445,13 @@ END $tooltip='REJECT'; $rulecolor=$color{'color16'}; } - print""; + + print < +    + +END + #Get Protocol my $prot; if ($$hash{$key}[8]){ @@ -2331,6 +2463,7 @@ END }else{ push (@protocols,$Lang::tr{'all'}); } + my $protz=join(",",@protocols); if($protz eq 'ICMP' && $$hash{$key}[9] ne 'All ICMP-Types' && $$hash{$key}[14] ne 'cust_srvgrp'){ &General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes); @@ -2384,17 +2517,20 @@ END } #LOGGING print< - + + END #TARGET &getcolor($$hash{$key}[5],$$hash{$key}[6],\%customhost); print< + - - - + + + + END if (exists $$hash{$key-1}){ print<
- - - - +
END }else{ - print""; + print""; } + if (exists $$hash{$key+1}){ print<
- - - -
+ + END }else{ - print""; + print""; } #REMARK if ($optionsfw{'SHOWREMARK'} eq 'on' && $$hash{$key}[16] ne ''){ - print""; - print""; + print < + + + + +END } + if ($$hash{$key}[18] eq 'ON'){ #TIMEFRAME if ($$hash{$key}[18] eq 'ON'){ @@ -2501,7 +2665,7 @@ END my $weekdays=join(",",@days); if (@days){ print""; - print""; + print""; } } }
+ # + + $Lang::tr{'protocol'} + + $Lang::tr{'fwdfw source'} + + Log + + $Lang::tr{'fwdfw target'} + + $Lang::tr{'fwdfw action'} +
+ $key  + $ruletype
- - - -
+
+ + + + +
+
END #Is this a DNAT rule? if ($$hash{$key}[31] eq 'dnat' && $$hash{$key}[28] eq 'ON'){ @@ -2403,7 +2539,7 @@ END $$hash{$key}[30]=~ tr/|/,/; print": $$hash{$key}[30]"; } - print"
->"; + print"
->"; } if ($$hash{$key}[5] eq 'ipfire'){ $ipfireiface='Interface'; @@ -2439,54 +2575,82 @@ END $gif="/images/off.gif" } print<
- - - -
- - - -
- - - -
- - - -
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
   $$hash{$key}[16]
  +   $$hash{$key}[16] +
   $weekdays   $$hash{$key}[26] - $$hash{$key}[27]
   $weekdays   $$hash{$key}[26] - $$hash{$key}[27]