From 0135531ea7f04629aed4bc6268229ca1ae3c6c6e Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 25 Jun 2025 16:13:04 +0530 Subject: [PATCH 1/4] Fetch username and displayname attributes at creation from LDAP --- lib/Service/UserService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 7cca2d81..776074ba 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -83,11 +83,17 @@ class UserService { return $exists; } + $requiredLDAPattributes = [ + 'dn', + strtolower($this->connection->ldapExpertUsernameAttr), + strtolower($this->connection->ldapUserDisplayName) + ]; + $backends = $this->userManager->getBackends(); foreach ($backends as $backend) { if ($backend->getBackendName() === 'LDAP') { $access = $backend->getLDAPAccess($uid); - $users = $access->fetchUsersByLoginName($uid) ; + $users = $access->fetchUsersByLoginName($uid, $requiredLDAPattributes); if (count($users) > 0) { $exists = true; } -- GitLab From cf87f9d3b3c4fe6721a3e5888fdd5c23decf8151 Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 25 Jun 2025 16:18:16 +0530 Subject: [PATCH 2/4] Use connection attribute of ldap access object --- lib/Service/UserService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 776074ba..6560503f 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -83,16 +83,16 @@ class UserService { return $exists; } - $requiredLDAPattributes = [ - 'dn', - strtolower($this->connection->ldapExpertUsernameAttr), - strtolower($this->connection->ldapUserDisplayName) - ]; - $backends = $this->userManager->getBackends(); foreach ($backends as $backend) { if ($backend->getBackendName() === 'LDAP') { $access = $backend->getLDAPAccess($uid); + $requiredLDAPattributes = [ + 'dn', + strtolower($access->connection->ldapExpertUsernameAttr), + strtolower($access->connection->ldapUserDisplayName) + ]; + $users = $access->fetchUsersByLoginName($uid, $requiredLDAPattributes); if (count($users) > 0) { $exists = true; -- GitLab From 649f35506cbf01862aadf061e1a5d03bd94661c9 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 26 Jun 2025 10:31:50 +0200 Subject: [PATCH 3/4] retrieve needed attributes with getAttributes --- lib/Service/UserService.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 6560503f..277ec540 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -87,12 +87,7 @@ class UserService { foreach ($backends as $backend) { if ($backend->getBackendName() === 'LDAP') { $access = $backend->getLDAPAccess($uid); - $requiredLDAPattributes = [ - 'dn', - strtolower($access->connection->ldapExpertUsernameAttr), - strtolower($access->connection->ldapUserDisplayName) - ]; - + $requiredLDAPattributes = $access->userManager->getAttributes(); $users = $access->fetchUsersByLoginName($uid, $requiredLDAPattributes); if (count($users) > 0) { $exists = true; -- GitLab From e166628ba17d41085c3cd5ce9ae0fe61724ce2d9 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Thu, 26 Jun 2025 10:36:22 +0200 Subject: [PATCH 4/4] bump 10.0.5 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 7af1d66a..3dbec5c8 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,7 +10,7 @@ - 10.0.4 + 10.0.5 agpl Murena SAS EcloudAccounts -- GitLab