Forward Firewall: Now all customhosts are colored correctly in ruletable. Also the ip addresses in firewall-groups (hosts) are colored correctly if they are part of green,orange,blue,openvpn or ipsec

This commit is contained in:
Alexander Marx
2013-08-14 12:51:21 +02:00
parent 0c2cf9e214
commit b119578f02
2 changed files with 73 additions and 11 deletions

View File

@@ -1243,6 +1243,14 @@ sub getcolor
my $val=shift;
my $hash=shift;
if($optionsfw{'SHOWCOLORS'} eq 'on'){
#custom Hosts
if ($nettype eq 'cust_host_src' || $nettype eq 'cust_host_tgt'){
foreach my $key (sort keys %$hash){
if ($$hash{$key}[0] eq $val){
$val=$$hash{$key}[2];
}
}
}
#standard networks
if ($val eq 'GREEN'){
$tdcolor="style='background-color: $Header::colourgreen;color:white;'";
@@ -1277,8 +1285,8 @@ sub getcolor
$tdcolor="style='background-color: $Header::colourred;color:white;'";
return;
}
#Check if a manual IP is part of a VPN
if ($nettype eq 'src_addr' || $nettype eq 'tgt_addr'){
#Check if a manual IP or custom host is part of a VPN
if ($nettype eq 'src_addr' || $nettype eq 'tgt_addr' || $nettype eq 'cust_host_src' || $nettype eq 'cust_host_tgt'){
#Check if IP is part of OpenVPN dynamic subnet
my ($a,$b) = split("/",$ovpnsettings{'DOVPN_SUBNET'});
my ($c,$d) = split("/",$val);
@@ -1332,14 +1340,6 @@ sub getcolor
$tdcolor="style='background-color: $Header::colourvpn;color:white;'";
return;
}
#custom Hosts
if ($nettype eq 'cust_host_src' || $nettype eq 'cust_host_tgt'){
foreach my $key (sort keys %$hash){
if ($$hash{$key}[0] eq $val){
$val=$$hash{$key}[2];
}
}
}
#ALIASE
foreach my $alias (sort keys %aliases)
{