diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-09-10 13:30:47 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-09-10 13:30:47 +0000 |
commit | 94373fd1f85f79dae1674313c27ebb1735991c9a (patch) | |
tree | 6af693643e639e292e0e6a50a49370245d9bdd54 /phpBB/includes/questionnaire/questionnaire.php | |
parent | a5ec35e185126f5366a5749ad4f57325202b10f5 (diff) | |
download | forums-94373fd1f85f79dae1674313c27ebb1735991c9a.tar forums-94373fd1f85f79dae1674313c27ebb1735991c9a.tar.gz forums-94373fd1f85f79dae1674313c27ebb1735991c9a.tar.bz2 forums-94373fd1f85f79dae1674313c27ebb1735991c9a.tar.xz forums-94373fd1f85f79dae1674313c27ebb1735991c9a.zip |
also collect admins user agent vendor and version (send_statistics)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10131 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/questionnaire/questionnaire.php')
-rw-r--r-- | phpBB/includes/questionnaire/questionnaire.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index 16bd79742d..1d015576a7 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -179,7 +179,7 @@ class phpbb_questionnaire_system_data_provider // - 10.0.0.0/8 // - 172.16.0.0/12 // - 192.168.0.0/16 - 'ip' => $ip_address_ary[0] . '.' . $ip_address_ary[1] . '.XXX.YYY', + 'ip' => $ip_address_ary[0] . '.' . $ip_address_ary[1] . '.XXX.YYY', ); } } @@ -233,7 +233,7 @@ class phpbb_questionnaire_phpbb_data_provider { global $phpbb_root_path, $phpEx; include("{$phpbb_root_path}config.$phpEx"); - + // Only send certain config vars $config_vars = array( 'active_sessions' => true, @@ -447,6 +447,22 @@ class phpbb_questionnaire_phpbb_data_provider $result['dbms'] = $dbms; $result['acm_type'] = $acm_type; $result['load_extensions'] = $load_extensions; + $result['user_agent'] = 'Unknown'; + + // Try to get user agent vendor and version + $match = array(); + $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : ''; + $agents = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol'); + + // We check here 1 by 1 because some strings occur after others (for example Mozilla [...] Firefox/) + foreach ($agents as $agent) + { + if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match)) + { + $result['user_agent'] = $match[1] . ' ' . $match[2]; + break; + } + } return $result; } |