]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/proxygraphs.cgi
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[ipfire-2.x.git] / html / cgi-bin / proxygraphs.cgi
diff --git a/html/cgi-bin/proxygraphs.cgi b/html/cgi-bin/proxygraphs.cgi
new file mode 100644 (file)
index 0000000..4e297b1
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl\r
+#\r
+# (c) 2002 Robert Wood <rob@empathymp3.co.uk>\r
+#\r
+# $Id: proxygraphs.cgi,v 1.2.2.5 2005/02/22 22:21:56 gespinasse Exp $\r
+#\r
+\r
+use strict;\r
+\r
+# enable only the following on debugging purpose\r
+#use warnings;\r
+#use CGI::Carp 'fatalsToBrowser';\r
+\r
+require 'CONFIG_ROOT/general-functions.pl';\r
+require "${General::swroot}/lang.pl";\r
+require "${General::swroot}/header.pl";\r
+\r
+my %cgiparams=();\r
+my %pppsettings=();\r
+my %netsettings=();\r
+my @graphs=();\r
+\r
+&Header::showhttpheaders();\r
+\r
+my $dir = "/home/httpd/html/sgraph";\r
+$cgiparams{'ACTION'} = '';\r
+&Header::getcgihash(\%cgiparams);\r
+my $sgraphdir = "/home/httpd/html/sgraph";\r
+\r
+&Header::openpage($Lang::tr{'proxy access graphs'}, 1, '');\r
+\r
+&Header::openbigbox('100%', 'left');\r
+\r
+&Header::openbox('100%', 'left', $Lang::tr{'proxy access graphs'} . ":" );\r
+\r
+if (open(IPACHTML, "$sgraphdir/index.html"))\r
+{\r
+       my $skip = 1;\r
+       while (<IPACHTML>)\r
+       {\r
+               $skip = 1 if /^<HR>$/;\r
+               if ($skip)\r
+               {\r
+                       $skip = 0 if /<H1>/;\r
+                       next;\r
+               }\r
+               s/<IMG SRC=([^"'>]+)>/<img src='\/sgraph\/$1' alt='Graph' \/>/;\r
+               s/<HR>/<hr \/>/g;\r
+               s/<BR>/<br \/>/g;\r
+               s/<([^>]*)>/\L<$1>\E/g;\r
+               s/(size|align|border|color)=([^'"> ]+)/$1='$2'/g;\r
+               print;\r
+       }\r
+       close(IPACHTML);\r
+}\r
+else {\r
+       print $Lang::tr{'no information available'}; }\r
+\r
+&Header::closebox();\r
+\r
+&Header::closebigbox();\r
+\r
+&Header::closepage();\r