From 9e4123cc2a54fffb671ec67577b46046a16d899c Mon Sep 17 00:00:00 2001 From: thomasb Date: Wed, 3 Sep 2008 16:03:19 +0000 Subject: Auto-detect client language and timezone if desired by config/prefs git-svn-id: https://svn.roundcube.net/trunk@1722 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_shared.inc | 56 -------------------------- 1 file changed, 56 deletions(-) (limited to 'roundcubemail/program/include/rcube_shared.inc') diff --git a/roundcubemail/program/include/rcube_shared.inc b/roundcubemail/program/include/rcube_shared.inc index d82b1fef0..0dd661ec5 100644 --- a/roundcubemail/program/include/rcube_shared.inc +++ b/roundcubemail/program/include/rcube_shared.inc @@ -27,62 +27,6 @@ */ -/** - * Provide details about the client's browser - * - * @return array Key-value pairs of browser properties - */ -function rcube_browser() -{ - $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; - - $bw['ver'] = 0; - $bw['win'] = stristr($HTTP_USER_AGENT, 'win'); - $bw['mac'] = stristr($HTTP_USER_AGENT, 'mac'); - $bw['linux'] = stristr($HTTP_USER_AGENT, 'linux'); - $bw['unix'] = stristr($HTTP_USER_AGENT, 'unix'); - - $bw['ns4'] = stristr($HTTP_USER_AGENT, 'mozilla/4') && !stristr($HTTP_USER_AGENT, 'msie'); - $bw['ns'] = ($bw['ns4'] || stristr($HTTP_USER_AGENT, 'netscape')); - $bw['ie'] = stristr($HTTP_USER_AGENT, 'msie'); - $bw['mz'] = stristr($HTTP_USER_AGENT, 'mozilla/5'); - $bw['opera'] = stristr($HTTP_USER_AGENT, 'opera'); - $bw['safari'] = stristr($HTTP_USER_AGENT, 'safari'); - - if($bw['ns']) - { - $test = eregi("mozilla\/([0-9\.]+)", $HTTP_USER_AGENT, $regs); - $bw['ver'] = $test ? (float)$regs[1] : 0; - } - if($bw['mz']) - { - $test = ereg("rv:([0-9\.]+)", $HTTP_USER_AGENT, $regs); - $bw['ver'] = $test ? (float)$regs[1] : 0; - } - if($bw['ie']) - { - $test = eregi("msie ([0-9\.]+)", $HTTP_USER_AGENT, $regs); - $bw['ver'] = $test ? (float)$regs[1] : 0; - } - if($bw['opera']) - { - $test = eregi("opera ([0-9\.]+)", $HTTP_USER_AGENT, $regs); - $bw['ver'] = $test ? (float)$regs[1] : 0; - } - - if(eregi(" ([a-z]{2})-([a-z]{2})", $HTTP_USER_AGENT, $regs)) - $bw['lang'] = $regs[1]; - else - $bw['lang'] = 'en'; - - $bw['dom'] = ($bw['mz'] || $bw['safari'] || ($bw['ie'] && $bw['ver']>=5) || ($bw['opera'] && $bw['ver']>=7)); - $bw['pngalpha'] = $bw['mz'] || $bw['safari'] || ($bw['ie'] && $bw['ver']>=5.5) || - ($bw['ie'] && $bw['ver']>=5 && $bw['mac']) || ($bw['opera'] && $bw['ver']>=7) ? TRUE : FALSE; - - return $bw; -} - - /** * Send HTTP headers to prevent caching this page */ -- cgit v1.2.3