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()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$auth->clearIdentity();
|
||||
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$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');
|
||||
}
|
||||
|
||||
|
@ -59,15 +59,14 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||
|
||||
$auth->clearIdentity();
|
||||
$storage = $auth->getStorage();
|
||||
Zend_Session::namespaceUnset($storage->getNamespace());
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
$session->url = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$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 {
|
||||
|
Loading…
Reference in New Issue
Block a user