]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - html/cgi-bin/iptables.cgi
Fix permissions of openvpn lease database.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / iptables.cgi
CommitLineData
a68fedca 1#!/usr/bin/perl
70df8302
MT
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
5# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6# #
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. #
11# #
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. #
16# #
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/>. #
19# #
20###############################################################################
a68fedca
MT
21
22require '/var/ipfire/general-functions.pl';
23require "${General::swroot}/lang.pl";
24require "${General::swroot}/header.pl";
25
26my @iplines;
27my $lines = 0;
28my @ipmanlines;
29my $manlines = 0;
30my @ipnatlines;
31my $natlines = 0;
32
33system('/usr/local/bin/getipstat');
34
35&Header::showhttpheaders();
36&Header::openpage($Lang::tr{'ipts'}, 1, '');
37&Header::openbigbox('100%', 'LEFT');
38&Header::openbox('100%', 'LEFT', $Lang::tr{'ipts'}.':');
39print <<END
40
41 <DIV align='left'>
42 <PRE>
43END
44;
55b4c7ed 45 open (FILE, '/srv/web/ipfire/html/iptables.txt');
a68fedca
MT
46 while (<FILE>)
47 {
48 $iplines[$lines] = $_;
49 $lines++;
50 }
51 close (FILE);
52 foreach $_ (@iplines) {
53 print "$_"; }
54
55print <<END
56 </PRE>
57 </DIV>
58 <BR>
59
60END
61;
62&Header::closebox();
63
64## MANGLE
65&Header::openbox('100%', 'LEFT', $Lang::tr{'iptmangles'}.':');
66print <<END
67
68 <DIV align='left'>
69 <PRE>
70END
71;
55b4c7ed 72 open (FILEMAN, '/srv/web/ipfire/html/iptablesmangle.txt');
a68fedca
MT
73 while (<FILEMAN>)
74 {
75 $ipmanlines[$manlines] = $_;
76 $manlines++;
77 }
78 close (FILEMAN);
79 foreach $_ (@ipmanlines) {
80 print "$_"; }
81
82print <<END
83 </PRE>
84 </DIV>
85 <BR>
86
87END
88;
89&Header::closebox();
90
91## NAT
92&Header::openbox('100%', 'LEFT', $Lang::tr{'iptnats'}.':');
93print <<END
94
95 <DIV align='left'>
96 <PRE>
97END
98;
55b4c7ed 99 open (FILENAT, '/srv/web/ipfire/html/iptablesnat.txt');
a68fedca
MT
100 while (<FILENAT>)
101 {
102 $ipnatlines[$natlines] = $_;
103 $natlines++;
104 }
105 close (FILENAT);
106 foreach $_ (@ipnatlines) {
107 print "$_"; }
108
109print <<END
110 </PRE>
111 </DIV>
112 <BR>
113
114END
115;
116&Header::closebox();
117&Header::closebigbox();
118&Header::closepage();
483f59cd 119
55b4c7ed
MT
120system(rm -f "/srv/web/ipfire/html/iptables.txt");
121system(rm -f "/srv/web/ipfire/html/iptablesmangle.txt");
122system(rm -f "/srv/web/ipfire/html/iptablesnat.txt");