static protected $_instances = array();
/**
+ * Cached Horde_Browser instance
+ *
+ * @var Horde_Browser
+ */
+ static protected $_browser = null;
+
+ /**
* The logout reason information.
*
* @var array
}
if (!empty($GLOBALS['conf']['auth']['checkbrowser'])) {
- if ($_SESSION['horde_auth']['browser'] != self::_browser()->getAgentString()) {
+ if ($_SESSION['horde_auth']['browser'] != self::_getBrowser()->getAgentString()) {
self::setAuthError(self::REASON_BROWSER);
return false;
}
$_SESSION['horde_auth'] = array(
'app' => $app_array,
- 'browser' => self::_browser()->getAgentString(),
+ 'browser' => self::_getBrowser()->getAgentString(),
'change' => !empty($options['change']),
'credentials' => Horde_Secret::write(Horde_Secret::getKey('auth'), serialize($credentials)),
'driver' => $GLOBALS['conf']['auth']['driver'],
*
* @return Horde_Browser A Horde_Browser instance.
*/
- static private function _browser()
+ static protected function _getBrowser()
{
- static $browser;
- if (!isset($browser)) {
- $browser = new Horde_Browser();
+ if (!self::$_browser) {
+ self::$_browser = new Horde_Browser();
}
- return $browser;
+ return self::$_browser;
}
/**