]>
Commit | Line | Data |
---|---|---|
ac1cfefa MT |
1 | #!/usr/bin/perl |
2 | # | |
3 | # (c) 2002 Robert Wood <rob@empathymp3.co.uk> | |
4 | # | |
5 | # $Id: proxygraphs.cgi,v 1.2.2.5 2005/02/22 22:21:56 gespinasse Exp $ | |
6 | # | |
7 | ||
8 | use strict; | |
9 | ||
10 | # enable only the following on debugging purpose | |
11 | #use warnings; | |
12 | #use CGI::Carp 'fatalsToBrowser'; | |
13 | ||
986e08d9 | 14 | require '/var/ipfire/general-functions.pl'; |
ac1cfefa MT |
15 | require "${General::swroot}/lang.pl"; |
16 | require "${General::swroot}/header.pl"; | |
17 | ||
18 | my %cgiparams=(); | |
19 | my %pppsettings=(); | |
20 | my %netsettings=(); | |
21 | my @graphs=(); | |
22 | ||
23 | &Header::showhttpheaders(); | |
24 | ||
25 | my $dir = "/home/httpd/html/sgraph"; | |
26 | $cgiparams{'ACTION'} = ''; | |
27 | &Header::getcgihash(\%cgiparams); | |
28 | my $sgraphdir = "/home/httpd/html/sgraph"; | |
29 | ||
30 | &Header::openpage($Lang::tr{'proxy access graphs'}, 1, ''); | |
31 | ||
32 | &Header::openbigbox('100%', 'left'); | |
33 | ||
34 | &Header::openbox('100%', 'left', $Lang::tr{'proxy access graphs'} . ":" ); | |
35 | ||
36 | if (open(IPACHTML, "$sgraphdir/index.html")) | |
37 | { | |
38 | my $skip = 1; | |
39 | while (<IPACHTML>) | |
40 | { | |
41 | $skip = 1 if /^<HR>$/; | |
42 | if ($skip) | |
43 | { | |
44 | $skip = 0 if /<H1>/; | |
45 | next; | |
46 | } | |
47 | s/<IMG SRC=([^"'>]+)>/<img src='\/sgraph\/$1' alt='Graph' \/>/; | |
48 | s/<HR>/<hr \/>/g; | |
49 | s/<BR>/<br \/>/g; | |
50 | s/<([^>]*)>/\L<$1>\E/g; | |
51 | s/(size|align|border|color)=([^'"> ]+)/$1='$2'/g; | |
52 | print; | |
53 | } | |
54 | close(IPACHTML); | |
55 | } | |
56 | else { | |
57 | print $Lang::tr{'no information available'}; } | |
58 | ||
59 | &Header::closebox(); | |
60 | ||
61 | &Header::closebigbox(); | |
62 | ||
63 | &Header::closepage(); |