Revision: 7770
          http://sourceforge.net/p/ipcop/svn/7770
Author:   owes
Date:     2015-01-06 09:08:19 +0000 (Tue, 06 Jan 2015)
Log Message:
-----------
Add option to remove authenticated username from the proxy log. Sometimes 
useful/required in company environment. Default is to log username when 
available, i.e. no change to previous behaviour.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/proxy.cgi
    ipcop/trunk/src/scripts/makesquidconf.pl
    ipcop/trunk/updates/2.1.8/ROOTFILES.i486-2.1.8

Modified: ipcop/trunk/html/cgi-bin/proxy.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/proxy.cgi  2015-01-04 10:07:22 UTC (rev 7769)
+++ ipcop/trunk/html/cgi-bin/proxy.cgi  2015-01-06 09:08:19 UTC (rev 7770)
@@ -16,7 +16,7 @@
 # along with IPCop.  If not, see <http://www.gnu.org/licenses/>.
 #
 # (c) 2004-2009 marco.s - http://www.advproxy.net
-# (c) 2009-2014 The IPCop Team
+# (c) 2009-2015 The IPCop Team
 #
 # $Id$
 #
@@ -271,6 +271,8 @@
 $proxysettings{'LOGGING'} = 'off';
 $proxysettings{'LOGQUERY'} = 'off';
 $proxysettings{'LOGUSERAGENT'} = 'off';
+# Defaults to on, needs different handling
+#$proxysettings{'LOGUSERNAME'} = 'on';
 $proxysettings{'CACHE_MEM'} = '4';
 $proxysettings{'CACHE_SIZE'} = '50';
 $proxysettings{'MAX_SIZE'} = '4096';
@@ -716,6 +718,8 @@
             $proxysettings{'AUTH_ALWAYS_REQUIRED'} = 'off' unless exists 
$proxysettings{'AUTH_ALWAYS_REQUIRED'};
             $proxysettings{'NTLM_ENABLE_INT_AUTH'} = 'off' unless exists 
$proxysettings{'NTLM_ENABLE_INT_AUTH'};
 
+            $proxysettings{'LOGUSERNAME'} = 'off' unless exists 
$proxysettings{'LOGUSERNAME'};
+
             &General::writehash("/var/ipcop/proxy/settings", \%proxysettings);
 
             system('/usr/local/bin/restartsquid --config');
@@ -797,6 +801,10 @@
 $checked{'LOGUSERAGENT'}{'off'} = '';
 $checked{'LOGUSERAGENT'}{'on'} = '';
 $checked{'LOGUSERAGENT'}{$proxysettings{'LOGUSERAGENT'}} = "checked='checked'";
+$proxysettings{'LOGUSERNAME'} = 'on' unless exists 
$proxysettings{'LOGUSERNAME'};
+$checked{'LOGUSERNAME'}{'off'} = '';
+$checked{'LOGUSERNAME'}{'on'} = '';
+$checked{'LOGUSERNAME'}{$proxysettings{'LOGUSERNAME'}} = "checked='checked'";
 
 $selected{'ERR_DESIGN'}{$proxysettings{'ERR_DESIGN'}} = "selected='selected'";
 
@@ -1084,18 +1092,21 @@
 </tr>
 <tr>
     <td colspan='4' class='base'><b>$Lang::tr{'log settings'}</b></td>
-</tr>
-<tr>
+</tr><tr>
     <td class='base'>$Lang::tr{'log enabled'}:</td>
     <td><input type='checkbox' name='LOGGING' $checked{'LOGGING'}{'on'} /></td>
     <td class='base'>$Lang::tr{'log query'}:</td>
     <td><input type='checkbox' name='LOGQUERY' $checked{'LOGQUERY'}{'on'} 
/></td>
-</tr>
-<tr>
+</tr><tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td class='base'>$Lang::tr{'log useragent'}:</td>
     <td><input type='checkbox' name='LOGUSERAGENT' 
