Skip to content
Snippets Groups Projects
Commit 7a6490a2 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #90710 : fix secure password sent to SIGB

parent 51dd76f0
3 merge requests!3297WIP: Master,!3125Hotline,!3122hotline #90710 : fix secure password sent to SIGB
Pipeline #6987 passed with stage
in 34 minutes and 51 seconds
- ticket #90710 : SIGB Nanook : Correction de la prise en compte de la sécurisation des mots de passe
\ No newline at end of file
......@@ -143,15 +143,29 @@ class AuthController extends ZendAfi_Controller_Action {
}
$user = Class_Users::getIdentity();
$user->getFicheSIGB(); // init sigb infos
$user
->setPassword($this->_request->getPost('secure_password'))
->save();
$user->setPassword($this->_request->getPost('secure_password'));
$this->getHelper('notify')->bePopup();
$this->_helper->notify($this->_('Votre compte est sécurisé. Vous pouvez maintenant vous connecter avec votre courriel et votre nouveau mot de passe.'));
try {
if ($user->save()) {
$patron = $user->getEmprunteur();
$patron->setPassword($this->_request->getPost('secure_password'));
$patron->ensureService($user)->save();
$this->getHelper('notify')->bePopup();
$this->_helper->notify($this->_('Votre compte est sécurisé. Vous pouvez maintenant vous connecter avec votre courriel et votre nouveau mot de passe.'));
$this->_redirect('/');
}
$form->addDecorator('Errors');
foreach($user->getErrors() as $error)
$form->addError($error);
} catch(Exception $e) {
$form->addError($e->getMessage());
$form->addDecorator('Errors');
}
$this->_redirect('/');
return $this->renderScript('auth/secure-password.phtml');
}
......
......@@ -181,6 +181,12 @@ class AuthControllerWithNanookPostSecurePasswordWithMailAndUnsecurePassword
}
/** @test @see http://forge.afi-sa.fr/issues/90710 */
public function nanookShouldHaveBeenCalled() {
$this->assertTrue($this->_web_client->methodHasBeenCalled('postData'));
}
/** @test */
public function usersZBTIC1234ShouldHavePasswordRoxor() {
$this->assertNotNull(Class_Users::findFirstBy(['login' => 'ZBTIC1234',
......
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