X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Ffwhosts.cgi;h=eeb83ac127bc216b3e7c10e7568c1c82cab7bdb4;hb=d25b7c32bd420267d2604dfa34e6e3bfa7de9ed7;hp=2d128f55df616cd95799286acff580b1cce4090a;hpb=dadffbf738474d649b7177d56acedbad51d6e603;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 2d128f55d..eeb83ac12 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -66,7 +66,6 @@ my $fwconfigfwd = "${General::swroot}/firewall/config"; my $fwconfiginp = "${General::swroot}/firewall/input"; my $fwconfigout = "${General::swroot}/firewall/outgoing"; my $configovpn = "${General::swroot}/ovpn/settings"; -my $tdcolor=''; my $configipsecrw = "${General::swroot}/vpn/settings"; unless (-e $confignet) { system("touch $confignet"); } @@ -910,9 +909,6 @@ if ($fwhostsettings{'ACTION'} eq 'deletegrphost') } &General::writehasharray("$configgrp", \%customgrp); &General::firewall_config_changed(); - if ($fwhostsettings{'grpcnt'} > 0){ - &General::firewall_config_changed(); - } if ($fwhostsettings{'update'} eq 'on'){ $fwhostsettings{'remark'}= $grpremark; $fwhostsettings{'grp_name'}=$grpname; @@ -1236,7 +1232,7 @@ END
$Lang::tr{'remark'}: - +


@@ -1256,7 +1252,7 @@ END - END foreach my $network (sort keys %defaultNetworks) { @@ -1285,7 +1281,7 @@ END - "; END foreach my $key (sort { ncmp($customnetwork{$a}[0],$customnetwork{$b}[0]) } keys %customnetwork) { print""; @@ -1302,7 +1298,7 @@ END - "; END foreach my $key (sort { ncmp($customhost{$a}[0],$customhost{$b}[0]) } keys %customhost) { print""; @@ -1322,7 +1318,7 @@ END - "; END foreach my $key (sort { ncmp($ccdnet{$a}[0],$ccdnet{$b}[0]) } keys %ccdnet) { @@ -1331,10 +1327,17 @@ END print""; } #OVPN clients + my @ovpn_clients=(); foreach my $key (sort { ncmp($ccdhost{$a}[0],$ccdhost{$b}[0]) } keys %ccdhost) { if ($ccdhost{$key}[33] ne ''){ - print< - " if ($show eq ''); END - $show='1'; - print""; + foreach(@ovpn_clients){ + print""; } + print""; } - if ($show eq '1'){$show='';print"";} #OVPN n2n networks + my @OVPN_N2N=(); foreach my $key (sort { ncmp($ccdhost{$a}[1],$ccdhost{$b}[1]) } keys %ccdhost) { if($ccdhost{$key}[3] eq 'net'){ - print< - " END - $show='1'; - print""; + foreach(@OVPN_N2N){ + print""; } + print""; } - if ($show eq '1'){$show='';print"";} #IPsec networks + my @IPSEC_N2N=(); foreach my $key (sort { ncmp($ipsecconf{$a}[0],$ipsecconf{$b}[0]) } keys %ipsecconf) { if ($ipsecconf{$key}[3] eq 'net'){ - print< - " END - $show='1'; - print""; + foreach(@IPSEC_N2N){ + print""; } } - if ($show eq '1'){$show='';print"";} + print""; print""; print""; print"

"; @@ -1479,9 +1496,28 @@ END print<
$Lang::tr{'fwhost addgrpname'}
-
$Lang::tr{'remark'}: -
-
+ +
+ + $Lang::tr{'remark'}: + + + + + + + + + + + + + +
+ + + +
END } if($fwhostsettings{'updatesrvgrp'} eq 'on'){ @@ -1584,6 +1620,7 @@ sub getcolor my $c=shift; my $sip; my $scidr; + my $tdcolor=''; #Check if MAC if (&General::validmac($c)){ return $c;} @@ -1595,7 +1632,7 @@ sub getcolor } #Now check if IP is part of ORANGE,BLUE or GREEN - if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){ + if ( &Header::orange_used() && &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){ $tdcolor="$c"; return $tdcolor; } @@ -1603,7 +1640,7 @@ sub getcolor $tdcolor="$c"; return $tdcolor; } - if ( &General::IpInSubnet($sip,$netsettings{'BLUE_ADDRESS'},$netsettings{'BLUE_NETMASK'})){ + if ( &Header::blue_used() && &General::IpInSubnet($sip,$netsettings{'BLUE_ADDRESS'},$netsettings{'BLUE_NETMASK'})){ $tdcolor="$c"; return $tdcolor; } @@ -1648,10 +1685,13 @@ sub getcolor #Check if IP is part of a IPsec N2N network foreach my $key (sort keys %ipsecconf){ - my ($a,$b) = split("/",$ipsecconf{$key}[11]); - if (&General::IpInSubnet($sip,$a,$b)){ - $tdcolor="$c"; - return $tdcolor; + if ($ipsecconf{$key}[11]){ + my ($a,$b) = split("/",$ipsecconf{$key}[11]); + $b=&General::iporsubtodec($b); + if (&General::IpInSubnet($sip,$a,$b)){ + $tdcolor="$c"; + return $tdcolor; + } } } return "$c"; @@ -1800,11 +1840,11 @@ sub viewtablegrp print "$customgrp{$key}[2]"; } if ($ip eq '' && $customgrp{$key}[2] ne $Lang::tr{'fwhost err emptytable'}){ - print "$Lang::tr{'fwhost deleted'}$customgrp{$key}[3]
"; + print "$Lang::tr{'fwhost deleted'}$Lang::tr{'fwhost '.$customgrp{$key}[3]}"; }else{ my ($colip,$colsub) = split("/",$ip); - $ip="$colip/".&General::subtocidr($colsub) if ($colsub); - print"".&getcolor($ip)."$customgrp{$key}[3]"; + $ip="$colip/".&General::iporsubtocidr($colsub) if ($colsub); + print"".&getcolor($ip)."$Lang::tr{'fwhost '.$customgrp{$key}[3]}"; } if ($delflag > 0 && $ip ne ''){ print""; @@ -1815,8 +1855,7 @@ sub viewtablegrp } } } - print"
"; - + print""; $helper=$customgrp{$key}[0]; $number++; }