$checked{'LOGUSERAGENT'}{'on'} /></td>
+</tr><tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+    <td class='base'>$Lang::tr{'log username'}:</td>
+    <td><input type='checkbox' name='LOGUSERNAME' 
$checked{'LOGUSERNAME'}{'on'} /></td>
 </tr>
 </table>
 

Modified: ipcop/trunk/src/scripts/makesquidconf.pl
===================================================================
--- ipcop/trunk/src/scripts/makesquidconf.pl    2015-01-04 10:07:22 UTC (rev 
7769)
+++ ipcop/trunk/src/scripts/makesquidconf.pl    2015-01-06 09:08:19 UTC (rev 
7770)
@@ -371,8 +371,7 @@
         print FILE "cache_dir aufs /var/log/cache $proxysettings{'CACHE_SIZE'} 
$proxysettings{'L1_DIRS'} 256\n\n";
     }
 
-    if (($proxysettings{'ERR_DESIGN'} eq 'ipcop') && 
($proxysettings{'VISIBLE_HOSTNAME'} eq ''))
-    {
+    if (($proxysettings{'ERR_DESIGN'} eq 'ipcop') && 
($proxysettings{'VISIBLE_HOSTNAME'} eq '')) {
         print FILE "error_directory 
$errordir.ipcop/$proxysettings{'ERR_LANGUAGE'}\n\n";
     } else {
         print FILE "error_directory 
$errordir/$proxysettings{'ERR_LANGUAGE'}\n\n";
@@ -380,8 +379,7 @@
 
     if ($proxysettings{'OFFLINE_MODE'} eq 'on') {  print FILE "offline_mode 
on\n\n"; }
 
-    if ((!($proxysettings{'MEM_POLICY'} eq 'LRU')) || 
(!($proxysettings{'CACHE_POLICY'} eq 'LRU')))
-    {
+    if ((!($proxysettings{'MEM_POLICY'} eq 'LRU')) || 
(!($proxysettings{'CACHE_POLICY'} eq 'LRU'))) {
         if (!($proxysettings{'MEM_POLICY'} eq 'LRU'))
         {
             print FILE "memory_replacement_policy 
$proxysettings{'MEM_POLICY'}\n";
@@ -393,14 +391,17 @@
         print FILE "\n";
     }
 
-    if ($proxysettings{'LOGGING'} eq 'on')
-    {
+    if ($proxysettings{'LOGGING'} eq 'on') {
+        my $loganonym = '';
+        $loganonym = 'anonym' if ((exists($proxysettings{'LOGUSERNAME'})) && 
($proxysettings{'LOGUSERNAME'} eq 'off'));
+
         print FILE <<END
-access_log stdio:/var/log/squid/access.log
+logformat anonym %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru ANON %Sh/%<a %mt
+access_log stdio:/var/log/squid/access.log $loganonym
 cache_log /var/log/squid/cache.log
 cache_store_log none
 END
-    ;
+        ;
         if ($proxysettings{'LOGUSERAGENT'} eq 'on') { print FILE "access_log 
stdio:\/var\/log\/squid\/user_agent.log useragent\n"; }
         if ($proxysettings{'LOGQUERY'} eq 'on') { print FILE 
"\nstrip_query_terms off\n"; }
     } else {

Modified: ipcop/trunk/updates/2.1.8/ROOTFILES.i486-2.1.8
===================================================================
--- ipcop/trunk/updates/2.1.8/ROOTFILES.i486-2.1.8      2015-01-04 10:07:22 UTC 
(rev 7769)
+++ ipcop/trunk/updates/2.1.8/ROOTFILES.i486-2.1.8      2015-01-06 09:08:19 UTC 
(rev 7770)
@@ -1,4 +1,5 @@
 ## please place IPCop files first, then packages sorted by alphabetical order
+/home/httpd/cgi-bin/proxy.cgi
 /home/httpd/cgi-bin/sysinfo.cgi
 /home/httpd/cgi-bin/time.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.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to