Commit 9a7a09fc authored by Patrick Barroca's avatar Patrick Barroca 🎮

Merge branch...

Merge branch 'hotline#90710_identification_par_mail_ko_le_mdp_ne_remonte_pas_dans_nanook' into 'hotline'

hotline #90710 : fix secure password sent to SIGB

See merge request afi/opacce!3122
parents 33b9f49a 7a6490a2
- 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',
......
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