]> git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/fwhits.cgi
Ein Paar Dateien fuer die GPLv3 angepasst.
[ipfire-2.x.git] / html / cgi-bin / fwhits.cgi
1 #!/usr/bin/perl
2 ###############################################################################
3 # #
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6 # #
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. #
11 # #
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. #
16 # #
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/>. #
19 # #
20 ###############################################################################
21
22
23 use strict;
24
25 # enable only the following on debugging purpose
26 #use warnings;
27 #use CGI::Carp 'fatalsToBrowser';
28
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";
33
34 my %cgiparams=();
35 my @cgigraphs=();
36 my @graphs=();
37
38 &Graphs::updatefwhitsgraph ("day");
39 &Graphs::updatefwhitsgraph ("week");
40 &Graphs::updatefwhitsgraph ("month");
41 &Graphs::updatefwhitsgraph ("year");
42
43 $ENV{'QUERY_STRING'} =~ s/&//g;
44 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
45 $cgigraphs[1] = '' unless defined $cgigraphs[1];
46
47 &Header::showhttpheaders();
48
49 my $graphdir = "/home/httpd/html/graphs";
50 my @LOCALCHECK=();
51 my $errormessage="";
52
53 &Header::openpage($Lang::tr{'firewall graphs'}, 1, '');
54 &Header::openbigbox('100%', 'left', '', $errormessage);
55
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' />";
61 print "<br />\n";
62 } else {
63 print $Lang::tr{'no information available'};
64 }
65 print "<br />\n";
66 &Header::closebox();
67
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' />";
73 print "<br />\n";
74 } else {
75 print $Lang::tr{'no information available'};
76 }
77 print "<br />\n";
78 &Header::closebox();
79
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' />";
85 print "<br />\n";
86 } else {
87 print $Lang::tr{'no information available'};
88 }
89 print "<br />\n";
90 &Header::closebox();
91
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' />";
97 print "<br />\n";
98 } else {
99 print $Lang::tr{'no information available'};
100 }
101 print "<br />\n";
102 &Header::closebox();
103
104 &Header::closebigbox();
105 &Header::closepage();