Message de déconnexion dès le départ

This commit is contained in:
Michael RICOIS 2012-09-03 15:11:41 +00:00
parent 7046c7a453
commit ca6488677b

View File

@ -58,16 +58,28 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$layout = Zend_Layout::getMVCInstance();
//Pas authentifié
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
$auth->clearIdentity();
$storage = $auth->getStorage();
Zend_Session::namespaceUnset($storage->getNamespace());
if ( !$auth->hasIdentity() ) {
$request->setModuleName('default')
->setControllerName('user')
->setActionName('login');
} elseif (time() > $auth->getIdentity()->time ) {
$auth->clearIdentity();
$storage = $auth->getStorage();
Zend_Session::namespaceUnset($storage->getNamespace());
if ( $request->getControllerName()=='index' && $request->getActionName()=='index' ) {
$request->setModuleName('default')
->setControllerName('user')
->setActionName('login');
} else {
$request->setModuleName('default')
->setControllerName('user')
->setActionName('logout');
}
$request->setModuleName('default')
->setControllerName('user')
->setActionName('logout');
//Authentifié => on met à jour la session
} else {