diff --git a/application/modules/opac/controllers/AuthController.php b/application/modules/opac/controllers/AuthController.php index b5dc939a5cf6c2f9bf375aac05f7ec492a232961..2a5647a4e54be2640911a79968304675d12c595a 100644 --- a/application/modules/opac/controllers/AuthController.php +++ b/application/modules/opac/controllers/AuthController.php @@ -121,12 +121,12 @@ class AuthController extends ZendAfi_Controller_Action { $this->_loginResult('',true); - if (!Class_Users::getLoader()->getIdentity()==null) { + if (!Class_Users::getLoader()->getIdentity()==null) { $this->renderPopup($redirect); return ; } - $this->renderPopup($this->view->url(['action' => 'popup-login'])); + $this->renderPopup($this->view->url(['action' => 'popup-login']).'?redirect='.urlencode($redirect)); } diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php index d4fdcca6af9521db64cc86736792f01add7c8b88..f0d73ff6d5e068f1a9495b217c5594ca9004e70f 100644 --- a/tests/application/modules/opac/controllers/AuthControllerTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerTest.php @@ -487,7 +487,9 @@ class AuthControllerPostTest extends AuthControllerNobodyLoggedTestCase { public function ajaxLoginWithWrongInformation() { $this->postDispatch('/opac/auth/ajax-login?id_module=4', - ['username' => 'foo', 'password' => 'zoork'],true); + ['username' => 'foo', + 'password' => 'zoork', + 'redirect' => '/auth/panier'],true); } @@ -551,7 +553,7 @@ class AuthControllerPostTest extends AuthControllerNobodyLoggedTestCase { $this->ajaxLoginWithWrongInformation(); $this->assertRedirectTo($this->_referer); $this->assertFlashMessengerEquals(['Identifiant ou mot de passe incorrect.', - [ZendAfi_Controller_Action_Helper_FlashMessenger::POPUP => ['url' => '/auth/popup-login']]]); + [ZendAfi_Controller_Action_Helper_FlashMessenger::POPUP => ['url' => '/auth/popup-login?redirect='.urlencode('/auth/panier')]]]); }