/**
* 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();
}
}