X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fforwardfw.cgi;h=07109f2c54ce7739d9496aa86c6b2ed6050ec310;hp=57eff4dff28d825ee785ee685acfcd343b8dfc9c;hb=f1934a05ad64ae5dd78568eece018cdb452b2326;hpb=1a8fde0e845eab654aeee6dc5b780c3e4596cb4d diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index 57eff4dff..07109f2c5 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -75,7 +75,7 @@ my %aliases=(); my %optionsfw=(); my %ifaces=(); -my $VERSION='0.9.9.9'; +my $VERSION='0.9.9.9a'; my $color; my $confignet = "${General::swroot}/fwhosts/customnetworks"; my $confighost = "${General::swroot}/fwhosts/customhosts"; @@ -133,8 +133,8 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule') $errormessage.=$Lang::tr{'fwdfw useless rule'}."
"; } #check if we try to break rules - if( $fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'IPFire' && $fwdfwsettings{'grp2'} eq 'ipfire'){ - $errormessage.=$Lang::tr{'fwdfw err same'}; + if( $fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){ + $errormessage=$Lang::tr{'fwdfw err same'}; } #INPUT part if($fwdfwsettings{'grp2'} eq 'ipfire' && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ORANGE'){ @@ -772,7 +772,7 @@ sub checkrule } #check if source and target identical if ($fwdfwsettings{$fwdfwsettings{'grp1'}} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ALL'){ - $errormessage.=$Lang::tr{'fwdfw err same'}; + $errormessage=$Lang::tr{'fwdfw err same'}; return $errormessage; } #get source and targetip address if possible @@ -1391,6 +1391,10 @@ sub newrule if($fwdfwsettings{'config'} eq ''){$fwdfwsettings{'config'}=$configfwdfw;} my $config=$fwdfwsettings{'config'}; my %hash=(); + #Get Red IP-ADDRESS + open (CONN1,"/var/ipfire/red/local-ipaddress"); + my $redip = ; + close(CONN1); $checked{'grp1'}{$fwdfwsettings{'grp1'}} = 'CHECKED'; $checked{'grp2'}{$fwdfwsettings{'grp2'}} = 'CHECKED'; $checked{'grp3'}{$fwdfwsettings{'grp3'}} = 'CHECKED'; @@ -1410,7 +1414,7 @@ sub newrule $selected{'TIME_FROM'}{$fwdfwsettings{'TIME_FROM'}} = 'selected'; $selected{'TIME_TO'}{$fwdfwsettings{'TIME_TO'}} = 'selected'; $selected{'ipfire'}{$fwdfwsettings{$fwdfwsettings{'grp2'}}} ='selected'; - $selected{'ipfire'}{$fwdfwsettings{$fwdfwsettings{'grp1'}}} ='selected'; + $selected{'ipfire_src'}{$fwdfwsettings{$fwdfwsettings{'grp1'}}} ='selected'; #check if update and get values if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on' && !$errormessage){ &General::readhasharray("$config", \%hash); @@ -1519,14 +1523,14 @@ sub newrule #------SOURCE------------------------------------------------------- print< - $Lang::tr{'fwdfw sourceip'}Firewall + $Lang::tr{'fwdfw sourceip'}Firewall END print"$Lang::tr{'fwhost cust srvgrp'}:$Lang::tr{'fwhost cust srvgrp'}$Lang::tr{'fwdfw snat'}"; print"IPFire: END foreach ("ACCEPT","DROP","REJECT") @@ -2200,8 +2202,12 @@ END print"$protz"; @protocols=(); #SOURCE + my $ipfireiface; &getcolor($$hash{$key}[3],$$hash{$key}[4],\%customhost); print""; + if ($$hash{$key}[3] eq 'ipfire_src'){ + $ipfireiface='Interface '; + } if ($$hash{$key}[3] eq 'std_net_src'){ print &get_name($$hash{$key}[4]); }elsif ($$hash{$key}[3] eq 'src_addr'){ @@ -2211,15 +2217,19 @@ END }else{ print $$hash{$key}[4]; } + }elsif ($$hash{$key}[4] eq 'RED1'){ + print "$ipfireiface $Lang::tr{'fwdfw red'}"; }else{ - print $$hash{$key}[4]; + print "$$hash{$key}[4]"; } $tdcolor=''; #SOURCEPORT &getsrcport(\%$hash,$key); #Is this a SNAT rule? if ($$hash{$key}[31] eq 'snat' && $$hash{$key}[28] eq 'ON'){ - print"
->$$hash{$key}[29]"; + my $net=&get_name($$hash{$key}[29]); + if ( ! $net){ $net=$$hash{$key}[29];} + print"
->$net"; if ($$hash{$key}[30] ne ''){ print": $$hash{$key}[30]"; } @@ -2253,10 +2263,15 @@ END } print"
->"; } + if ($$hash{$key}[5] eq 'ipfire'){ + $ipfireiface='Interface'; + } if ($$hash{$key}[5] eq 'std_net_tgt' || $$hash{$key}[5] eq 'ipfire' && $$hash{$key}[6] eq 'RED' || $$hash{$key}[6] eq 'RED1' || $$hash{$key}[6] eq 'GREEN' || $$hash{$key}[6] eq 'ORANGE' || $$hash{$key}[6] eq 'BLUE' ){ - if ($$hash{$key}[6] eq 'RED1') + if ($$hash{$key}[6] eq 'RED1'){ + print "$ipfireiface $Lang::tr{'red1'}"; + }elsif ($$hash{$key}[6] ne 'RED') { - print $Lang::tr{'red1'}; + print "$ipfireiface ".&get_name($$hash{$key}[6]); }else{ print &get_name($$hash{$key}[6]); } @@ -2268,7 +2283,7 @@ END print $$hash{$key}[6]; } }else{ - print $$hash{$key}[6]; + print "$$hash{$key}[6]"; } $tdcolor=''; #TARGETPORT