From: Alexander Marx Date: Tue, 6 May 2014 10:40:05 +0000 (+0200) Subject: Firewall: When using custom hosts and not having BLUE or ORANGE, the Ruletable took... X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=1be052f99558509e6cd808290ee77b63524ff938 Firewall: When using custom hosts and not having BLUE or ORANGE, the Ruletable took very long to display every Line With this commit the page is shown quickly because there's now a check if ORANGE or BLUE exist before we test if a host might be in that subnet. --- diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 48e3a8d2a..cf94c8f8b 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -1334,7 +1334,7 @@ sub getcolor return; }elsif($val =~ /^(.*?)\/(.*?)$/){ my ($sip,$scidr) = split ("/",$val); - if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){ + if ( &Header::orange_used() && &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){ $tdcolor="style='background-color: $Header::colourorange;color:white;'"; return; } @@ -1342,7 +1342,7 @@ sub getcolor $tdcolor="style='background-color: $Header::colourgreen;color:white;'"; return; } - if ( &General::IpInSubnet($sip,$netsettings{'BLUE_ADDRESS'},$netsettings{'BLUE_NETMASK'})){ + if ( &Header::blue_used() && &General::IpInSubnet($sip,$netsettings{'BLUE_ADDRESS'},$netsettings{'BLUE_NETMASK'})){ $tdcolor="style='background-color: $Header::colourblue;color:white;'"; return; }