From 3e0304fe5a14e509fcd8546b13a4f8df74f7826b Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Sun, 7 Jan 2024 19:38:43 +0100 Subject: [PATCH] upadte ldap patch --- sources/patches/main-00-ldap-auth.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sources/patches/main-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch index cccd7d8..fdf51e7 100644 --- a/sources/patches/main-00-ldap-auth.patch +++ b/sources/patches/main-00-ldap-auth.patch @@ -122,14 +122,14 @@ index 00000000..eb8b1149 + $email = $entry->getAttribute('mail'); + + // Dans le cadre de la connexion LDAP Yunohost, -+ // on cherche l'utilisateur par son id et son mail, -+ // puis on l'enregistre uniquement avec son id. -+ $user = $this->userRepository->findOneBy(['username' => [...$email, $identifier]]); ++ // on cherche l'utilisateur par son mail. ++ // ++ $user = $this->userRepository->findOneBy(['username' => $email]); + -+ // Si l'utilisateur n'existe pas enore, on le crée. ++ // Si l'utilisateur n'existe pas encore, on le crée. + if (!$user) { + $user = (new User()) -+ ->setUsername($identifier) ++ ->setUsername(\reset($email)) + ->setPassword(\random_bytes(32)) + ->setActive(true) + ->setUpdatedAt(new \DateTimeImmutable()) @@ -139,8 +139,8 @@ index 00000000..eb8b1149 + $this->entityManager->flush(); + } + -+ return $user->setUsername($identifier) -+ ->setEmail(\reset($email)) ++ return $user->setUsername(\reset($email)) ++ ->setIdentifier($identifier) + ; + } +}