Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent setting email and triggering events at login time
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.
  • Loading branch information
Vincent Petry committed Jul 21, 2016
commit 94a7cdc87925920ae99dc1afa43eacaf503390d4
5 changes: 4 additions & 1 deletion apps/user_ldap/lib/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ public function updateEmail($valueFromLDAP = null) {
if(!is_null($email)) {
$user = $this->userManager->get($this->uid);
if (!is_null($user)) {
$user->setEMailAddress($email);
$currentEmail = $user->getEMailAddress();
if ($currentEmail !== $email) {
$user->setEMailAddress($email);
}
}
}
}
Expand Down