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
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2022-09-06 11:58:01 +0300
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>2022-09-06 16:18:07 +0300
commit6c11944679fdcf30679ef1c0891382e78e32f3c1 (patch)
tree5228048020f02dd18bb40590b562845144a6b8ff
parent5104ee9dd494ff1916593139937d02e3affc8918 (diff)
I dug into it again, and the issue is much simpler than I previously though.
- LDAP has an email address with capital letters - NC store this address in lower case - When the user logs in, we compare the [stored email with the new lower case email](https://github.com/nextcloud/server/blob/master/lib/private/AllConfig.php#L259-L261) before storing it. Here, both email will be the same, so we won't store the new email address with upper case letters. Which is what we want. - We then [compare emails as they are before triggering an event](https://github.com/nextcloud/server/blob/master/lib/private/User/User.php#L202-L204), they won't match, so the user will receive an email signaling an email change every time he logs in. The fix is to compare the old email with the new lower case email before sending the event. Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--lib/private/User/User.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 72c0d5c1a88..f5d93dcd680 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -199,7 +199,7 @@ class User implements IUser {
$this->setPrimaryEMailAddress('');
}
- if ($oldMailAddress !== $mailAddress) {
+ if ($oldMailAddress !== strtolower($mailAddress)) {
$this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress);
}
}