Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion apps/settings/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ protected function saveUserSettings(IAccount $userAccount): void {

$oldEmailAddress = $userAccount->getUser()->getSystemEMailAddress();
$oldEmailAddress = strtolower((string)$oldEmailAddress);
if ($oldEmailAddress !== $userAccount->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue()) {
if ($oldEmailAddress !== strtolower($userAccount->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue())) {
// this is the only permission a backend provides and is also used
// for the permission of setting a email address
if (!$userAccount->getUser()->canChangeDisplayName()) {
Expand Down
10 changes: 9 additions & 1 deletion apps/settings/tests/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public function testSaveUserSettings($data,
$user->method('getSystemEMailAddress')->willReturn($oldEmailAddress);
$user->method('canChangeDisplayName')->willReturn(true);

if ($data[IAccountManager::PROPERTY_EMAIL]['value'] === $oldEmailAddress ||
if (strtolower($data[IAccountManager::PROPERTY_EMAIL]['value']) === strtolower($oldEmailAddress) ||
($oldEmailAddress === null && $data[IAccountManager::PROPERTY_EMAIL]['value'] === '')) {
$user->expects($this->never())->method('setSystemEMailAddress');
} else {
Expand Down Expand Up @@ -745,6 +745,14 @@ public function dataTestSaveUserSettings() {
'[email protected]',
null
],
[
[
IAccountManager::PROPERTY_EMAIL => ['value' => '[email protected]'],
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
],
'[email protected]',
null
],

];
}
Expand Down