Commit 6e3dcfa2 authored by Patrick Barroca's avatar Patrick Barroca 🐳

Merge branch 'hotline' into 'master'

Hotline

See merge request !3000
parents cb76fafe f29cb9e2
Pipeline #6268 passed with stage
in 33 minutes and 11 seconds
05/02/2019 - v8.0.1
- ticket #86381 : SIGB Nanook : Correction de l'authentification par SIGB uniquement
04/02/2019 - v8.0.0
- ticket #86010 : Administration : activation des fonctionnalités de la version 8.0 .
......
......@@ -107,19 +107,34 @@ class Class_Webservice_SIGB_Nanook_Service extends Class_WebService_SIGB_Abstrac
* @return Class_WebService_SIGB_Emprunteur
*/
public function getEmprunteur($user) {
if (!$this->ilsdiAuthenticatePatron($user))
if (!$user
|| (!$patron_id = $this->_patronIdFromUser($user)))
return Class_WebService_SIGB_Emprunteur::nullInstance();
$emprunteur= $this->ilsdiGetPatronInfo(['patronId' => $user->getIdSigb()],
Class_WebService_SIGB_Nanook_PatronInfoReader::newInstance());
$emprunteur = $this->ilsdiGetPatronInfo(['patronId' => $user->getIdSigb()],
Class_WebService_SIGB_Nanook_PatronInfoReader::newInstance());
if (!$emprunteur->getCodeBarres())
$emprunteur->setCodeBarres($user->getLogin());
$emprunteur->setPassword($user->getPassword());
return $emprunteur;
}
protected function _patronIdFromUser($user) {
$patron_id = Class_Users::isLogged($user)
? $user->getIdSigb()
: '';
if (!$patron_id && $this->ilsdiAuthenticatePatron($user))
$patron_id = $user->getIdSigb();
return $patron_id;
}
public function getUserAnnexe($user) {
return $user->id_site;
}
......
......@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.1');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -888,6 +888,35 @@ class NanookGetEmprunteurAuthenticateTest extends NanookTestCase {
$this->assertEmpty($emprunteur->getPassword());
}
/** @test */
public function withLoginThroughSigbOnlyAndAlreadyLoggedShouldNotAuthenticatePatron() {
$this->_mock_web_client
->whenCalled('open_url')
->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/999')
->answers(NanookFixtures::xmlGetPatronError());
Class_AdminVar::set('LOGIN_THROUGH_SIGB_ONLY', '1');
$user = $this->fixture('Class_Users',
['id' => 98734,
'id_site' => 3,
'idabon' => 'A-00001',
'id_sigb' => '999',
'login' => '90175000410218',
'password' => '',
'role_level' => ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB,
]);
ZendAfi_Auth::getInstance()->logUser($user);
$emprunteur = $this->_service->getEmprunteur($user);
$this->assertTrue($this->_mock_web_client
->methodHasBeenCalledWithParams('open_url',
['http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/999']));
}
}
......
Markdown is supported
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