]> git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/fwhits.cgi
e91e22b7e24379806561514834b3efbad2e9a464
[ipfire-2.x.git] / html / cgi-bin / fwhits.cgi
1 #!/usr/bin/perl
2 #
3 # This code is distributed under the terms of the GPL
4 #
5
6 use strict;
7
8 # enable only the following on debugging purpose
9 #use warnings;
10 #use CGI::Carp 'fatalsToBrowser';
11
12 require '/var/ipfire/general-functions.pl';
13 require "${General::swroot}/lang.pl";
14 require "${General::swroot}/header.pl";
15 require "${General::swroot}/graphs.pl";
16
17 my %cgiparams=();
18 my @cgigraphs=();
19 my @graphs=();
20
21 &Graphs::updatefwhitsgraph ("day");
22 &Graphs::updatefwhitsgraph ("week");
23 &Graphs::updatefwhitsgraph ("month");
24 &Graphs::updatefwhitsgraph ("year");
25
26 $ENV{'QUERY_STRING'} =~ s/&//g;
27 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
28 $cgigraphs[1] = '' unless defined $cgigraphs[1];
29
30 &Header::showhttpheaders();
31
32 my $graphdir = "/home/httpd/html/graphs";
33 my @LOCALCHECK=();
34 my $errormessage="";
35
36 &Header::openpage($Lang::tr{'firewall graphs'}, 1, '');
37 &Header::openbigbox('100%', 'left', '', $errormessage);
38
39 &Header::openbox('100%', 'center', $Lang::tr{"daily firewallhits"});
40 my $ftime = localtime((stat("$graphdir/firewallhits-day-area.png"))[9]);
41 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
42 print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />";
43 print "<br />\n";
44 &Header::closebox();
45
46 &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"});
47 my $ftime = localtime((stat("$graphdir/firewallhits-week-area.png"))[9]);
48 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
49 print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />";
50 print "<br />\n";
51 &Header::closebox();
52
53 &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"});
54 my $ftime = localtime((stat("$graphdir/firewallhits-month-area.png"))[9]);
55 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
56 print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />";
57 print "<br />\n";
58 &Header::closebox();
59
60 &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"});
61 my $ftime = localtime((stat("$graphdir/firewallhits-year-area.png"))[9]);
62 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
63 print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />";
64 print "<br />\n";
65 &Header::closebox();
66
67 &Header::closebigbox();
68 &Header::closepage();