]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/forwardfw.cgi
Forward Firewall: Now all customhosts are colored correctly in ruletable. Also the...
[people/teissler/ipfire-2.x.git] / html / cgi-bin / forwardfw.cgi
index bd8cea8edcf799e88cda38962a82a19209f171fa..c18f4f41c3b410a510624312acf41ec07732b709 100755 (executable)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2012                                                                                                 #
+# Copyright (C) 2013 Alexander Marx <amarx@ipfire.org>                        #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -19,7 +19,6 @@
 #                                                                             #
 ###############################################################################
 
-
 use strict;
 use Sort::Naturally;
 no warnings 'uninitialized';
@@ -64,7 +63,7 @@ my %aliases=();
 my %optionsfw=();
 my %ifaces=();
 
-my $VERSION='0.9.9.13';
+my $VERSION='0.9.9.14';
 my $color;
 my $confignet          = "${General::swroot}/fwhosts/customnetworks";
 my $confighost         = "${General::swroot}/fwhosts/customhosts";
@@ -1244,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;'";
@@ -1278,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);
@@ -1333,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)
                {