]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/fwhits.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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. #
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. #
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/>. #
20 ###############################################################################
25 # enable only the following on debugging purpose
27 #use CGI::Carp 'fatalsToBrowser';
29 require '/var/ipfire/general-functions.pl';
30 require "${General::swroot}/lang.pl";
31 require "${General::swroot}/header.pl";
32 require "${General::swroot}/graphs.pl";
38 &Graphs
::updatefwhitsgraph
("day");
39 &Graphs
::updatefwhitsgraph
("week");
40 &Graphs
::updatefwhitsgraph
("month");
41 &Graphs
::updatefwhitsgraph
("year");
43 $ENV{'QUERY_STRING'} =~ s/&//g;
44 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
45 $cgigraphs[1] = '' unless defined $cgigraphs[1];
47 &Header
::showhttpheaders
();
49 my $graphdir = "/home/httpd/html/graphs";
53 &Header
::openpage
($Lang::tr
{'firewall graphs'}, 1, '');
54 &Header
::openbigbox
('100%', 'left', '', $errormessage);
56 &Header
::openbox
('100%', 'center', $Lang::tr
{"daily firewallhits"});
57 if (-e
"$Header::graphdir/firewallhits-day-area.png") {
58 my $ftime = localtime((stat("$Header::graphdir/firewallhits-day-area.png"))[9]);
59 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
60 print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />";
63 print $Lang::tr
{'no information available'};
68 &Header
::openbox
('100%', 'center', $Lang::tr
{"weekly firewallhits"});
69 if (-e
"$Header::graphdir/firewallhits-week-area.png") {
70 my $ftime = localtime((stat("$Header::graphdir/firewallhits-week-area.png"))[9]);
71 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
72 print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />";
75 print $Lang::tr
{'no information available'};
80 &Header
::openbox
('100%', 'center', $Lang::tr
{"monthly firewallhits"});
81 if (-e
"$Header::graphdir/firewallhits-month-area.png") {
82 my $ftime = localtime((stat("$Header::graphdir/firewallhits-month-area.png"))[9]);
83 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
84 print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />";
87 print $Lang::tr
{'no information available'};
92 &Header
::openbox
('100%', 'center', $Lang::tr
{"yearly firewallhits"});
93 if (-e
"$Header::graphdir/firewallhits-year-area.png") {
94 my $ftime = localtime((stat("$Header::graphdir/firewallhits-year-area.png"))[9]);
95 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
96 print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />";
99 print $Lang::tr
{'no information available'};
104 &Header
::closebigbox
();
105 &Header
::closepage
();