diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-07-26 22:10:01 +0300 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-07-26 22:10:01 +0300 |
commit | 53938bd87621b5c47104ab641fb8dc50ead71114 (patch) | |
tree | c6750f7d91eed121abffd852c2b60346dec94b3c /apps | |
parent | e5c22c3695ed2604bcd6e1a07c3f8e68f09aaa76 (diff) |
Prevent setting email and triggering events at login time (#25531)
Whenever an LDAP user also has an email address defined in LDAP, the
LDAP code will try and update the email address of the locally known
user. This happens at login time or every time the user's LDAP
attributes are processed.
There is code listening to the email setting hook which updates the
system address book, which also will trigger FS setup due to avatars
and other things.
This fix only sets the email address when really necessary.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/user/user.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/user/user.php index c7a1fcdefff..072f475d400 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/user/user.php @@ -433,7 +433,10 @@ class User { } if(!is_null($email)) { $user = $this->userManager->get($this->uid); - $user->setEMailAddress($email); + $currentEmail = $user->getEMailAddress(); + if ($currentEmail !== $email) { + $user->setEMailAddress($email); + } } } |