]>
git.ipfire.org Git - people/stevee/ipfire-2.x.git/blob - html/html/redirect.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 $swroot="/var/ipfire";
29 &readhash
("$swroot/ethernet/settings", \
%netsettings);
30 &readhash
("$swroot/urlfilter/settings", \
%filtersettings);
32 $category=param
("category");
36 if ($filtersettings{'MSG_TEXT_1'} eq '') {
37 $msgtext1 = "A C C E S S D E N I E D";
38 } else { $msgtext1 = $filtersettings{'MSG_TEXT_1'}; }
39 if ($filtersettings{'MSG_TEXT_2'} eq '') {
40 $msgtext2 = "Access to the requested page has been denied";
41 } else { $msgtext2 = $filtersettings{'MSG_TEXT_2'}; }
42 if ($filtersettings{'MSG_TEXT_3'} eq '') {
43 $msgtext3 = "Please contact the Network Administrator if you think there has been an error";
44 } else { $msgtext3 = $filtersettings{'MSG_TEXT_3'}; }
46 if ($category eq '') { $category = ' '; } else { $category = '['.$category.']'; }
48 print "Pragma: no-cache\n";
49 print "Cache-control: no-cache\n";
50 print "Connection: close\n";
51 print "Content-type: text/html\n\n";
57 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
58 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
59 <title>ACCESS MESSAGE</title>
63 <table width="100%" height='100%' border="0">
65 <td colspan='3' width='100%' height='130' align="center" background="http://$netsettings{'GREEN_ADDRESS'}:81/images/background.gif">
66 <tr> <td width='10%'><td align='center' bgcolor='#CC000000' width='80%'><font face="verdana, arial, sans serif" color="#FFFFFF" size="5">
73 if (!($category eq ""))
76 <tr> <td colspan='3' align='center'>
77 <font face="verdana, arial, sans serif" color="#CC000000" size="1">
85 <td colspan='3' align="center">
86 <font face="verdana, arial, sans serif" color="#000000" size="4">
89 <font face="verdana,arial,sans serif" color="#000000" size="2">
96 <p>URL: <a href="$url">$url</a>
104 <p>Client IP address: <i>$ip</i>
114 <td colspan='3' height='60%' valign="bottom" align="right">
115 <font face="verdana,arial,sans serif" color="#656565" size="1">Web Filtering by
117 <a href="http://www.ipfire.eu" target="_blank"><b>
118 <font face="verdana,arial,sans serif" color="#656565" size="1">IPFire</b></a>
130 my $filename = $_[0];
136 open(FILE
, $filename) or die "Unable to read file $filename";
140 ($var, $val) = split /=/, $_, 2;
146 # Untaint variables read from hash
147 $var =~ /([A-Za-z0-9_-]*)/; $var = $1;
148 $val =~ /([\w\W]*)/; $val = $1;
149 $hash->{$var} = $val;