Skip to content
Snippets Groups Projects
Commit 3617ef8d authored by efalcy's avatar efalcy
Browse files

Correction redirection authentification sur les accès pages abonnés

parent cb17cb8b
No related merge requests found
......@@ -25,13 +25,11 @@ class AbonneController extends ZendAfi_Controller_Action {
public function init() {
parent::init();
if ("authenticate" == $this->getRequest()->getActionName())
return;
if (!$this->_user = Class_Users::getLoader()->getIdentity()) {
$this->_redirect('auth/login');
return;
}
$this->_user = Class_Users::getLoader()->getIdentity();
$this->clearEmprunteurCache();
}
......
......@@ -232,3 +232,7 @@ var openDialogExemplaires = function() {
[[file:library/Class/Moderer.php::'count'%20%3D>%20Class_SuggestionAchat::count()%5D][moderation]]
[[file:library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php::$nb_moderations%20%3D%20$modstats%5B'avis_notices'%5D%5B'count'%5D][affichage menu gauche]]
* Clear identity
ZendAfi_Auth::getInstance()->clearIdentity();
......@@ -89,6 +89,12 @@ class ZendAfi_Controller_Plugin_AdminAuth extends Zend_Controller_Plugin_Abstrac
$controller = 'index';
$action = 'sitedown';
}
if ((!$user = Class_Users::getIdentity()) && $controller = "abonne") {
$controller = 'auth';
$action = 'login';
}
}
// Parametres du controller
......
......@@ -64,6 +64,24 @@ abstract class AbonneControllerTelephoneTestCase extends TelephoneAbstractContro
class AbonneControllerTelephoneIndexNotConnectedTest extends AbonneControllerTelephoneTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('abonne', true);
}
/** @test */
public function controllerShouldBeAuth() {
$this->assertController('auth');
$this->assertAction('login');
}
}
class AbonneControllerTelephoneFicheTest extends AbonneControllerTelephoneTestCase {
public function setUp() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment