Commit 0a57e857 authored by THEO GUILLON's avatar THEO GUILLON

Merge branch...

Merge branch '444-pb-d-enregistrement-lorsqu-il-manque-des-champs-obligatoires-redescendus-du-ldap' into '2.0.0'

Resolve "Pb d'enregistrement lorsqu'il manque des champs obligatoires redescendus du LDAP"

See merge request libriciel/pole-citoyens/web-DPO/web-DPO!447
parents 2fcb8511 d3dcad85
......@@ -399,7 +399,13 @@ class User extends AppModel implements LinkedOrganisationInterface {
public function saveLdapManagerLdap($data) {
$this->Role->recursive = -1;
if (!$this->Role->exists($data['User']['role_id'])) {
if (!$this->Role->exists($data['User']['role_id']) ||
!isset($data['User']['username']) ||
!isset($data['User']['prenom']) ||
!isset($data['User']['nom']) ||
!isset($data['User']['email'])
) {
return false;
}
......@@ -411,10 +417,6 @@ class User extends AppModel implements LinkedOrganisationInterface {
$data['User']['civilite'] = 'M.';
}
if (!isset($data['User']['email'])) {
$data['User']['email'] = $data['User']['prenom'].'@test.fr';
}
if (!isset($data['User']['password'])) {
$data['User']['password'] = PasswordGeneratorAnssi::generate();
}
......
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