]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/proxygraphs.cgi
Anpassungen am MPFire
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / proxygraphs.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 use strict;
23
24 # enable only the following on debugging purpose
25 #use warnings;
26 #use CGI::Carp 'fatalsToBrowser';
27
28 require '/var/ipfire/general-functions.pl';
29 require "${General::swroot}/lang.pl";
30 require "${General::swroot}/header.pl";
31
32 my %cgiparams=();
33 my %pppsettings=();
34 my %netsettings=();
35 my @graphs=();
36
37 &Header::showhttpheaders();
38
39 my $dir = "/srv/web/ipfire/html/sgraph";
40 $cgiparams{'ACTION'} = '';
41 &Header::getcgihash(\%cgiparams);
42 my $sgraphdir = "/srv/web/ipfire/html/sgraph";
43
44 &Header::openpage($Lang::tr{'proxy access graphs'}, 1, '');
45
46 &Header::openbigbox('100%', 'left');
47
48 &Header::openbox('100%', 'left', $Lang::tr{'proxy access graphs'} . ":" );
49
50 if (open(IPACHTML, "$sgraphdir/index.html"))
51 {
52 my $skip = 1;
53 while (<IPACHTML>)
54 {
55 $skip = 1 if /^<HR>$/;
56 if ($skip)
57 {
58 $skip = 0 if /<H1>/;
59 next;
60 }
61 s/<IMG SRC=([^"'>]+)>/<img src='\/sgraph\/$1' alt='Graph' \/>/;
62 s/<HR>/<hr \/>/g;
63 s/<BR>/<br \/>/g;
64 s/<([^>]*)>/\L<$1>\E/g;
65 s/(size|align|border|color)=([^'"> ]+)/$1='$2'/g;
66 print;
67 }
68 close(IPACHTML);
69 }
70 else {
71 print $Lang::tr{'no information available'}; }
72
73 &Header::closebox();
74
75 &Header::closebigbox();
76
77 &Header::closepage();