summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/User/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/User/User.php')
-rw-r--r--apps/user_ldap/lib/User/User.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index ed3ecedf227..afd43999c7f 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -190,13 +190,6 @@ class User {
}
unset($attr);
- //Email
- $attr = strtolower($this->connection->ldapEmailAttribute);
- if(isset($ldapEntry[$attr])) {
- $this->updateEmail($ldapEntry[$attr][0]);
- }
- unset($attr);
-
//displayName
$displayName = $displayName2 = '';
$attr = strtolower($this->connection->ldapUserDisplayName);
@@ -217,6 +210,15 @@ class User {
}
unset($attr);
+ //Email
+ //email must be stored after displayname, because it would cause a 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]);
+ }
+ unset($attr);
+
// LDAP Username, needed for s2s sharing
if(isset($ldapEntry['uid'])) {
$this->storeLDAPUserName($ldapEntry['uid'][0]);