]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix not working country detection with DNSLookup=1 and no geoip plugin.
authoreldy <>
Sat, 2 Aug 2003 22:48:17 +0000 (22:48 +0000)
committereldy <>
Sat, 2 Aug 2003 22:48:17 +0000 (22:48 +0000)
wwwroot/cgi-bin/awstats.pl

index 72128d3e74aae052b0ee9f96be6ecdc0785da27b..97a313ad01e58472ec1cfce8138187938fdc53e1 100644 (file)
@@ -5626,6 +5626,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
 
                # Analyze: Country (Top-level domain)
                #------------------------------------
+               if ($Debug) { debug("  Search country (Host=$Host HostResolved=$HostResolved ip=$ip)",4); }
                my $Domain='ip';
                # Set $HostResolved to host and resolve domain
                if ($HostResolved eq '*') {
@@ -5642,6 +5643,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                        if ($ip) {
                                if ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoipfree'}) { $Domain=GetCountryCodeByAddr_geoipfree($Host); }
                                elsif ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoip'}) { $Domain=GetCountryCodeByAddr_geoip($Host); }
+                               elsif ($HostResolved =~ /\.(\w+)$/) { $Domain=$1; }
                        }
                        else {
                                if ($PluginsLoaded{'GetCountryCodeByName'}{'geoipfree'}) { $Domain=GetCountryCodeByName_geoipfree($HostResolved); }