X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ffwhosts.cgi;h=e8ddf461e68b038145b38338c4cd8323bf7bf3a9;hp=34d43f3b16d05f331d4cdc9e067ceb98815be888;hb=eae92b2bafe3a94a3c6c616f8ff02c6fa013e97a;hpb=7429ee78b62e5b248a646a02dbc198db57412291 diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 34d43f3b1..e8ddf461e 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -21,7 +21,8 @@ use strict; # enable only the following on debugging purpose -use warnings; +#use warnings; + use Sort::Naturally; use CGI::Carp 'fatalsToBrowser'; no warnings 'uninitialized'; @@ -65,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"); } @@ -1235,7 +1235,7 @@ END
$Lang::tr{'remark'}: - +


@@ -1255,7 +1255,7 @@ END - END foreach my $network (sort keys %defaultNetworks) { @@ -1284,7 +1284,7 @@ END - "; END foreach my $key (sort { ncmp($customnetwork{$a}[0],$customnetwork{$b}[0]) } keys %customnetwork) { print""; @@ -1301,7 +1301,7 @@ END - "; END foreach my $key (sort { ncmp($customhost{$a}[0],$customhost{$b}[0]) } keys %customhost) { print""; @@ -1321,7 +1321,7 @@ END - "; END foreach my $key (sort { ncmp($ccdnet{$a}[0],$ccdnet{$b}[0]) } keys %ccdnet) { @@ -1330,10 +1330,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"

"; @@ -1478,9 +1499,28 @@ END print<
$Lang::tr{'fwhost addgrpname'}
-
$Lang::tr{'remark'}: -
-
+ +
+ + $Lang::tr{'remark'}: + + + + + + + + + + + + + +
+ + + +
END } if($fwhostsettings{'updatesrvgrp'} eq 'on'){ @@ -1583,6 +1623,7 @@ sub getcolor my $c=shift; my $sip; my $scidr; + my $tdcolor=''; #Check if MAC if (&General::validmac($c)){ return $c;} @@ -1647,10 +1688,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"; @@ -1802,7 +1846,7 @@ sub viewtablegrp print "$Lang::tr{'fwhost deleted'}$customgrp{$key}[3]
"; }else{ my ($colip,$colsub) = split("/",$ip); - $ip="$colip/".&General::subtocidr($colsub) if ($colsub); + $ip="$colip/".&General::iporsubtocidr($colsub) if ($colsub); print"".&getcolor($ip)."$customgrp{$key}[3]"; } if ($delflag > 0 && $ip ne ''){ @@ -2014,7 +2058,7 @@ sub checkname } sub checkgroup { - &General::readhasharray("$configsrvgrp", \%customservicegrp ); + &General::readhasharray("$configgrp", \%customgrp ); my $name=shift; foreach my $key (keys %customservicegrp) { if($customservicegrp{$key}[0] eq $name){