mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Merge pull request #49404 from Thatoo/Thatoo-patch-1
fix(user_ldap): retrieve from LDAP first "email shaped" value instead…
This commit is contained in:
commit
c9073f7ab7
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue