[vhffs-dev] [550] Add awstats 6.6 patch

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 550
Author:   misric
Date:     2007-04-09 17:46:57 +0000 (Mon, 09 Apr 2007)

Log Message:
-----------
Add awstats 6.6 patch

Added Paths:
-----------
    branches/vhffs_4.1/vhffs-robots/misc/awstats_6.6_vhffs.patch


Added: branches/vhffs_4.1/vhffs-robots/misc/awstats_6.6_vhffs.patch
===================================================================
--- branches/vhffs_4.1/vhffs-robots/misc/awstats_6.6_vhffs.patch	2007-04-09 01:11:12 UTC (rev 549)
+++ branches/vhffs_4.1/vhffs-robots/misc/awstats_6.6_vhffs.patch	2007-04-09 17:46:57 UTC (rev 550)
@@ -0,0 +1,36 @@
+--- /usr/lib/cgi-bin/awstats.pl	2007-04-09 18:52:46.000000000 +0200
++++ awstats.pl	2007-04-09 18:50:35.000000000 +0200
+@@ -1131,19 +1131,11 @@
+ 	my $configdir=shift;
+ 	my @PossibleConfigDir=();
+ 
+-	if ($configdir)
+-	{
+-		# If from CGI, overwriting of configdir is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+-		if ($ENV{'GATEWAY_INTERFACE'} && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+-		{
+-			error("Sorry, to allow overwriting of configdir parameter from an AWStats CGI usage, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1");
+-		}
+-		else
+-		{
+-			@PossibleConfigDir=("$configdir");
+-		}
+-	}
+-	else { @PossibleConfigDir=("$DIR","/etc/awstats","/usr/local/etc/awstats","/etc","/etc/opt/awstats"); }
++       use Digest::MD5 qw(md5 md5_hex md5_base64);
++       my $vhffssitehash = md5_hex( $SiteConfig );
++       my $vhffsconfigdir = '/data/web/'.substr( $vhffssitehash, 0, 2 ).'/'.substr( $vhffssitehash, 2, 2 ).'/'.substr( $vhffssitehash, 4, 2 ).'/'.$SiteConfig.'/awstats';
++       @PossibleConfigDir=("$vhffsconfigdir");
++
+ 
+ 	# Open config file
+ 	$FileConfig=$FileSuffix='';
+@@ -5858,7 +5850,7 @@
+ else { @DOWIndex = (0,1,2,3,4,5,6); }
+ 
+ # Should we link to ourselves or to a wrapper script
+-$AWScript=($WrapperScript?"$WrapperScript":"$DirCgi$PROG.$Extension");
++$AWScript=($WrapperScript?"$WrapperScript":"/$DirCgi$PROG.$Extension");
+ 
+ # Print html header (Need HTMLOutput,Expires,Lang,StyleSheet,HTMLHeadSectionExpires defined by Read_Config, PageCode defined by Read_Language_Data)
+ if (! $HeaderHTMLSent) { &html_head; }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/