Better logout message
This commit is contained in:
parent
92e64573a8
commit
6c19d02f54
@ -369,22 +369,23 @@ class UserController extends Zend_Controller_Action
|
|||||||
*/
|
*/
|
||||||
public function logoutAction()
|
public function logoutAction()
|
||||||
{
|
{
|
||||||
$auth = Zend_Auth::getInstance();
|
Zend_Auth::getInstance()->clearIdentity();
|
||||||
$auth->clearIdentity();
|
|
||||||
|
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$message = $request->getParam('message');
|
$message = $request->getParam('message');
|
||||||
$this->view->assign('message', $message);
|
$this->view->assign('message', $message);
|
||||||
|
|
||||||
|
$refresh = 5;
|
||||||
|
|
||||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||||
'controller' => 'user',
|
'controller' => 'user',
|
||||||
'action' => 'login',
|
'action' => 'login',
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->view->assign('url', $url);
|
$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');
|
$this->render('logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,15 +59,14 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
|||||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||||
|
|
||||||
$auth->clearIdentity();
|
$auth->clearIdentity();
|
||||||
|
$storage = $auth->getStorage();
|
||||||
|
Zend_Session::namespaceUnset($storage->getNamespace());
|
||||||
$session = new Zend_Session_Namespace('login');
|
$session = new Zend_Session_Namespace('login');
|
||||||
$session->url = $_SERVER['REQUEST_URI'];
|
$session->url = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
$layout = Zend_Layout::getMVCInstance();
|
$request->setModuleName('default')
|
||||||
if ( !$layout->isEnabled() ) {
|
->setControllerName('user')
|
||||||
echo "Identification incorrect ou périmé.";
|
->setActionName('logout');
|
||||||
} else {
|
|
||||||
$this->_response->setRedirect('/user/login')->sendResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Authentifié => on met à jour la session
|
//Authentifié => on met à jour la session
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user