Skip to content

Commit 50baa0a

Browse files
provokateurinbackportbot[bot]
authored andcommitted
Revert "refactor: add migration for email setting"
This reverts commit e7859f0. Signed-off-by: provokateurin <kate@provokateurin.de> [skip ci]
1 parent cd763a9 commit 50baa0a

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

apps/provisioning_api/lib/Controller/UsersController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ public function getEditableFieldsForUser(string $userId): DataResponse {
717717
}
718718

719719
// Fallback to display name value to avoid changing behavior with the new option.
720-
if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
720+
if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
721721
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
722722
}
723723

@@ -873,7 +873,8 @@ public function editUser(string $userId, string $key, string $value): DataRespon
873873
$permittedFields[] = IAccountManager::PROPERTY_DISPLAYNAME;
874874
}
875875

876-
if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
876+
// Fallback to display name value to avoid changing behavior with the new option.
877+
if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
877878
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
878879
}
879880

core/Migrations/Version32000Date20250402182800.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/private/User/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ public function canChangeDisplayName() {
441441
}
442442

443443
public function canChangeEmail(): bool {
444-
return $this->config->getSystemValueBool('allow_user_to_change_email', true);
444+
// Fallback to display name value to avoid changing behavior with the new option.
445+
return $this->config->getSystemValueBool('allow_user_to_change_email', $this->config->getSystemValueBool('allow_user_to_change_display_name', true));
445446
}
446447

447448
/**

0 commit comments

Comments
 (0)