Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-07-26 22:10:01 +0300
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-07-26 22:10:01 +0300
commit53938bd87621b5c47104ab641fb8dc50ead71114 (patch)
treec6750f7d91eed121abffd852c2b60346dec94b3c /apps
parente5c22c3695ed2604bcd6e1a07c3f8e68f09aaa76 (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.php5
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);
+ }
}
}