#!/usr/bin/perl
#
# This code is distributed under the terms of the GPL
#
use strict;
# enable only the following on debugging purpose
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my %cgiparams=();
my @cgigraphs=();
my @graphs=();
$ENV{'QUERY_STRING'} =~ s/&//g;
@cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
$cgigraphs[1] = '' unless defined $cgigraphs[1];
&Header::showhttpheaders();
my $graphdir = "/home/httpd/html/graphs";
my @LOCALCHECK=();
my $errormessage="";
&Header::openpage('firewall graphs', 1, ' ');
&Header::openbigbox('100%', 'left', '', $errormessage);
print <
show lines
show areas
|
END
if ($cgigraphs[1] eq "line") {
&Header::openbox('100%', 'center', "daily firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-day-line.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "weekly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-week-line.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "monthly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-month-line.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "yearly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-year-line.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
}
else
{
&Header::openbox('100%', 'center', "daily firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-day-area.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "weekly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-week-area.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "monthly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-month-area.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
&Header::openbox('100%', 'center', "yearly firewallhits");
my $ftime = localtime((stat("$graphdir/firewallhits-year-area.png"))[9]);
print "$Lang::tr{'the statistics were last updated at'}: $ftime
\n";
print "";
print "
\n";
&Header::closebox();
}
&Header::closebigbox();
&Header::closepage();