Better logout message
This commit is contained in:
parent
954dca6944
commit
9284a04ec1
@ -50,13 +50,16 @@ class UserController extends Zend_Controller_Action
|
||||
$message = $request->getParam('message');
|
||||
$this->view->assign('message', $message);
|
||||
|
||||
$refresh = 5;
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
));
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', '5; url='.$url);
|
||||
$this->view->assign('refresh', $refresh);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', $refresh.'; url='.$url);
|
||||
$this->render('logout');
|
||||
}
|
||||
|
||||
|
@ -55,27 +55,25 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
//Sinon on reste sur le standard
|
||||
} else {
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
|
||||
//Pas authentifié
|
||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||
|
||||
$auth->clearIdentity();
|
||||
$storage = $auth->getStorage();
|
||||
Zend_Session::namespaceUnset($storage->getNamespace());
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ( !$layout->isEnabled() ) {
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$this->_response->setRedirect('/user/login')->sendResponse();
|
||||
}
|
||||
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('user')
|
||||
->setActionName('logout');
|
||||
|
||||
//Authentifié => on met à jour la session
|
||||
} else {
|
||||
|
||||
$identity = $auth->getIdentity();
|
||||
$identity->time = time() + $identity->timeout;
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
|
||||
if ( !isset($identity->dateContrat) && $layout->isEnabled() )
|
||||
{
|
||||
//Get customer's params
|
||||
@ -132,7 +130,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
$auth->getStorage()->write($identity);
|
||||
|
||||
if ( $identity->profil=="SuperAdministrateur" ) {
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
$view = $layout->getView();
|
||||
$view->admin = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user