mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00: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
2 changed files with 19 additions and 3 deletions
|
@ -23,7 +23,7 @@ function iframe_updated()
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</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">
|
<form action="{U_COLLECT_STATS}" method="post" target="questionaire_result" id="questionnaire-form">
|
||||||
|
|
||||||
|
|
|
@ -447,6 +447,22 @@ class phpbb_questionnaire_phpbb_data_provider
|
||||||
$result['dbms'] = $dbms;
|
$result['dbms'] = $dbms;
|
||||||
$result['acm_type'] = $acm_type;
|
$result['acm_type'] = $acm_type;
|
||||||
$result['load_extensions'] = $load_extensions;
|
$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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue