]>
Commit | Line | Data |
---|---|---|
df8c7810 | 1 | #!/usr/bin/perl |
70df8302 MT |
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 | ||
df8c7810 MT |
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"; | |
350b52c5 | 32 | require "${General::swroot}/graphs.pl"; |
df8c7810 MT |
33 | |
34 | my %cgiparams=(); | |
35 | my @cgigraphs=(); | |
36 | my @graphs=(); | |
37 | ||
350b52c5 CS |
38 | &Graphs::updatefwhitsgraph ("day"); |
39 | &Graphs::updatefwhitsgraph ("week"); | |
40 | &Graphs::updatefwhitsgraph ("month"); | |
41 | &Graphs::updatefwhitsgraph ("year"); | |
42 | ||
df8c7810 MT |
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"; | |
df8c7810 MT |
50 | my @LOCALCHECK=(); |
51 | my $errormessage=""; | |
52 | ||
e455cafe | 53 | &Header::openpage($Lang::tr{'firewall graphs'}, 1, ''); |
df8c7810 | 54 | &Header::openbigbox('100%', 'left', '', $errormessage); |
df8c7810 | 55 | |
986e08d9 | 56 | &Header::openbox('100%', 'center', $Lang::tr{"daily firewallhits"}); |
3c5695fe CS |
57 | if (-e "$Header::graphdir/firewallhits-day-area.png") { |
58 | my $ftime = localtime((stat("$Header::graphdir/firewallhits-day-area.png"))[9]); | |
df8c7810 | 59 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; |
e455cafe | 60 | print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />"; |
df8c7810 | 61 | print "<br />\n"; |
3c5695fe CS |
62 | } else { |
63 | print $Lang::tr{'no information available'}; | |
64 | } | |
65 | print "<br />\n"; | |
df8c7810 | 66 | &Header::closebox(); |
3c5695fe | 67 | |
986e08d9 | 68 | &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"}); |
3c5695fe CS |
69 | if (-e "$Header::graphdir/firewallhits-week-area.png") { |
70 | my $ftime = localtime((stat("$Header::graphdir/firewallhits-week-area.png"))[9]); | |
df8c7810 | 71 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; |
e455cafe | 72 | print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />"; |
df8c7810 | 73 | print "<br />\n"; |
3c5695fe CS |
74 | } else { |
75 | print $Lang::tr{'no information available'}; | |
76 | } | |
77 | print "<br />\n"; | |
df8c7810 MT |
78 | &Header::closebox(); |
79 | ||
986e08d9 | 80 | &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"}); |
3c5695fe CS |
81 | if (-e "$Header::graphdir/firewallhits-month-area.png") { |
82 | my $ftime = localtime((stat("$Header::graphdir/firewallhits-month-area.png"))[9]); | |
df8c7810 | 83 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; |
e455cafe | 84 | print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />"; |
df8c7810 | 85 | print "<br />\n"; |
3c5695fe CS |
86 | } else { |
87 | print $Lang::tr{'no information available'}; | |
88 | } | |
89 | print "<br />\n"; | |
df8c7810 MT |
90 | &Header::closebox(); |
91 | ||
986e08d9 | 92 | &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"}); |
3c5695fe CS |
93 | if (-e "$Header::graphdir/firewallhits-year-area.png") { |
94 | my $ftime = localtime((stat("$Header::graphdir/firewallhits-year-area.png"))[9]); | |
df8c7810 | 95 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; |
e455cafe | 96 | print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />"; |
df8c7810 | 97 | print "<br />\n"; |
3c5695fe CS |
98 | } else { |
99 | print $Lang::tr{'no information available'}; | |
100 | } | |
101 | print "<br />\n"; | |
df8c7810 | 102 | &Header::closebox(); |
df8c7810 MT |
103 | |
104 | &Header::closebigbox(); | |
105 | &Header::closepage(); |