/** */ public function set($key, $val, array $opts = array()) { global $session; if (!parent::set($key, $val, $opts)) { return false; } $data_keys = $this->_getKeys(); if (empty($data_keys)) { $logout = new Horde_Registry_Logout(); $logout->add($this); } $data_keys[] = $key; $session->set('horde', self::SESS_KEY, $data_keys); return true; }
/** * Clears any authentication tokens in the current session. * * @param boolean $destroy Destroy the session? */ public function clearAuth($destroy = true) { global $session; /* Do application logout tasks. */ /* @todo: Replace with exclusively registered logout tasks. */ foreach ($this->getAuthApps() as $app) { try { $this->callAppMethod($app, 'logout'); } catch (Horde_Exception $e) { } } /* Do registered logout tasks. */ $logout = new Horde_Registry_Logout(); $logout->run(); // @suspicious shouldn't this be 'auth/' $session->remove('horde', 'auth'); $session->remove('horde', 'auth_app/'); $this->_cache['auth'] = null; $this->_cache['existing'] = $this->_cache['isauth'] = array(); if ($destroy) { $session->destroy(); } }