diff options
author | Louis Chemineau <louis@chmn.me> | 2022-09-06 10:58:01 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-01-02 15:30:15 +0000 |
commit | 34a93a0e12a2e1cb318093d9787fe929daee65e5 (patch) | |
tree | 6529e5d694ddd7eef8d0759e38227059a0e6314e /lib/private | |
parent | 6881d200ad72a881dc4449ca38153f85d966195f (diff) | |
download | nextcloud-server-34a93a0e12a2e1cb318093d9787fe929daee65e5.tar.gz nextcloud-server-34a93a0e12a2e1cb318093d9787fe929daee65e5.zip |
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>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/User/User.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 0a51622428b..23b24f0481b 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -190,7 +190,7 @@ class User implements IUser { $this->setPrimaryEMailAddress(''); } - if ($oldMailAddress !== $mailAddress) { + if ($oldMailAddress !== strtolower($mailAddress)) { $this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress); } } |