]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Detection of windows 8, 8.1 and IE 11
authorLaurent Destailleur <eldy@destailleur.fr>
Wed, 20 Nov 2013 11:19:46 +0000 (12:19 +0100)
committerLaurent Destailleur <eldy@destailleur.fr>
Wed, 20 Nov 2013 11:19:46 +0000 (12:19 +0100)
wwwroot/cgi-bin/awstats.pl
wwwroot/icon/os/win8.1.png [new file with mode: 0644]
wwwroot/icon/os/win8.png [new file with mode: 0644]

index 89be6a0dd1121fb7d699c82602a3c903f9c2187b..98f3e6bdbdae7ea849debcbe5924baa05486ec2b 100644 (file)
@@ -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 (file)
index 0000000..8001539
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 (file)
index 0000000..8001539
Binary files /dev/null and b/wwwroot/icon/os/win8.png differ