]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/iptables.cgi
Added missing patch.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / iptables.cgi
1 #!/usr/bin/perl
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 ###############################################################################
21
22 require '/var/ipfire/general-functions.pl';
23 require "${General::swroot}/lang.pl";
24 require "${General::swroot}/header.pl";
25
26 my @iplines;
27 my $lines = 0;
28 my @ipmanlines;
29 my $manlines = 0;
30 my @ipnatlines;
31 my $natlines = 0;
32
33 system('/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'}.':');
39 print <<END
40
41 <DIV align='left'>
42 <PRE>
43 END
44 ;
45 open (FILE, '/srv/web/ipfire/html/iptables.txt');
46 while (<FILE>)
47 {
48 $iplines[$lines] = $_;
49 $lines++;
50 }
51 close (FILE);
52 foreach $_ (@iplines) {
53 print "$_"; }
54
55 print <<END
56 </PRE>
57 </DIV>
58 <BR>
59
60 END
61 ;
62 &Header::closebox();
63
64 ## MANGLE
65 &Header::openbox('100%', 'LEFT', $Lang::tr{'iptmangles'}.':');
66 print <<END
67
68 <DIV align='left'>
69 <PRE>
70 END
71 ;
72 open (FILEMAN, '/srv/web/ipfire/html/iptablesmangle.txt');
73 while (<FILEMAN>)
74 {
75 $ipmanlines[$manlines] = $_;
76 $manlines++;
77 }
78 close (FILEMAN);
79 foreach $_ (@ipmanlines) {
80 print "$_"; }
81
82 print <<END
83 </PRE>
84 </DIV>
85 <BR>
86
87 END
88 ;
89 &Header::closebox();
90
91 ## NAT
92 &Header::openbox('100%', 'LEFT', $Lang::tr{'iptnats'}.':');
93 print <<END
94
95 <DIV align='left'>
96 <PRE>
97 END
98 ;
99 open (FILENAT, '/srv/web/ipfire/html/iptablesnat.txt');
100 while (<FILENAT>)
101 {
102 $ipnatlines[$natlines] = $_;
103 $natlines++;
104 }
105 close (FILENAT);
106 foreach $_ (@ipnatlines) {
107 print "$_"; }
108
109 print <<END
110 </PRE>
111 </DIV>
112 <BR>
113
114 END
115 ;
116 &Header::closebox();
117 &Header::closebigbox();
118 &Header::closepage();
119
120 system(rm -f "/srv/web/ipfire/html/iptables.txt");
121 system(rm -f "/srv/web/ipfire/html/iptablesmangle.txt");
122 system(rm -f "/srv/web/ipfire/html/iptablesnat.txt");