From: Laurent Destailleur Date: Wed, 20 Nov 2013 11:19:46 +0000 (+0100) Subject: Detection of windows 8, 8.1 and IE 11 X-Git-Tag: AWSTATS_7_3~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed37feaf33e2d7cd8b80ff5acbc9a37f63ae8918;p=thirdparty%2FAWStats.git Detection of windows 8, 8.1 and IE 11 --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 89be6a0d..98f3e6bd 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1763,15 +1763,19 @@ sub Read_Config { #CL - Added to open config if full path is passed to awstats if ( !$FileConfig ) { + + my $SiteConfigBis = File::Spec->rel2abs($SiteConfig); + debug("Finally, try to open an absolute path : $SiteConfigBis", 2); - $SiteConfig = File::Spec->rel2abs($SiteConfig); - debug("Finally, try to open an absolute path : $SiteConfig", 2); - - if ( -f $SiteConfig && open( CONFIG, "$SiteConfig" ) ) { - $FileConfig = "$SiteConfig"; + if ( -f $SiteConfigBis && open(CONFIG, "$SiteConfigBis")) { + $FileConfig = "$SiteConfigBis"; $FileSuffix = ''; - if ($Debug){debug("Opened config: $SiteConfig", 2);} - }else{if ($Debug){debug("Unable to open config file: $SiteConfig", 2);}} + if ($Debug){debug("Opened config: $SiteConfigBis", 2);} + $SiteConfig=$SiteConfigBis; + } + else { + if ($Debug){debug("Unable to open config file: $SiteConfigBis", 2);} + } } if ( !$FileConfig ) { @@ -19472,7 +19476,7 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) $TmpBrowser{$UserAgent} = "svn$1"; } - # IE ? (must be at end of test) + # IE < 11 ? (must be at end of test) elsif ($UserAgent =~ /$regvermsie/o && $UserAgent !~ /$regnotie/o ) { @@ -19480,6 +19484,14 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) if ($PageBool) { $_browser_p{"msie$2"}++; } $TmpBrowser{$UserAgent} = "msie$2"; } + + # IE 11 + elsif ($UserAgent eq "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko") + { + $_browser_h{"msie11"}++; + if ($PageBool) { $_browser_p{"msie11"}++; } + $TmpBrowser{$UserAgent} = "msie11"; + } # Netscape 6.x, 7.x ... ? (must be at end of test) elsif ( $UserAgent =~ /$regvernetscape/o ) { diff --git a/wwwroot/icon/os/win8.1.png b/wwwroot/icon/os/win8.1.png new file mode 100644 index 00000000..8001539c Binary files /dev/null and b/wwwroot/icon/os/win8.1.png differ diff --git a/wwwroot/icon/os/win8.png b/wwwroot/icon/os/win8.png new file mode 100644 index 00000000..8001539c Binary files /dev/null and b/wwwroot/icon/os/win8.png differ