mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
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
This commit is contained in:
parent
a5ec35e185
commit
94373fd1f8
@ -23,7 +23,7 @@ function iframe_updated()
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<iframe onload="iframe_updated();" name="questionaire_result" style="display:none;"></iframe>
|
||||
<iframe onload="iframe_updated();" name="questionaire_result" style="display: none;"></iframe>
|
||||
|
||||
<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form">
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user