From: Jan Schneider Date: Mon, 31 May 2010 15:24:03 +0000 (+0200) Subject: Fix logging out after session timeout. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3b108b7e2420268b9ca886f927a51d504ecfd7ee;p=horde.git Fix logging out after session timeout. --- diff --git a/horde/services/ajax.php b/horde/services/ajax.php index e1531c278..eb9756c6f 100644 --- a/horde/services/ajax.php +++ b/horde/services/ajax.php @@ -34,16 +34,17 @@ if (empty($action)) { try { Horde_Registry::appInit($app, array('authentication' => 'throw')); } catch (Horde_Exception $e) { - /* Handle session timeouts when they come from an AJAX request. */ - if (($e->getCode() == Horde_Registry::AUTH_FAILURE) && - ($action != 'logOut')) { - $ajax = Horde_Ajax::getInstance($app); - $GLOBALS['notification']->push(str_replace('&', '&', Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION))), 'horde.ajaxtimeout', array('content.raw')); - Horde::sendHTTPResponse(Horde::prepareResponse(null, $ajax->notify), $ajax->responseType()); - exit; - } + if ($action != 'logOut') { + /* Handle session timeouts when they come from an AJAX request. */ + if ($e->getCode() == Horde_Registry::AUTH_FAILURE) { + $ajax = Horde_Ajax::getInstance($app); + $GLOBALS['notification']->push(str_replace('&', '&', Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION))), 'horde.ajaxtimeout', array('content.raw')); + Horde::sendHTTPResponse(Horde::prepareResponse(null, $ajax->notify), $ajax->responseType()); + exit; + } - Horde_Auth::authenticateFailure($app, $e); + Horde_Auth::authenticateFailure($app, $e); + } } // Open an output buffer to ensure that we catch errors that might break JSON