Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Faiyaz Alam

    (@faiyazalam)

    @nekokun

    please replace the function in the following file:
    \wp\wp-content\plugins\user-login-history-ulh_with_hook\admin\class-user-login-history-user-tracker.php

     private function get_operating_system() {
    
            $user_agent = $_SERVER['HTTP_USER_AGENT'];
    
              ini_set('error_log', WP_CONTENT_DIR . '/debug-user-login-history.log');
              error_log("HTTP_USER_AGENT:" . $_SERVER['HTTP_USER_AGENT']);
            
            
            $os_platform = "Unknown";
    
            $os_array = array(
                '/windows nt 10/i' => 'Windows 10',
                '/windows nt 6.3/i' => 'Windows 8.1',
                '/windows nt 6.2/i' => 'Windows 8',
                '/windows nt 6.1/i' => 'Windows 7',
                '/windows nt 6.0/i' => 'Windows Vista',
                '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
                '/windows nt 5.1/i' => 'Windows XP',
                '/windows xp/i' => 'Windows XP',
                '/windows nt 5.0/i' => 'Windows 2000',
                '/windows me/i' => 'Windows ME',
                '/win98/i' => 'Windows 98',
                '/win95/i' => 'Windows 95',
                '/win16/i' => 'Windows 3.11',
                '/macintosh|mac os x/i' => 'Mac OS X',
                '/mac_powerpc/i' => 'Mac OS 9',
                '/linux/i' => 'Linux',
                '/ubuntu/i' => 'Ubuntu',
                '/iphone/i' => 'iPhone',
                '/ipod/i' => 'iPod',
                '/ipad/i' => 'iPad',
                '/android/i' => 'Android',
                '/blackberry/i' => 'BlackBerry',
                '/webos/i' => 'Mobile',
                '/cros/i' => 'Chrome'
            );
    
            foreach ($os_array as $regex => $value) {
    
                if (preg_match($regex, $user_agent)) {
                    $os_platform = $value;
                }
            }
    
            return $os_platform;
        }

    Now test it and send me the content of the file:
    \wp\wp-content\debug-user-login-history.log

    • This reply was modified 6 years, 7 months ago by Faiyaz Alam.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @faiyazalam, if your reply gets caught in the spam filter, please do not try to repost many more times. Just be patient and the moderators will clean things up in the normal course of things.

    Plugin Author Faiyaz Alam

    (@faiyazalam)

    @sterndata

    thanks.

    Plugin Contributor Leonardo Gandini

    (@nekokun)

    I tested and it works fine, I tweaked to show ‘Chrome OS’ 🙂

    Many thanks @faiyazalam

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Chrome OS’ is closed to new replies.