]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/fwhits.cgi
3 # This code is distributed under the terms of the GPL
8 # enable only the following on debugging purpose
10 #use CGI::Carp 'fatalsToBrowser';
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";
21 &Graphs
::updatefwhitsgraph
("day");
22 &Graphs
::updatefwhitsgraph
("week");
23 &Graphs
::updatefwhitsgraph
("month");
24 &Graphs
::updatefwhitsgraph
("year");
26 $ENV{'QUERY_STRING'} =~ s/&//g;
27 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
28 $cgigraphs[1] = '' unless defined $cgigraphs[1];
30 &Header
::showhttpheaders
();
32 my $graphdir = "/home/httpd/html/graphs";
36 &Header
::openpage
($Lang::tr
{'firewall graphs'}, 1, '');
37 &Header
::openbigbox
('100%', 'left', '', $errormessage);
39 &Header
::openbox
('100%', 'center', $Lang::tr
{"daily firewallhits"});
40 if (-e
"$Header::graphdir/firewallhits-day-area.png") {
41 my $ftime = localtime((stat("$Header::graphdir/firewallhits-day-area.png"))[9]);
42 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
43 print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />";
46 print $Lang::tr
{'no information available'};
51 &Header
::openbox
('100%', 'center', $Lang::tr
{"weekly firewallhits"});
52 if (-e
"$Header::graphdir/firewallhits-week-area.png") {
53 my $ftime = localtime((stat("$Header::graphdir/firewallhits-week-area.png"))[9]);
54 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
55 print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />";
58 print $Lang::tr
{'no information available'};
63 &Header
::openbox
('100%', 'center', $Lang::tr
{"monthly firewallhits"});
64 if (-e
"$Header::graphdir/firewallhits-month-area.png") {
65 my $ftime = localtime((stat("$Header::graphdir/firewallhits-month-area.png"))[9]);
66 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
67 print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />";
70 print $Lang::tr
{'no information available'};
75 &Header
::openbox
('100%', 'center', $Lang::tr
{"yearly firewallhits"});
76 if (-e
"$Header::graphdir/firewallhits-year-area.png") {
77 my $ftime = localtime((stat("$Header::graphdir/firewallhits-year-area.png"))[9]);
78 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
79 print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />";
82 print $Lang::tr
{'no information available'};
87 &Header
::closebigbox
();