Commit 143ee898 authored by efalcy's avatar efalcy Committed by Patrick Barroca

hotline#107675 fix birth date to null

parent 4691db19
Pipeline #9656 passed with stage
in 41 minutes and 56 seconds
- ticket #107675 : Ressources numériques : Correction d'une erreur lors du SSO de certains fournisseurs utilisant les dates de naissance
\ No newline at end of file
......@@ -469,7 +469,7 @@ class Class_Users extends Storm_Model_Abstract {
'role_level' => 0,
'idabon' => '',
'date_fin' => '',
'naissance' => '',
'naissance' => null,
'date_debut' => '',
'telephone' => '',
'mail' => '',
......@@ -1376,6 +1376,10 @@ class Class_Users extends Storm_Model_Abstract {
->getCurrentDateFormatInYmdHMS());
$this->setPassword((new Class_User_Password($this))->format());
if (null !== ($naissance = $this->getNaissance())
&& false === strtotime($naissance))
$this->setNaissance(null);
}
......
......@@ -88,7 +88,7 @@ class LesYeuxDoc_Config extends Class_DigitalResource_Config {
'prenom' => $user->getPrenom(),
'nom' => $user->getNom(),
'email' => $user->getMail(),
'dnaiss' => $user->getNaissance(),
'dnaiss' => ($date = $user->getNaissance()) ? $date : '',
'datout' => $user->getDateFin(),
'return_url' => $return_url];
......
......@@ -864,6 +864,13 @@ class UsersControllerAddActionPostTest extends UsersControllerWithMarcusTestCase
}
/** @test */
public function birthDateShouldBeNull() {
$this->_postData();
$this->assertNull(Class_Users::findFirstBy(['login' => 'mdavis'])->getNaissance());
}
/** @test */
public function existingLoginShouldReturnError() {
$this->user_loader
......
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