Skip to content

Commit c23e4b3

Browse files
authored
Merge pull request #51987 from nextcloud/backport/51982/stable31
[stable31] Revert "refactor: add migration for email setting"
2 parents 177c0b2 + bc1e1a0 commit c23e4b3

File tree

5 files changed

+5
-38
lines changed

5 files changed

+5
-38
lines changed

apps/provisioning_api/lib/Controller/UsersController.php

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

759759
// Fallback to display name value to avoid changing behavior with the new option.
760-
if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
760+
if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
761761
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
762762
}
763763

@@ -918,7 +918,8 @@ public function editUser(string $userId, string $key, string $value): DataRespon
918918
$permittedFields[] = IAccountManager::PROPERTY_DISPLAYNAME;
919919
}
920920

921-
if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
921+
// Fallback to display name value to avoid changing behavior with the new option.
922+
if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
922923
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
923924
}
924925

core/Migrations/Version32000Date20250402182800.php

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

lib/composer/composer/autoload_classmap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,6 @@
14501450
'OC\\Core\\Migrations\\Version31000Date20240101084401' => $baseDir . '/core/Migrations/Version31000Date20240101084401.php',
14511451
'OC\\Core\\Migrations\\Version31000Date20240814184402' => $baseDir . '/core/Migrations/Version31000Date20240814184402.php',
14521452
'OC\\Core\\Migrations\\Version31000Date20250213102442' => $baseDir . '/core/Migrations/Version31000Date20250213102442.php',
1453-
'OC\\Core\\Migrations\\Version32000Date20250402182800' => $baseDir . '/core/Migrations/Version32000Date20250402182800.php',
14541453
'OC\\Core\\Notification\\CoreNotifier' => $baseDir . '/core/Notification/CoreNotifier.php',
14551454
'OC\\Core\\ResponseDefinitions' => $baseDir . '/core/ResponseDefinitions.php',
14561455
'OC\\Core\\Service\\LoginFlowV2Service' => $baseDir . '/core/Service/LoginFlowV2Service.php',

lib/composer/composer/autoload_static.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
14991499
'OC\\Core\\Migrations\\Version31000Date20240101084401' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20240101084401.php',
15001500
'OC\\Core\\Migrations\\Version31000Date20240814184402' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20240814184402.php',
15011501
'OC\\Core\\Migrations\\Version31000Date20250213102442' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20250213102442.php',
1502-
'OC\\Core\\Migrations\\Version32000Date20250402182800' => __DIR__ . '/../../..' . '/core/Migrations/Version32000Date20250402182800.php',
15031502
'OC\\Core\\Notification\\CoreNotifier' => __DIR__ . '/../../..' . '/core/Notification/CoreNotifier.php',
15041503
'OC\\Core\\ResponseDefinitions' => __DIR__ . '/../../..' . '/core/ResponseDefinitions.php',
15051504
'OC\\Core\\Service\\LoginFlowV2Service' => __DIR__ . '/../../..' . '/core/Service/LoginFlowV2Service.php',

lib/private/User/User.php

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

450450
public function canChangeEmail(): bool {
451-
return $this->config->getSystemValueBool('allow_user_to_change_email', true);
451+
// Fallback to display name value to avoid changing behavior with the new option.
452+
return $this->config->getSystemValueBool('allow_user_to_change_email', $this->config->getSystemValueBool('allow_user_to_change_display_name', true));
452453
}
453454

454455
/**

0 commit comments

Comments
 (0)