diff --git a/library/Class/Multimedia/AuthenticateRequest.php b/library/Class/Multimedia/AuthenticateRequest.php index b44711b4840e264c704e8bce439ec13d130e3aa6..5a2f209630327859881a62bf0ce00cead1993821 100644 --- a/library/Class/Multimedia/AuthenticateRequest.php +++ b/library/Class/Multimedia/AuthenticateRequest.php @@ -54,7 +54,10 @@ class Class_Multimedia_AuthenticateRequest { || !($site = $request->getParam('site'))) return $this->_error('MissingParameter'); - if (!ZendAfi_Auth::getInstance()->authenticateLoginPassword($login, $password)) { + $auth = ZendAfi_Auth::getInstance(); + if (!$auth->authenticateLoginPassword($login, + $password, + [$auth->newAuthSIGB(), $auth->newAuthDb()])) { if (Class_Users::findFirstBy(['login' => $login])) return $this->_error('PasswordIsWrong'); return $this->_error('UserNotFound'); diff --git a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php index 74ebd44ba9600fd9a1e29948cb33278bb97d8c55..b934d965d2123a57812d928e3b60e84d84927004 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php @@ -63,12 +63,11 @@ abstract class AbonneControllerMultimediaAuthenticateTestCase extends AbstractCo public function setUp() { parent::setUp(); $this->_auth = Storm_Test_ObjectWrapper::mock() - ->whenCalled('authenticateLoginPassword') - ->answers(false) - ->whenCalled('hasIdentity') - ->answers(false) - ->whenCalled('getIdentity') - ->answers(null); + ->whenCalled('authenticateLoginPassword')->answers(false) + ->whenCalled('hasIdentity')->answers(false) + ->whenCalled('getIdentity')->answers(null) + ->whenCalled('newAuthSIGB')->answers('auth_sigb') + ->whenCalled('newAuthDb')->answers('auth_db'); ZendAfi_Auth::setInstance($this->_auth); } @@ -95,7 +94,7 @@ abstract class AbonneControllerMultimediaAuthenticateTestCase extends AbstractCo protected function _expectUserToLoad($user) { $this->_auth ->whenCalled('authenticateLoginPassword') - ->with($user->getLogin(), $user->getPassword()) + ->with($user->getLogin(), $user->getPassword(), ['auth_sigb', 'auth_db']) ->answers(true) ->whenCalled('getIdentity') ->answers($user);