Message de déconnexion dès le départ
This commit is contained in:
parent
7046c7a453
commit
ca6488677b
@ -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 {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user