aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2024-12-05 14:23:19 +0100
committerGitHub <noreply@github.com>2024-12-05 14:23:19 +0100
commitc9073f7ab7be631e90be77b46d51369d3dbbf5fe (patch)
treea22140abcd4a4173ce36fcd2be241c7ad4f8181a /apps/user_ldap
parent7bc21d8a34e9d4a0a066a0069a9a7abf13158368 (diff)
parent486f0eda718b49c2df5c8996c96a0e61ffca0a70 (diff)
downloadnextcloud-server-c9073f7ab7be631e90be77b46d51369d3dbbf5fe.tar.gz
nextcloud-server-c9073f7ab7be631e90be77b46d51369d3dbbf5fe.zip
Merge pull request #49404 from Thatoo/Thatoo-patch-1
fix(user_ldap): retrieve from LDAP first "email shaped" value instead…
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/User/User.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 7ef36ff1512..824d12c52e1 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -154,7 +154,14 @@ class User {
//change event that will trigger fetching the display name again
$attr = strtolower($this->connection->ldapEmailAttribute);
if (isset($ldapEntry[$attr])) {
- $this->updateEmail($ldapEntry[$attr][0]);
+ $mailValue = 0;
+ for ($x = 0; $x < count($ldapEntry[$attr]); $x++) {
+ if (filter_var($ldapEntry[$attr][$x], FILTER_VALIDATE_EMAIL)) {
+ $mailValue = $x;
+ break;
+ }
+ }
+ $this->updateEmail($ldapEntry[$attr][$mailValue]);
}
unset($attr);