]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/portfw.cgi
Update package list.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / portfw.cgi
index 65647ab4c1760340615ba389ebb69dd3081ece3e..5583fb88a555eb4136f6383c99abedbdf606749a 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;
 
@@ -30,7 +25,7 @@ use strict;
 #use warnings;
 #use CGI::Carp 'fatalsToBrowser';
 
-require 'CONFIG_ROOT/general-functions.pl';
+require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -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=();
@@ -714,9 +714,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'edit'}){
        }
 }
 print <<END
-       <td width='5%' align='right'>
-               <a href='${General::adminmanualurl}/section-firewall.html#section-port-forwarding' target='_blank'>
-               <img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
+       <td width='5%' align='right'>&nbsp;</td>
        </tr>
 </table>
 END
@@ -766,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";
                }
        }
        
@@ -1122,10 +1120,10 @@ sub valaddupdate
                $prtrange2 = 1;
        }
        if ($cgiparams{'SRC_IP'} eq '0.0.0.0') { # Dave Roberts - only check if using DEFAULT IP
-               if ($prtrange2 == 1){ # check for destination ports reserved for IPCop
+               if ($prtrange2 == 1){ # check for destination ports reserved for IPFire
                        &disallowreserved($cgiparams{'DEST_PORT'},1,$cgiparams{'PROTOCOL'},"dst");
                        if ($errormessage) { goto EXITSUB; }
-               } else { # check for destination port reserved for IPCop
+               } else { # check for destination port reserved for IPFire
                        &disallowreserved($cgiparams{'DEST_PORT'},0,$cgiparams{'PROTOCOL'},"dst");
                        if ($errormessage) { goto EXITSUB; }
                }