From: eldy <> Date: Mon, 15 Sep 2003 14:06:01 +0000 (+0000) Subject: Selection of virtualhost records in a log is no more case sensitive on SiteDomain... X-Git-Tag: AWSTATS_5_8_BETA~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=feda1705f06b2a4100674afddf6ff29f78f605d7;p=thirdparty%2FAWStats.git Selection of virtualhost records in a log is no more case sensitive on SiteDomain nor HostAliases. --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 494389a8..2453f6c1 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -95,8 +95,8 @@ LogType=W # %email EMail sender (for mail log) # %email_r EMail receiver (for mail log) # %virtualname Web sever virtual hostname. Use this tag when same log -# file contains data of several virtual web servers. The -# SiteDomain will be used to filter the one you want. +# contains data of several virtual web servers. AWStats +# will discard records not in SiteDomain nor HostAliases # If your log format has some fields not included in this list, use # %other Means another field not used # diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 4637ddd9..c2011253 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1329,8 +1329,8 @@ sub Read_Ref_Data { push @INC, "$dir"; $DirAddedInINC{"$dir"}=1; } - #my $loadret=require "$FilePath{$file}"; - my $loadret=(require "$FilePath{$file}"||require "${file}"); + my $loadret=require "$file"; + #my $loadret=(require "$FilePath{$file}"||require "${file}"); } } } @@ -1799,7 +1799,8 @@ sub Read_Plugins { $DirAddedInINC{"$dir"}=1; } #my $loadret=require "$pluginpath"; - my $loadret=(require "$pluginpath"||require "${pluginfile}.pm"); + my $loadret=require "${pluginfile}.pm"; + #my $loadret=(require "$pluginpath"||require "${pluginfile}.pm"); if (! $loadret || $loadret =~ /^error/i) { # Load failed, we stop here @@ -4094,9 +4095,9 @@ sub AltTitle { } #-------------------------------------------------------------------- -# Function: Tell if an email is an local or external email +# Function: Tell if an email is a local or external email # Parameters: email -# Input: $SiteDomain $HostAliases +# Input: $SiteDomain(exact string) $HostAliases(quoted regex string) # Output: None # Return: -1, 0 or 1 #-------------------------------------------------------------------- @@ -4104,7 +4105,7 @@ sub IsLocalEMail { my $email=shift||'unknown'; if ($email !~ /\@(.*)$/) { return 0; } my $domain=$1; - if ($domain eq $SiteDomain) { return 1; } + if ($domain =~ /^$SiteDomain$/i) { return 1; } foreach my $match (@HostAliases) { if ($domain =~ /$match/i) { return 1; } } return -1; } @@ -4467,7 +4468,7 @@ sub ShowURLInfo { print "$nompage"; } elsif ($newkey =~ /^\//) { # URL seems to be an url extracted from a web or wap server log file - $newkey =~ s/^\/$SiteDomain//; + $newkey =~ s/^\/$SiteDomain//i; # Define urlprot my $urlprot='http'; if ($UseHTTPSLinkForUrl && $newkey =~ /^$UseHTTPSLinkForUrl/) { $urlprot='https'; } @@ -5540,10 +5541,10 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat # Check virtual host name #---------------------------------------------------------------------- - if ($pos_vh>=0 && $field[$pos_vh] ne $SiteDomain) { + if ($pos_vh>=0 && $field[$pos_vh] !~ /^$SiteDomain$/i) { my $skip=1; foreach my $key (@HostAliases) { - if ($field[$pos_vh] =~ m/^$key$/) { $skip=0; next; } + if ($field[$pos_vh] =~ m/$key$/i) { $skip=0; next; } } if ($skip) { $NbOfLinesDropped++;