Early spring clean: Remove trailing whitespaces, and correct licence headers

Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
This commit is contained in:
Peter Müller
2022-02-18 23:54:57 +00:00
parent b5aec71462
commit 66c3619872
511 changed files with 3702 additions and 2564 deletions

View File

@@ -39,7 +39,7 @@ my $hintcolour='#FFFFCC';
my $commandline='';
my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
my %monthidx = (qw(Jan 0 Feb 1 Mar 2 Apr 3 May 4 Jun 5 Jul 6 Aug 7 Sep 8 Oct 9 Nov 10 Dec 11));
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'},
@@ -350,7 +350,7 @@ print <<END
<select name='DAY_BEGIN'>
END
;
for ($day_begin = 1; $day_begin <= 31; $day_begin++)
for ($day_begin = 1; $day_begin <= 31; $day_begin++)
{
print "\t<option ";
if ($day_begin == $reportsettings{'DAY_BEGIN'}) {
@@ -364,7 +364,7 @@ print <<END
<select name='YEAR_BEGIN'>
END
;
for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
for ($year_begin = $year-2; $year_begin <= $year+1; $year_begin++)
{
print "\t<option ";
if ($year_begin == $reportsettings{'YEAR_BEGIN'}) {
@@ -393,7 +393,7 @@ print <<END
<select name='DAY_END'>
END
;
for ($day_end = 1; $day_end <= 31; $day_end++)
for ($day_end = 1; $day_end <= 31; $day_end++)
{
print "\t<option ";
if ($day_end == $reportsettings{'DAY_END'}) {
@@ -407,7 +407,7 @@ print <<END
<select name='YEAR_END'>
END
;
for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
for ($year_end = $year-2; $year_end <= $year+1; $year_end++)
{
print "\t<option ";
if ($year_end == $reportsettings{'YEAR_END'}) {

View File

@@ -122,7 +122,7 @@ my $date = $cgiparams{'DAY'} == 0 ? '' : $cgiparams{'DAY'} <= 9 ? "0$cgiparams{
{
my $xday;
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
@@ -216,7 +216,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
print "$time $3\r\n";
}
exit 0;
}
@@ -248,7 +248,7 @@ for (my $month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@@ -261,11 +261,11 @@ print <<END
END
;
print "<option value='0'>$Lang::tr{'all'}</option>\n";
for (my $day = 1; $day <= 31; $day++)
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";
}
@@ -298,7 +298,7 @@ if ($start == 0) {
$prev = $start - ${Header::viewsize};
$prev = 0 if ( $prev < 0);
}
my $next;
if ($start == $lastPageIndex) {
$next = -1;
@@ -339,7 +339,7 @@ foreach $_ (@log)
my $day = $1;
$day =~ tr / /0/;
my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
my $chain = $3;
my $chain = $3;
my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
if ($packet =~ /PHYSIN=(\w+)/) { $iface=$1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
@@ -364,7 +364,7 @@ foreach $_ (@log)
my $servi = uc(getservbyport($srcport, lc($proto)));
if ($servi ne '' && $srcport < 1024) {
$srcport = "$srcport($servi)";
$srcport = "$srcport($servi)";
}
$servi = uc(getservbyport($dstport, lc($proto)));
if ($servi ne '' && $dstport < 1024) {
@@ -375,11 +375,11 @@ foreach $_ (@log)
my $col="";
if ($lines % 2) {
print "<tr>";
$col="bgcolor='$color{'color20'}'";
$col="bgcolor='$color{'color20'}'";
}
else {
print "<tr>";
$col="bgcolor='$color{'color22'}'";
$col="bgcolor='$color{'color22'}'";
}
print <<END
@@ -428,21 +428,21 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'first'} $Lang::tr{'older'}";
print "$Lang::tr{'first'} $Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next >= 0) {
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>";
}
else {
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
print "$Lang::tr{'newer'} $Lang::tr{'last'} ";
}
print "</td>\n";

View File

@@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@@ -150,7 +150,7 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
my $day = $cgiparams{'DAY'};
my $daystr='';
if ($day <= 9) {
$daystr = " $day";
$daystr = " $day";
}
else {
$daystr = $day;
@@ -182,7 +182,7 @@ if (!$skip)
$lines++;
}
}
close (FILE);
close (FILE);
}
$skip=0;
@@ -249,7 +249,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -386,7 +386,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];

View File

@@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@@ -181,7 +181,7 @@ if (!$skip)
$lines++;
}
}
close (FILE);
close (FILE);
}
$skip=0;
@@ -237,7 +237,7 @@ for ($month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@@ -249,11 +249,11 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$day'>$day</option>\n";
}
@@ -359,7 +359,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];
@@ -437,7 +437,7 @@ for($s=0;$s<$lines;$s++)
# Get country code.
my $ccode = &Location::Functions::lookup_country_code($key[$s]);
$color++;
print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";

View File

@@ -4,7 +4,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt
@@ -249,7 +249,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -360,7 +360,7 @@ my @numb;
my $o;
if($cgiparams{'otherspie'} == 2 ){}
else{
else{
my $numothers;
for($o=0;$o<$pienumber;$o++){
$numothers = $numothers + $numb[$o];

View File

@@ -71,7 +71,7 @@ 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];
$cgiparams{'DAY'} = $temp[2];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@@ -116,7 +116,7 @@ if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
my $lastleap=($year-1)%4;
my $lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$doy+366;
@@ -158,7 +158,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "IPFire IPS log\r\n";
print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
print "Date: $cgiparams{'DAY'} $longmonths[$cgiparams{'MONTH'}]\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
@@ -231,7 +231,7 @@ print <<END
<select name='DAY'>
END
;
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {

View File

@@ -329,7 +329,7 @@ unless ($errormessage) {
}
# If nothing has been fetched, the amount of lines is still zero.
# In this case display a hint about no data.
# In this case display a hint about no data.
unless ($lines) {
print "<tr><td bgcolor='$color{'color22'}' colspan='6' align='center'>$Lang::tr{'no entries'}</td></tr>\n";
}

View File

@@ -50,7 +50,7 @@ my $doy = $now[7]; # day of year (0..364)
my $tdoy = $now[7];
my $year = $now[5]+1900;
$cgiparams{'DAY'} = $now[3];
$cgiparams{'DAY'} = $now[3];
$cgiparams{'MONTH'} = $now[4];
$cgiparams{'SOURCE_IP'} = 'ALL';
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
@@ -70,7 +70,7 @@ if ($cgiparams{'ACTION'} eq '')
if ($cgiparams{'ACTION'} eq $Lang::tr{'restore defaults'})
{
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|css|js)\$";
$cgiparams{'ENABLE_FILTER'} = 'off';
$cgiparams{'ENABLE_FILTER'} = 'off';
}
{
@@ -88,7 +88,7 @@ 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];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'SOURCE_IP'} = $temp[3];
$cgiparams{'USERNAME'} = &Header::escape($temp[4]);
}
@@ -151,7 +151,7 @@ my $daystr = $cgiparams{'DAY'} == 0 ? '' :$cgiparams{'DAY'} <= 9 ? "0$cgiparams{
# Calculate time. If future date, calculate for past year !!!
if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
( $cgiparams{'MONTH'} > $now[4] ) ) {
( $cgiparams{'MONTH'} > $now[4] ) ) {
$xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
$daystr = "$longmonths[$cgiparams{'MONTH'}] $daystr, ". int($year-1);
} else {
@@ -210,14 +210,14 @@ if ($@ ne '')
$temp_now[2] = $temp_now[1] = $temp_now[0] = 0; # start at 00:00:00
$temp_now[3] = 1 if ($cgiparams{'DAY'}==0); # All days selected, start at '1'
my $mintime = POSIX::mktime(@temp_now);
my $mintime = POSIX::mktime(@temp_now);
my $maxtime;
if ($cgiparams{'DAY'}==0) { # full month
if ($temp_now[4]++ == 12){
$temp_now[4] = 0;
$temp_now[5]++;
};
$maxtime = POSIX::mktime(@temp_now);
$maxtime = POSIX::mktime(@temp_now);
} else {
$maxtime = $mintime + 86400; # full day
}
@@ -248,7 +248,7 @@ if ($@ ne '')
# $datetime = $maxtime; # we have read viewsize lines, stop main loop
# last READ; # exit read file
}
}
}
}
# finish loop when date of lines are past maxtime
@@ -278,7 +278,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
{
print "Content-type: text/plain\n\n";
print "IPFire proxy log\r\n";
print "$Lang::tr{'date'}: $daystr\r\n";
print "$Lang::tr{'date'}: $daystr\r\n";
print "Source IP: $cgiparams{'SOURCE_IP'}\r\n";
print "Username: $cgiparams{'USERNAME'}\r\n";
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
@@ -350,7 +350,7 @@ print <<END
END
;
print "<option value='0'>$Lang::tr{'all'}</option>";
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -464,7 +464,7 @@ foreach $_ (@log)
$url =~ /(^.{0,60})/;
my $part = $1;
unless (length($part) < 60) { $part = "${part}..."; }
unless (length($part) < 60) { $part = "${part}..."; }
$url = &Header::cleanhtml($url,"y");
$part = &Header::cleanhtml($part,"y");
if ($cgiparams{'DAY'}==0) { # full month

View File

@@ -3,7 +3,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
@@ -168,7 +168,7 @@ if (!$skip)
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
# Extract ipv4 and ipv6 addresses
if (($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
$srcaddr = $1;
$srcaddr = $1;
}
if($iface eq $country) {
@@ -186,7 +186,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@@ -257,7 +257,7 @@ for ($month = 0; $month < 12; $month++)
{
print "\t<option ";
if ($month == $cgiparams{'MONTH'}) {
print "selected='selected' ";
print "selected='selected' ";
}
print "value='$month'>$longmonths[$month]</option>\n";
}
@@ -269,7 +269,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -295,7 +295,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@@ -336,9 +336,9 @@ foreach $_ (@slice)
if (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=.*)$/) {}
elsif (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {};
my $packet = $4;
my $iface = '';
my $iface = '';
# If ipv6 uses bridge, use PHYSIN otherwise use IN
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
if ( $1 =~ /2./ ){ $iface=""; }
my $srcaddr = '';
# Extract ipv4 and ipv6 addresses
@@ -377,10 +377,10 @@ foreach $_ (@slice)
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@@ -432,19 +432,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@@ -3,7 +3,7 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
@@ -162,7 +162,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@@ -230,7 +230,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -256,7 +256,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@@ -320,10 +320,10 @@ foreach $_ (@slice) {
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@@ -375,19 +375,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@@ -4,14 +4,14 @@
#
# This code is distributed under the terms of the GPL
#
# JC HERITIER
# JC HERITIER
# page inspired from the initial firewalllog.dat
#
# Modified for IPFire by Christian Schmidt (www.ipfire.org)
#Aug 28 14:54:30 shite kernel: IN=ppp0 OUT= MAC= SRC=213.48.150.1
#DST=213.208.115.234 LEN=110 TOS=0x00 PREC=0x00 TTL=60 ID=30699 DF PROTO=TCP
#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
#SPT=6667 DPT=62593 WINDOW=2505 RES=0x00 ACK PSH URGP=0
use strict;
@@ -170,7 +170,7 @@ if (!$skip)
}
}
}
close (FILE);
close (FILE);
}
$skip=0;
@@ -238,7 +238,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -264,7 +264,7 @@ END
print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
if ($start == -1) {
$start = $lines - ${Header::viewsize};
$start = $lines - ${Header::viewsize};
}
if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
if ($start < 0) { $start = 0; }
@@ -330,10 +330,10 @@ foreach $_ (@slice)
if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
if ($lines % 2) {
print "<tr bgcolor='${Header::table1colour}'>\n";
print "<tr bgcolor='${Header::table1colour}'>\n";
}
else {
print "<tr bgcolor='${Header::table2colour}'>\n";
print "<tr bgcolor='${Header::table2colour}'>\n";
}
print <<END
<td align='center'>$time</td>
@@ -385,19 +385,19 @@ END
print "<td align='center' width='50%'>";
if ($prev != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>";
}
else {
print "$Lang::tr{'older'}";
print "$Lang::tr{'older'}";
}
print "</td>\n";
print "<td align='center' width='50%'>";
if ($next != -1) {
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>";
}
else {
print "$Lang::tr{'newer'}";
print "$Lang::tr{'newer'}";
}
print "</td>\n";

View File

@@ -152,7 +152,7 @@ print <<END
<select name='DAY'>
END
;
for (my $day = 1; $day <= 31; $day++)
for (my $day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {

View File

@@ -107,8 +107,8 @@ if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
@temp = split(',',$ ENV{'QUERY_STRING'});
$start = $temp[0];
$cgiparams{'MONTH'} = $temp[1];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'LOGTYPE'} = $temp[3];
$cgiparams{'DAY'} = $temp[2];
$cgiparams{'LOGTYPE'} = $temp[3];
}
if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
@@ -153,7 +153,7 @@ if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
@then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
}
$tdoy = $then[7];
$lastleap=($year-1)%4;
$lastleap=($year-1)%4;
if ($tdoy>$doy) {
if ($lastleap == 0 && $tdoy < 60) {
$doy=$tdoy+366;
@@ -180,7 +180,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
print "Content-type: text/plain\n\n";
print "IPCop URL filter log\r\n";
print "Section: $cgiparams{'LOGTYPE'}\r\n";
print "Date: $daystr $longmonthstr\r\n";
print "Date: $daystr $longmonthstr\r\n";
print "\r\n";
if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
@@ -258,7 +258,7 @@ print <<END
<select name='DAY'>
END
;
for ($day = 1; $day <= 31; $day++)
for ($day = 1; $day <= 31; $day++)
{
print "\t<option ";
if ($day == $cgiparams{'DAY'}) {
@@ -434,7 +434,7 @@ sub processevent
close(LOG);
}
}
@log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
@log = sort { substr($a,11,8) cmp substr($b,11,8) } @log;
}
}