]>
Commit | Line | Data |
---|---|---|
df8c7810 MT |
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 | ||
16 | my %cgiparams=(); | |
17 | my @cgigraphs=(); | |
18 | my @graphs=(); | |
19 | ||
20 | $ENV{'QUERY_STRING'} =~ s/&//g; | |
21 | @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'}); | |
22 | $cgigraphs[1] = '' unless defined $cgigraphs[1]; | |
23 | ||
24 | &Header::showhttpheaders(); | |
25 | ||
26 | my $graphdir = "/home/httpd/html/graphs"; | |
27 | ||
28 | my @LOCALCHECK=(); | |
29 | my $errormessage=""; | |
30 | ||
e455cafe | 31 | &Header::openpage($Lang::tr{'firewall graphs'}, 1, ''); |
df8c7810 MT |
32 | |
33 | &Header::openbigbox('100%', 'left', '', $errormessage); | |
34 | print <<END; | |
35 | <table width="100%" align="center"> | |
36 | <tr> | |
37 | <td align="left"> | |
986e08d9 | 38 | <a href=/cgi-bin/fwhits.cgi?graph=line>$Lang::tr{'show lines'}</a> |
df8c7810 | 39 | |
986e08d9 | 40 | <a href=/cgi-bin/fwhits.cgi?graph=area>$Lang::tr{'show areas'}</a> |
df8c7810 MT |
41 | </td> |
42 | </tr> | |
43 | </table> | |
44 | END | |
45 | if ($cgigraphs[1] eq "line") { | |
986e08d9 | 46 | &Header::openbox('100%', 'center', $Lang::tr{"daily firewallhits"}); |
df8c7810 MT |
47 | my $ftime = localtime((stat("$graphdir/firewallhits-day-line.png"))[9]); |
48 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 49 | print "<img alt='' src='/graphs/firewallhits-day-line.png' border='0' />"; |
df8c7810 MT |
50 | print "<br />\n"; |
51 | &Header::closebox(); | |
52 | ||
986e08d9 | 53 | &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"}); |
df8c7810 MT |
54 | my $ftime = localtime((stat("$graphdir/firewallhits-week-line.png"))[9]); |
55 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 56 | print "<img alt='' src='/graphs/firewallhits-week-line.png' border='0' />"; |
df8c7810 MT |
57 | print "<br />\n"; |
58 | &Header::closebox(); | |
59 | ||
986e08d9 | 60 | &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"}); |
df8c7810 MT |
61 | my $ftime = localtime((stat("$graphdir/firewallhits-month-line.png"))[9]); |
62 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 63 | print "<img alt='' src='/graphs/firewallhits-month-line.png' border='0' />"; |
df8c7810 MT |
64 | print "<br />\n"; |
65 | &Header::closebox(); | |
66 | ||
986e08d9 | 67 | &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"}); |
df8c7810 MT |
68 | my $ftime = localtime((stat("$graphdir/firewallhits-year-line.png"))[9]); |
69 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 70 | print "<img alt='' src='/graphs/firewallhits-year-line.png' border='0' />"; |
df8c7810 MT |
71 | print "<br />\n"; |
72 | &Header::closebox(); | |
73 | } | |
74 | else | |
75 | { | |
986e08d9 | 76 | &Header::openbox('100%', 'center', $Lang::tr{"daily firewallhits"}); |
df8c7810 MT |
77 | my $ftime = localtime((stat("$graphdir/firewallhits-day-area.png"))[9]); |
78 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 79 | print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />"; |
df8c7810 MT |
80 | print "<br />\n"; |
81 | &Header::closebox(); | |
82 | ||
986e08d9 | 83 | &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"}); |
df8c7810 MT |
84 | my $ftime = localtime((stat("$graphdir/firewallhits-week-area.png"))[9]); |
85 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 86 | print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />"; |
df8c7810 MT |
87 | print "<br />\n"; |
88 | &Header::closebox(); | |
89 | ||
986e08d9 | 90 | &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"}); |
df8c7810 MT |
91 | my $ftime = localtime((stat("$graphdir/firewallhits-month-area.png"))[9]); |
92 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 93 | print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />"; |
df8c7810 MT |
94 | print "<br />\n"; |
95 | &Header::closebox(); | |
96 | ||
986e08d9 | 97 | &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"}); |
df8c7810 MT |
98 | my $ftime = localtime((stat("$graphdir/firewallhits-year-area.png"))[9]); |
99 | print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n"; | |
e455cafe | 100 | print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />"; |
df8c7810 MT |
101 | print "<br />\n"; |
102 | &Header::closebox(); | |
103 | } | |
104 | ||
105 | ||
106 | &Header::closebigbox(); | |
107 | &Header::closepage(); |