Revision: 8036
http://sourceforge.net/p/ipcop/svn/8036
Author: owes
Date: 2016-01-04 08:03:32 +0000 (Mon, 04 Jan 2016)
Log Message:
-----------
Modify other logviewers similar to system log.
Modified Paths:
--------------
ipcop/trunk/html/cgi-bin/logfirewall.cgi
ipcop/trunk/html/cgi-bin/logproxy.cgi
ipcop/trunk/html/cgi-bin/logsummary.cgi
ipcop/trunk/html/cgi-bin/logsystem.cgi
ipcop/trunk/html/cgi-bin/logurlfilter.cgi
ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0
Modified: ipcop/trunk/html/cgi-bin/logfirewall.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logfirewall.cgi 2016-01-03 16:47:04 UTC (rev
8035)
+++ ipcop/trunk/html/cgi-bin/logfirewall.cgi 2016-01-04 08:03:32 UTC (rev
8036)
@@ -16,7 +16,7 @@
# along with IPCop. If not, see <http://www.gnu.org/licenses/>.
#
# (c) The SmoothWall Team
-# Copyright (c) 2001-2011 The IPCop Team
+# Copyright (c) 2001-2016 The IPCop Team
#
# $Id$
#
@@ -49,11 +49,12 @@
my $dow = $now[6];
my $doy = $now[7];
my $tdoy = $now[7];
-my $year = $now[5] + 1900;
+my $thisyear = $now[5] + 1900;
-$cgiparams{'DAY'} = $now[3];
-$cgiparams{'MONTH'} = $now[4];
-$cgiparams{'ACTION'} = '';
+$cgiparams{'DAY'} = $now[3]; # day. 0 (=all), 1, ... , 31
+$cgiparams{'MONTH'} = $now[4]; # month. 0 (=January), 1 (=February),
... , 11 (=December)
+$cgiparams{'YEAR'} = $now[5]+1900; # year.
+$cgiparams{'ACTION'} = '';
&General::getcgihash(\%cgiparams);
$logsettings{'LOGVIEW_REVERSE'} = 'off';
@@ -62,51 +63,52 @@
my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0;
#index of firts line number to display
-if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) {
- my @temp = split(',', $ENV{'QUERY_STRING'});
- $start = $temp[0];
- $cgiparams{'MONTH'} = $temp[1];
- $cgiparams{'DAY'} = $temp[2];
-}
-
my @temp_then = ();
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) {
@temp_then = split(',', $ENV{'QUERY_STRING'});
$start = $temp_then[0];
- $cgiparams{'MONTH'} = $temp_then[1];
- $cgiparams{'DAY'} = $temp_then[2];
- $cgiparams{'SECTION'} = $temp_then[3];
+ $cgiparams{'YEAR'} = $temp_then[1];
+ $cgiparams{'MONTH'} = $temp_then[2];
+ $cgiparams{'DAY'} = $temp_then[3];
+ $cgiparams{'SECTION'} = $temp_then[4];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/)
|| !($cgiparams{'DAY'} =~
/^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
$cgiparams{'DAY'} = $now[3];
- $cgiparams{'MONTH'} = $now[4];
}
elsif ($cgiparams{'ACTION'} eq '>>') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, 1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, 1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
+# There is a comma in FR button string
+elsif (&Header::cleanhtml($cgiparams{'ACTION'},"y") eq $Lang::tr{'day today'})
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
+ $cgiparams{'DAY'} = $now[3];
+}
elsif ($cgiparams{'ACTION'} eq '<<') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, -1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
else {
- @temp_then = &General::validatedate(0, $cgiparams{'MONTH'},
$cgiparams{'DAY'});
- $year = $temp_then[5]+1900;
+ @temp_then = &General::validatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'});
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Date to display
my $date;
-$date = sprintf("%d-%02d-%02d", $year, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
+$date = sprintf("%d-%02d-%02d", $cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
my $monthstr = $General::shortMonths[ $cgiparams{'MONTH'} ];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? "
$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
@@ -129,7 +131,7 @@
$loop = 0;
}
else {
- $filestr = sprintf("/var/log/messages-%d%02d%02d", $year,
$cgiparams{'MONTH'}+1, $day_extension);
+ $filestr = sprintf("/var/log/messages-%d%02d%02d", $cgiparams{'YEAR'},
$cgiparams{'MONTH'}+1, $day_extension);
$filestr = "${filestr}.gz" if -f "${filestr}.gz";
}
@@ -218,10 +220,23 @@
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
- <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'month'}:
- <select name='MONTH'>
+ <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'year'}:
+ <select name='YEAR'>
END
;
+for (my $year = $thisyear-2; $year <= $thisyear; $year++) {
+ print "\t<option ";
+ if ($year == $cgiparams{'YEAR'}) {
+ print "selected='selected' ";
+ }
+ print "value='$year'>$year</option>\n";
+}
+print <<END
+ </select>
+ $Lang::tr{'month'}:
+ <select name='MONTH'>
+END
+ ;
for (my $month = 0; $month < 12; $month++) {
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
@@ -244,14 +259,15 @@
print "value='$day'>$day</option>\n";
}
print <<END
- </select>
- </td>
- <td width='45%' align='center'>
- <input type='submit' name='ACTION' title='$Lang::tr{'day
before'}' value='<<' />
- <input type='submit' name='ACTION' title='$Lang::tr{'day
after'}' value='>>' />
- <input type='submit' name='ACTION' value='$Lang::tr{'update'}'
/>
- <input type='submit' name='ACTION' value='$Lang::tr{'export'}'
/>
- </td>
+ </select>
+ </td>
+ <td width='45%' align='center'>
+ <input type='submit' name='ACTION' title='$Lang::tr{'day before'}'
value='<<' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'day today'}' />
+ <input type='submit' name='ACTION' title='$Lang::tr{'day after'}'
value='>>' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'export'}' />
+ </td>
<td class='onlinehelp'>
<a href='${General::adminmanualurl}/logs-firewall.html'
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help
en'}' title='$Lang::tr{'online help en'}' /></a>
</td>
@@ -386,13 +402,12 @@
print <<END
<table width='100%'>
<tr>
+ <td align='center' width='50%'>
END
;
- print "<td align='center' width='50%'>";
if ($prev != -1) {
- print
-"<a
href='/cgi-bin/logfirewall.cgi?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
+ print "<a
href='/cgi-bin/logfirewall.cgi?$prev,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SECTION'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
@@ -401,15 +416,14 @@
print "<td align='center' width='50%'>";
if ($next >= 0) {
- print
-"<a
href='/cgi-bin/logfirewall.cgi?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a>";
+ print "<a
href='/cgi-bin/logfirewall.cgi?$next,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SECTION'}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
}
- print "</td>\n";
print <<END
+ </td>
</tr>
</table>
END
Modified: ipcop/trunk/html/cgi-bin/logproxy.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logproxy.cgi 2016-01-03 16:47:04 UTC (rev
8035)
+++ ipcop/trunk/html/cgi-bin/logproxy.cgi 2016-01-04 08:03:32 UTC (rev
8036)
@@ -16,7 +16,7 @@
# along with IPCop. If not, see <http://www.gnu.org/licenses/>.
#
# (c) The SmoothWall Team
-# Copyright (c) 2001-2014 The IPCop Team
+# Copyright (c) 2001-2016 The IPCop Team
#
# $Id$
#
@@ -51,10 +51,11 @@
my $dow = $now[6]; # day of week
my $doy = $now[7]; # day of year (0..364)
my $tdoy = $now[7];
-my $year = $now[5] + 1900;
+my $thisyear = $now[5] + 1900;
-$cgiparams{'DAY'} = $now[3];
-$cgiparams{'MONTH'} = $now[4];
+$cgiparams{'DAY'} = $now[3]; # day. 0 (=all), 1, ... , 31
+$cgiparams{'MONTH'} = $now[4]; # month. 0 (=January), 1 (=February),
... , 11 (=December)
+$cgiparams{'YEAR'} = $now[5]+1900; # year.
$cgiparams{'SOURCE_IP'} = 'ALL';
$cgiparams{'USERNAME'} = 'ALL';
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
@@ -94,41 +95,49 @@
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) {
@temp_then = split(',', $ENV{'QUERY_STRING'});
$start = $temp_then[0];
- $cgiparams{'MONTH'} = $temp_then[1];
- $cgiparams{'DAY'} = $temp_then[2];
- $cgiparams{'SOURCE_IP'} = $temp_then[3];
- $cgiparams{'USERNAME'} = $temp_then[4];
+ $cgiparams{'YEAR'} = $temp_then[1];
+ $cgiparams{'MONTH'} = $temp_then[2];
+ $cgiparams{'DAY'} = $temp_then[3];
+ $cgiparams{'SECTION'} = $temp_then[4];
+ $cgiparams{'SOURCE_IP'} = $temp_then[5];
+ $cgiparams{'USERNAME'} = $temp_then[6];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/)
|| !($cgiparams{'DAY'} =~
/^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
$cgiparams{'DAY'} = $now[3];
- $cgiparams{'MONTH'} = $now[4];
}
elsif ($cgiparams{'ACTION'} eq '>>') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, 1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, 1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
+# There is a comma in FR button string
+elsif (&Header::cleanhtml($cgiparams{'ACTION'},"y") eq $Lang::tr{'day today'})
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
+ $cgiparams{'DAY'} = $now[3];
+}
elsif ($cgiparams{'ACTION'} eq '<<') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, -1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
else {
- @temp_then = &General::validatedate(0, $cgiparams{'MONTH'},
$cgiparams{'DAY'});
- $year = $temp_then[5]+1900;
+ @temp_then = &General::validatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'});
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Date to display
-my $date;
-$date = sprintf("%d-%02d-%02d", $year, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
+my $date = sprintf("%d-%02d-%02d", $cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
my $filter = $cgiparams{'ENABLE_FILTER'} eq 'on' ? $cgiparams{'FILTER'} :
'';
my $sourceip = $cgiparams{'SOURCE_IP'};
@@ -158,7 +167,7 @@
$loop = 0;
}
else {
- $filestr = sprintf("/var/log/squid/access.log-%d%02d%02d", $year,
$cgiparams{'MONTH'}+1, $day_extension);
+ $filestr = sprintf("/var/log/squid/access.log-%d%02d%02d",
$cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1, $day_extension);
$filestr = "${filestr}.gz" if -f "${filestr}.gz";
}
@@ -306,10 +315,23 @@
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
- <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'month'}:
- <select name='MONTH'>
+ <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'year'}:
+ <select name='YEAR'>
END
;
+for (my $year = $thisyear-2; $year <= $thisyear; $year++) {
+ print "\t<option ";
+ if ($year == $cgiparams{'YEAR'}) {
+ print "selected='selected' ";
+ }
+ print "value='$year'>$year</option>\n";
+}
+print <<END
+ </select>
+ $Lang::tr{'month'}:
+ <select name='MONTH'>
+END
+ ;
for (my $month = 0; $month < 12; $month++) {
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
@@ -318,12 +340,12 @@
print "value='$month'>$Lang::tr{$General::longMonths[$month]}</option>\n";
}
print <<END
- </select>
- $Lang::tr{'day'}:
- <select name='DAY'>
+ </select>
+ $Lang::tr{'day'}:
+ <select name='DAY'>
END
;
-print "<option value='0'>$Lang::tr{'all'}</option>";
+print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++) {
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -332,14 +354,15 @@
print "value='$day'>$day</option>\n";
}
print <<END
- </select>
- </td>
- <td width='45%' align='center'>
- <input type='submit' name='ACTION' title='$Lang::tr{'day
before'}' value='<<' />
- <input type='submit' name='ACTION' title='$Lang::tr{'day
after'}' value='>>' />
- <input type='submit' name='ACTION' value='$Lang::tr{'update'}'
/>
- <input type='submit' name='ACTION' value='$Lang::tr{'export'}'
/>
- </td>
+ </select>
+ </td>
+ <td width='45%' align='center'>
+ <input type='submit' name='ACTION' title='$Lang::tr{'day before'}'
value='<<' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'day today'}' />
+ <input type='submit' name='ACTION' title='$Lang::tr{'day after'}'
value='>>' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'export'}' />
+ </td>
<td class='onlinehelp'>
<a href='${General::adminmanualurl}/logs-proxy.html'
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help
en'}' title='$Lang::tr{'online help en'}' /></a>
</td>
@@ -479,7 +502,7 @@
print "<td align='center' width='50%'>";
if ($prev != -1) {
print
-"<a
href='/cgi-bin/logproxy.cgi?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'older'}</a>";
+"<a
href='/cgi-bin/logproxy.cgi?$prev,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
@@ -489,7 +512,7 @@
print "<td align='center' width='50%'>";
if ($next >= 0) {
print
-"<a
href='/cgi-bin/logproxy.cgi?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'newer'}</a>";
+"<a
href='/cgi-bin/logproxy.cgi?$next,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
Modified: ipcop/trunk/html/cgi-bin/logsummary.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logsummary.cgi 2016-01-03 16:47:04 UTC (rev
8035)
+++ ipcop/trunk/html/cgi-bin/logsummary.cgi 2016-01-04 08:03:32 UTC (rev
8036)
@@ -16,7 +16,7 @@
# along with IPCop. If not, see <http://www.gnu.org/licenses/>.
#
# (c) The SmoothWall Team
-# Copyright (c) 2001-2011 The IPCop Team
+# Copyright (c) 2001-2016 The IPCop Team
#
# $Id$
#
@@ -54,21 +54,21 @@
my $errormessage = '';
my @now = localtime();
-my $year = $now[5] + 1900;
+my $thisyear = $now[5] + 1900;
-$cgiparams{'MONTH'} = '';
-$cgiparams{'DAY'} = '';
-$cgiparams{'ACTION'} = '';
+$cgiparams{'DAY'} = ''; # day. 0 (=all), 1, ... , 31
+$cgiparams{'MONTH'} = ''; # month. 0 (=January), 1 (=February),
... , 11 (=December)
+$cgiparams{'YEAR'} = ''; # year.
+$cgiparams{'ACTION'} = '';
&General::getcgihash(\%cgiparams);
-my $start = -1;
my @temp_then = ();
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) {
@temp_then = split(',', $ENV{'QUERY_STRING'});
- $start = $temp_then[0];
- $cgiparams{'MONTH'} = $temp_then[1];
- $cgiparams{'DAY'} = $temp_then[2];
+ $cgiparams{'YEAR'} = $temp_then[1];
+ $cgiparams{'MONTH'} = $temp_then[2];
+ $cgiparams{'DAY'} = $temp_then[3];
}
if ( !($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/)
@@ -77,44 +77,44 @@
{
# Reports are generated at the end of the day, so if nothing is selected
# we need to display yesterdays (todays won't have been generated yet)
- @temp_then = &General::calculatedate(0, $now[4], $now[3], -1);
+ @temp_then = &General::calculatedate($now[5]+1900, $now[4], $now[3], -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
elsif ($cgiparams{'ACTION'} eq '>>') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, 1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, 1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
+# There is a comma in FR button string
+elsif (&Header::cleanhtml($cgiparams{'ACTION'},"y") eq $Lang::tr{'day today'})
{
+ @temp_then = &General::calculatedate($now[5]+1900, $now[4], $now[3], -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
+ $cgiparams{'MONTH'} = $temp_then[4];
+ $cgiparams{'DAY'} = $temp_then[3];
+}
elsif ($cgiparams{'ACTION'} eq '<<') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, -1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
else {
- @temp_then = &General::validatedate(0, $cgiparams{'MONTH'},
$cgiparams{'DAY'});
- $year = $temp_then[5]+1900;
+ @temp_then = &General::validatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'});
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
-if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4])) {
- if ( ($cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3])
- || ($cgiparams{'MONTH'} > $now[4]))
- {
- $year = $year - 1;
- }
-}
-
my $monthnum = $cgiparams{'MONTH'} + 1;
my $monthstr = $monthnum <= 9 ? "0$monthnum" : "$monthnum";
my $longmonthstr = $Lang::tr{$General::longMonths[$cgiparams{'MONTH'}]};
my $daystr = $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" :
"$cgiparams{'DAY'}";
my $skip = 0;
-my $filestr = "/var/log/logwatch/$year-$monthstr-$daystr";
+my $filestr = "/var/log/logwatch/$cgiparams{'YEAR'}-$monthstr-$daystr";
if (!(open(FILE, $filestr))) {
$errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could
not be opened'}";
@@ -151,10 +151,23 @@
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
<table width='100%'>
<tr>
- <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'month'}:
- <select name='MONTH'>
+ <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'year'}:
+ <select name='YEAR'>
END
;
+for (my $year = $thisyear-2; $year <= $thisyear; $year++) {
+ print "\t<option ";
+ if ($year == $cgiparams{'YEAR'}) {
+ print "selected='selected' ";
+ }
+ print "value='$year'>$year</option>\n";
+}
+print <<END
+ </select>
+ $Lang::tr{'month'}:
+ <select name='MONTH'>
+END
+ ;
for (my $month = 0; $month < 12; $month++) {
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
@@ -163,9 +176,9 @@
print "value='$month'>$Lang::tr{$General::longMonths[$month]}</option>\n";
}
print <<END
- </select>
- $Lang::tr{'day'}:
- <select name='DAY'>
+ </select>
+ $Lang::tr{'day'}:
+ <select name='DAY'>
END
;
for (my $day = 1; $day <= 31; $day++) {
@@ -176,14 +189,15 @@
print "value='$day'>$day</option>\n";
}
print <<END
- </select>
- </td>
- <td width='45%' align='center'>
- <input type='submit' name='ACTION' title='$Lang::tr{'day
before'}' value='<<' />
- <input type='submit' name='ACTION' title='$Lang::tr{'day
after'}' value='>>' />
- <input type='submit' name='ACTION' value='$Lang::tr{'update'}'
/>
- <input type='submit' name='ACTION' value='$Lang::tr{'export'}'
/>
- </td>
+ </select>
+ </td>
+ <td width='45%' align='center'>
+ <input type='submit' name='ACTION' title='$Lang::tr{'day before'}'
value='<<' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'day today'}' />
+ <input type='submit' name='ACTION' title='$Lang::tr{'day after'}'
value='>>' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'export'}' />
+ </td>
<td class='onlinehelp'>
<a href='${General::adminmanualurl}/logs-summary.html'
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help
en'}' title='$Lang::tr{'online help en'}' /></a>
</td>
Modified: ipcop/trunk/html/cgi-bin/logsystem.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logsystem.cgi 2016-01-03 16:47:04 UTC (rev
8035)
+++ ipcop/trunk/html/cgi-bin/logsystem.cgi 2016-01-04 08:03:32 UTC (rev
8036)
@@ -143,8 +143,7 @@
}
# Date to display
-my $date;
-$date = sprintf("%d-%02d-%02d", $cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
+my $date = sprintf("%d-%02d-%02d", $cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
my $monthstr = $General::shortMonths[ $cgiparams{'MONTH'} ];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? "
$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
@@ -366,9 +365,9 @@
print <<END
<table width='100%'>
<tr>
- <td width='10%' align='center'
class='boldbase'><b>$Lang::tr{'time'}</b></td>
- <td width='15%' align='center'
class='boldbase'><b>$Lang::tr{'section'}</b></td>
- <td width='75%'> </td>
+ <td width='10%' align='center'
class='boldbase'><b>$Lang::tr{'time'}</b></td>
+ <td width='15%' align='center'
class='boldbase'><b>$Lang::tr{'section'}</b></td>
+ <td width='75%'> </td>
</tr>
END
;
Modified: ipcop/trunk/html/cgi-bin/logurlfilter.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/logurlfilter.cgi 2016-01-03 16:47:04 UTC (rev
8035)
+++ ipcop/trunk/html/cgi-bin/logurlfilter.cgi 2016-01-04 08:03:32 UTC (rev
8036)
@@ -16,7 +16,7 @@
# along with IPCop. If not, see <http://www.gnu.org/licenses/>.
#
# (c) 2004-2008 marco.s - http://www.urlfilter.net
-# (c) 2011-2012 The IPCop Team
+# (c) 2011-2016 The IPCop Team
#
# $Id$
#
@@ -53,12 +53,13 @@
my %usernames=();
my @now = localtime();
-my $year = $now[5] + 1900;
+my $thisyear = $now[5] + 1900;
$cgiparams{'ACTION'} = '';
-$cgiparams{'DAY'} = $now[3];
-$cgiparams{'MONTH'} = $now[4];
+$cgiparams{'DAY'} = $now[3]; # day. 0 (=all), 1, ... , 31
+$cgiparams{'MONTH'} = $now[4]; # month. 0 (=January), 1 (=February),
... , 11 (=December)
+$cgiparams{'YEAR'} = $now[5]+1900; # year.
$cgiparams{'CATEGORY'} = 'ALL';
$cgiparams{'SOURCE_IP'} = 'ALL';
$cgiparams{'USERNAME'} = 'ALL';
@@ -73,45 +74,55 @@
}
my $start = 0;
+
my @temp_then = ();
if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'}) {
@temp_then = split(',', $ENV{'QUERY_STRING'});
+ @temp_then = split(',', $ENV{'QUERY_STRING'});
$start = $temp_then[0];
- $cgiparams{'MONTH'} = $temp_then[1];
- $cgiparams{'DAY'} = $temp_then[2];
- $cgiparams{'CATEGORY'} = $temp_then[3];
- $cgiparams{'SOURCE_IP'} = $temp_then[4];
- $cgiparams{'USERNAME'} = $temp_then[5];
+ $cgiparams{'YEAR'} = $temp_then[1];
+ $cgiparams{'MONTH'} = $temp_then[2];
+ $cgiparams{'DAY'} = $temp_then[3];
+ $cgiparams{'CATEGORY'} = $temp_then[4];
+ $cgiparams{'SOURCE_IP'} = $temp_then[5];
+ $cgiparams{'USERNAME'} = $temp_then[6];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/)
|| !($cgiparams{'DAY'} =~
/^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
$cgiparams{'DAY'} = $now[3];
- $cgiparams{'MONTH'} = $now[4];
}
elsif ($cgiparams{'ACTION'} eq '>>') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, 1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, 1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
+# There is a comma in FR button string
+elsif (&Header::cleanhtml($cgiparams{'ACTION'},"y") eq $Lang::tr{'day today'})
{
+ $cgiparams{'YEAR'} = $now[5]+1900;
+ $cgiparams{'MONTH'} = $now[4];
+ $cgiparams{'DAY'} = $now[3];
+}
elsif ($cgiparams{'ACTION'} eq '<<') {
- @temp_then = &General::calculatedate($year, $cgiparams{'MONTH'},
$cgiparams{'DAY'}, -1);
- $year = $temp_then[5]+1900;
+ @temp_then = &General::calculatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'}, -1);
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
else {
- @temp_then = &General::validatedate(0, $cgiparams{'MONTH'},
$cgiparams{'DAY'});
- $year = $temp_then[5]+1900;
+ @temp_then = &General::validatedate($cgiparams{'YEAR'},
$cgiparams{'MONTH'}, $cgiparams{'DAY'});
+ $cgiparams{'YEAR'} = $temp_then[5]+1900;
$cgiparams{'MONTH'} = $temp_then[4];
$cgiparams{'DAY'} = $temp_then[3];
}
# Date to display
-my $date = sprintf("%d-%02d-%02d", $year, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
+my $date = sprintf("%d-%02d-%02d", $cgiparams{'YEAR'}, $cgiparams{'MONTH'}+1,
$cgiparams{'DAY'});
my $monthstr = $General::shortMonths[ $cgiparams{'MONTH'} ];
my $daystr = $cgiparams{'DAY'} == 0 ? '..' : $cgiparams{'DAY'} <= 9 ? "
$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
@@ -182,36 +193,42 @@
<form method='post' action="$ENV{'SCRIPT_NAME'}">
<table width='100%'>
<tr>
- <td width='5%' class='base' nowrap='nowrap'>
- $Lang::tr{'month'}:
- </td>
- <td width='20%'>
- <select name='MONTH'>
+ <td width='50%' class='base' nowrap='nowrap'>$Lang::tr{'year'}:
+ <select name='YEAR'>
END
-;
-for (my $month = 0; $month < 12; $month++)
-{
+ ;
+for (my $year = $thisyear-2; $year <= $thisyear; $year++) {
print "\t<option ";
+ if ($year == $cgiparams{'YEAR'}) {
+ print "selected='selected' ";
+ }
+ print "value='$year'>$year</option>\n";
+}
+print <<END
+ </select>
+ $Lang::tr{'month'}:
+ <select name='MONTH'>
+END
+ ;
+for (my $month = 0; $month < 12; $month++) {
+ print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
- print 'selected="selected" ';
+ print "selected='selected' ";
}
print "value='$month'>$Lang::tr{$General::longMonths[$month]}</option>\n";
}
print <<END
- </select>
- </td>
- <td width='5%' class='base' nowrap='nowrap'>
- $Lang::tr{'day'}:
- </td>
- <td width='20%'>
+ </select>
+ $Lang::tr{'day'}:
<select name='DAY'>
END
-;
-for (my $day = 1; $day <= 31; $day++)
-{
+ ;
+print "<option value='0'>$Lang::tr{'all'}</option>\n";
+for (my $day = 1; $day <= 31; $day++) {
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
- print 'selected="selected" '; }
+ print "selected='selected' ";
+ }
print "value='$day'>$day</option>\n";
}
print <<END
@@ -219,18 +236,18 @@
</td>
<td width='45%'>
<input type='submit' name='ACTION' title='$Lang::tr{'day before'}'
value='<<' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'day today'}' />
<input type='submit' name='ACTION' title='$Lang::tr{'day after'}'
value='>>' />
<input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
- <input type='submit' name='ACTION' value='$Lang::tr{'export'}' /></td>
- <td width='5%' class='onlinehelp'>
+ <input type='submit' name='ACTION' value='$Lang::tr{'export'}' />
+ </td>
+ <td class='onlinehelp'>
<a href='${General::adminmanualurl}/logs-urlfilter.html'
target='_blank'><img src='/images/web-support.png' alt='$Lang::tr{'online help
en'}' title='$Lang::tr{'online help en'}' /></a>
</td>
</tr>
-<tr>
- <td colspan='6'><hr /></td>
-</tr>
</table>
-<table width='100%'>
+<hr />
+<table>
END
;
@@ -241,8 +258,8 @@
print <<END
<tr>
- <td class='base' nowrap='nowrap'>$Lang::tr{'category'}: </td>
- <td width='30%'>
+ <td width='25%' class='base'
nowrap='nowrap'>$Lang::tr{'category'}: </td>
+ <td width='25%' class='base'>
<select name='CATEGORY'>
<option value='ALL' $selectedAllCat>$Lang::tr{'caps all'}</option>
END
@@ -257,8 +274,8 @@
print <<END
</select>
</td>
- <td class='base' nowrap='nowrap'>$Lang::tr{'client'}: </td>
- <td width='30%'>
+ <td width='25%' class='base'
nowrap='nowrap'>$Lang::tr{'client'}: </td>
+ <td width='25%' class='base'>
END
;
@@ -478,7 +495,7 @@
$loginfo[3] =~ s/\%5c/\\/;
$usernames{$loginfo[3]}++;
- if (($logyear == $year)
+ if (($logyear == $cgiparams{'YEAR'})
&& ($logmonth == $cgiparams{'MONTH'}+1)
&& ($logday == $cgiparams{'DAY'})) {
push(@log,$_)
@@ -518,7 +535,7 @@
;
if ($prev != -1) {
- print "<a
href='$ENV{'SCRIPT_NAME'}?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'CATEGORY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'older'}</a>";
+ print "<a
href='$ENV{'SCRIPT_NAME'}?$prev,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'CATEGORY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
@@ -527,7 +544,7 @@
print "<td align='center' width='50%'>";
if ($next >= 0) {
- print "<a
href='$ENV{'SCRIPT_NAME'}?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'CATEGORY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'newer'}</a>";
+ print "<a
href='$ENV{'SCRIPT_NAME'}?$next,$cgiparams{'YEAR'},$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{'CATEGORY'},$cgiparams{'SOURCE_IP'},$cgiparams{'USERNAME'}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
Modified: ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0
===================================================================
--- ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0 2016-01-03 16:47:04 UTC
(rev 8035)
+++ ipcop/trunk/updates/2.2.0/ROOTFILES.i486-2.2.0 2016-01-04 08:03:32 UTC
(rev 8036)
@@ -2,7 +2,11 @@
##
/etc/rc.d/rc.red
/etc/rc.d/rc.sysinit
+/home/httpd/cgi-bin/logfirewall.cgi
+/home/httpd/cgi-bin/logproxy.cgi
+/home/httpd/cgi-bin/logsummary.cgi
/home/httpd/cgi-bin/logsystem.cgi
+/home/httpd/cgi-bin/logurlfilter.cgi
/home/httpd/cgi-bin/openvpn.cgi
/home/httpd/cgi-bin/remote.cgi
/home/httpd/cgi-bin/updates.cgi
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn