[vhffs-dev] [1312] Added patches for awstats 6.7

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


Revision: 1312
Author:   gradator
Date:     2008-12-04 13:32:54 +0100 (Thu, 04 Dec 2008)

Log Message:
-----------
Added patches for awstats 6.7

Added Paths:
-----------
    trunk/vhffs-robots/misc/awstats_6.7_vhffs.patch
    trunk/vhffs-robots/misc/repository.awstats_6.7_vhffs.patch


Added: trunk/vhffs-robots/misc/awstats_6.7_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/awstats_6.7_vhffs.patch	                        (rev 0)
+++ trunk/vhffs-robots/misc/awstats_6.7_vhffs.patch	2008-12-04 12:32:54 UTC (rev 1312)
@@ -0,0 +1,36 @@
+--- awstats.pl_	2008-12-04 13:26:08.000000000 +0100
++++ awstats.pl	2008-12-04 13:26:23.000000000 +0100
+@@ -1141,19 +1141,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"); }
++	error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z\.\-]+$/ );
++       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='';
+@@ -5881,7 +5873,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; }

Added: trunk/vhffs-robots/misc/repository.awstats_6.7_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/repository.awstats_6.7_vhffs.patch	                        (rev 0)
+++ trunk/vhffs-robots/misc/repository.awstats_6.7_vhffs.patch	2008-12-04 12:32:54 UTC (rev 1312)
@@ -0,0 +1,34 @@
+--- awstats.pl_	2008-12-04 13:26:08.000000000 +0100
++++ awstats.pl	2008-12-04 13:30:52.000000000 +0100
+@@ -1141,19 +1141,9 @@
+ 	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"); }
++	error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z]+$/ );
++	my $vhffsconfigdir = '/data/logs/repository/parsed/'.$SiteConfig.'/awstats';
++	@PossibleConfigDir=("$vhffsconfigdir");
+ 
+ 	# Open config file
+ 	$FileConfig=$FileSuffix='';
+@@ -5881,7 +5871,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/