proxylog.dat ChangeLog for SWE3
Here are a few edits for the "web proxy" log page of a SmoothWall Express v3.0 Web Administration Console (GUI). These modifications have been tested with Smoothwall Express v3.0 with update 1 and the Advanced Proxy Mod, version 2.1.5 & 2.1.6 by marco.s. These modifications were breifly discussed in the Express 3.0 HomeBrew Customizations forum.
Warning: This modification requires several edits of a file on your system. This guide assumes you are comfortable editing files on your smoothie.
Aternatively, you can also download a copy of my proxylog.dat file; it contains all edits listed below. You should be able to simply drop the file into your smoothie at /httpd/cgi-bin/logs.cgi/ (assuming you have the same version information listed above), and then change the permissions so it accessible from the web gui.
cp /httpd/cgi-bin/logs.cgi/proxylog.dat /httpd/cgi-bin/logs.cgi/proxylog.dat.bak
chmod 755 /http/cgi-bin/logs.cgi/proxylog.dat
Keep in mind that your row numbers may not match up exactly if you have edited your proxylog.dat file previously or if you do not implement all of the customizations.
cp /httpd/cgi-bin/logs.cgi/proxylog.dat /httpd/cgi-bin/logs.cgi/proxylog.dat.bak
joe /httpd/cgi-bin/logs.cgi/proxylog.datproxylog.dat Changes:
=================
== Filter Change ==
=================
(Row 41)
Find:
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|ico|css|js)\$";
Replace with:
$cgiparams{'FILTER'} = "[.](gif|jpeg|jpg|png|ico|css|js)\$\\??";
======================
== Reverse timestamps ==
======================
== Display ==
(Row 324)
Find:
foreach $_ (@slice)
{
Replace with:
while (scalar (@slice))
{
$_ = pop(@slice);
== Export ==
(Row 138)
Find:
foreach $_ (@log) {
print "$_\n"; }
Replace with:
while (scalar (@log)) {
$_ = pop(@log);
print "$_\n"; }
=================================
== Fix background color striping ==
=================================
(Row 327)
Find:
if ($lines % 2) {
print "<TR BGCOLOR='$table1colour'>\n"; }
else {
print "<TR BGCOLOR='$table2colour'>\n"; }
Replace with:
if ($lines % 2) {
print "<TR class='light'>\n"; }
else {
print "<TR class='dark'>\n"; }
=================
== Add user name ==
=================
(Row 100)
Find:
my ($ts,$x,$ip,$cache,$y,$type,$url) = split;
Replace with:
my ($ts,$x,$ip,$cache,$y,$type,$url,$fe) = split;
(Row 110)
Find:
$log[$lines] = "$hour:$minute:$second $ip $url";
Replace with:
$log[$lines] = "$hour:$minute:$second $ip $fe $url";
(Row 316)
Find:
<th style='width: 10%;'>$tr{'time'}</th>
<th style='width: 15%;'>$tr{'source ip'}</th>
<th style='width: 75%;'>$tr{'website'}</th>
Replace with:
<th style='width: 10%;'>$tr{'time'}</th>
<th style='width: 15%;'>$tr{'source ip'}</th>
<th style='width: 13%;'>$tr{'advproxy NCSA username'}</th>
<th style='width: 62%;'>$tr{'website'}</th>
(Row 332)
Find:
my ($time,$ip,$url) = split;
$url =~ /(^.{0,80})/;
my $part = $1;
unless (length($part) < 80) { $part = "${part}..."; }
Replace with:
my ($time,$ip,$fi,$url) = split;
if (($fi eq ' ') && (!($fe eq ' '))) { $fi=$fe; }
$url =~ /(^.{0,60})/;
my $part = $1;
unless (length($part) < 60) { $part = "${part}..."; }
(Row 338)
Find:
<TD ALIGN='CENTER'>$time</TD>
<TD ALIGN='CENTER'>$ip</TD>
<TD ALIGN='LEFT'><A HREF='$url' TITLE='$url' TARGET='_new'>$part</A></TD>
Replace with:
<TD ALIGN='CENTER' STYLE='padding-right: 7px;'>$time</TD>
<TD ALIGN='CENTER' STYLE='padding-right: 7px;'>$ip</TD>
<TD ALIGN='CENTER'>$fi</TD>
<TD ALIGN='LEFT'><A HREF='$url' TITLE='$url' TARGET='_new'>$part</A></TD>
=====================
== Add DENIED filter ==
=====================
(Row 196)
Find:
<TR>
<TD CLASS='base'>$tr{'ignore filterc'}</TD>
<TD COLSPAN='3'><INPUT TYPE='text' NAME='FILTER' VALUE='$cgiparams{'FILTER'}' SIZE='40'></TD>
<TD CLASS='base'>$tr{'enable ignore filterc'}</TD>
<TD><INPUT TYPE='checkbox' NAME='ENABLE_FILTER' VALUE='on' $checked{'ENABLE_FILTER'}{'on'}></TD>
</TR>
Replace with:
<TR>
<TD CLASS='base'>$tr{'ignore filterc'}</TD>
<TD COLSPAN='3'><INPUT TYPE='text' NAME='FILTER' VALUE='$cgiparams{'FILTER'}' SIZE='40'></TD>
<TD CLASS='base'>$tr{'enable ignore filterc'}</TD>
<TD><INPUT TYPE='checkbox' NAME='ENABLE_FILTER' VALUE='on' $checked{'ENABLE_FILTER'}{'on'}></TD>
</TR>
<TR>
<TD COLSPAN='4'></TD>
<TD CLASS='base'>Show only DENIED:</TD>
<TD><INPUT TYPE='checkbox' NAME='ONLY_DENIED' VALUE='on' $checked{'ONLY_DENIED'}{'on'}></TD>
</TR>
(Row 32)
Find:
$cgiparams{'ENABLE_FILTER'} = 'off';
Replace with:
cgiparams{'ENABLE_FILTER'} = 'off';
$cgiparams{'ONLY_DENIED'} = 'off';
(Row 39)
Find:
$cgiparams{'ENABLE_FILTER'} = 'on';
Replace with:
$cgiparams{'ENABLE_FILTER'} = 'on';
$cgiparams{'ONLY_DENIED'} = 'off';
(Row 47)
Find:
$save{'ENABLE_FILTER'} = $cgiparams{'ENABLE_FILTER'};
Replace with:
$save{'ENABLE_FILTER'} = $cgiparams{'ENABLE_FILTER'};
$save{'ONLY_DENIED'} = $cgiparams{'ONLY_DENIED'};
(Row 125)
Find:
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
print "Ignore filter: $cgiparams{'FILTER'}\r\n"; }
Replace with:
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
print "Ignore filter: $cgiparams{'FILTER'}\r\n"; }
if ($cgiparams{'ONLY_DENIED'} eq 'on') {
print "Show only DENIED hits.\r\n"; }
(Row 139)
Find:
$checked{'ENABLE_FILTER'}{'off'} = '';
$checked{'ENABLE_FILTER'}{'on'} = '';
$checked{'ENABLE_FILTER'}{$cgiparams{'ENABLE_FILTER'}} = 'CHECKED';
Replace with:
$checked{'ENABLE_FILTER'}{'off'} = '';
$checked{'ENABLE_FILTER'}{'on'} = '';
$checked{'ENABLE_FILTER'}{$cgiparams{'ENABLE_FILTER'}} = 'CHECKED';
$checked{'ONLY_DENIED'}{'off'} = '';
$checked{'ONLY_DENIED'}{'on'} = '';
$checked{'ONLY_DENIED'}{$cgiparams{'ONLY_DENIED'}} = 'CHECKED';
(Row 78)
Find:
my $filter;
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
$filter = $cgiparams{'FILTER'}; }
else {
$filter = ''; }
Replace with:
my $filter;
if ($cgiparams{'ENABLE_FILTER'} eq 'on') {
$filter = $cgiparams{'FILTER'}; }
else {
$filter = ''; }
my $filter2;
if ($cgiparams{'ONLY_DENIED'} eq 'on') {
$filter2 = 'DENIED'; }
else {
$filter2 = '.*'; }
(Row 113)
Find:
((($ip eq $sourceip) || $sourceall)))
Replace with:
($cache =~ /$filter2/) && ((($ip eq $sourceip) || $sourceall)))

