]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/portfw.cgi
cups: Update to 1.7.0.
[people/teissler/ipfire-2.x.git] / html / cgi-bin / portfw.cgi
index 91ccbf5d32e2bd18706179c1ebd00b9e7dde0ead..199682f44fb81affd96cbaeab90538a3503ec5e7 100644 (file)
@@ -1,28 +1,23 @@
 #!/usr/bin/perl
-#
-# SmoothWall CGIs
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) The SmoothWall Team
-# Copyright (c) 2002/04/13 Steve Bootes - Add source IP support
-#
-# $Id: portfw.cgi,v 1.5.2.18 2005/05/02 16:19:49 eoberlander Exp $
-#
-#
-# Darren Critchley February 2003 - I added the multiple external access rules for each port forward
-# A couple of things to remember when reading the code
-#      There are two kinds of records in the config file, those with a number in the first field, and then 0,
-#              these are port forward rules, these records will have a 0 or 0.0.0.0 in position 9 (ORIG_IP)
-#              If there is a 0, it means that there are external access rules, otherwise the port is open to ALL.
-#      The second type of record is a number followed by a number which indicates that it is an external access
-#      rule. The first number indicates which Portfw rule it belongs to, and the second is just a unique key.
-#
-# Darren Critchley - March 5, 2003 - if you come along after me and work on this page, please comment your
-#              work. Put your name, and date and then your comment - it helps the person that comes along after you
-#              to figure out why and how things have changed, and it is considered good coding practice
-# Thanks . . . 
-#
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# 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        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 use strict;
 
@@ -38,6 +33,11 @@ require "${General::swroot}/header.pl";
 my @dummy = ( ${Header::colouryellow} );
 undef (@dummy);
 
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
 my %cgiparams=();
 my %selected=();
 my %checked=();
@@ -764,10 +764,10 @@ while (<RULES>)
                print "<tr bgcolor='${Header::colouryellow}'>\n";
        } else {
                if ($id % 2) {
-                       print "<tr bgcolor='${Header::table1colour}'>\n"; 
+                       print "<tr bgcolor='$color{'color22'}'>\n"; 
                }
                else {
-                       print "<tr bgcolor='${Header::table2colour}'>\n";
+                       print "<tr bgcolor='$color{'color20'}'>\n";
                }
        }
        
@@ -1038,7 +1038,7 @@ sub disallowreserved
 {
        # port 67 and 68 same for tcp and udp, don't bother putting in an array
        my $msg = "";
-       my @tcp_reserved = (81,222,444);
+       my @tcp_reserved = ();
        my $prt = $_[0]; # the port or range
        my $ryn = $_[1]; # tells us whether or not it is a port range
        my $prot = $_[2]; # protocol