aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2025-04-07 09:55:05 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-04-07 08:20:15 +0000
commitbc1e1a064e2c05accafd153a0f6d0ffe8257a1b4 (patch)
tree102332335d6f3e5017b5c577289e7b4e3d39f68d
parent177c0b2487bd241471d269b7a13d42cbe8356da0 (diff)
downloadnextcloud-server-backport/51982/stable31.tar.gz
nextcloud-server-backport/51982/stable31.zip
Revert "refactor: add migration for email setting"backport/51982/stable31
This reverts commit e7859f0dacbda051c2decb2e0d62345435ac2fd9. Signed-off-by: provokateurin <kate@provokateurin.de>
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php5
-rw-r--r--core/Migrations/Version32000Date20250402182800.php33
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/private/User/User.php3
5 files changed, 5 insertions, 38 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 6629440482d..4b3db45f518 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -757,7 +757,7 @@ class UsersController extends AUserDataOCSController {
}
// Fallback to display name value to avoid changing behavior with the new option.
- if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
+ if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
}
@@ -918,7 +918,8 @@ class UsersController extends AUserDataOCSController {
$permittedFields[] = IAccountManager::PROPERTY_DISPLAYNAME;
}
- if ($this->config->getSystemValue('allow_user_to_change_email', true)) {
+ // Fallback to display name value to avoid changing behavior with the new option.
+ if ($this->config->getSystemValue('allow_user_to_change_email', $allowDisplayNameChange)) {
$permittedFields[] = IAccountManager::PROPERTY_EMAIL;
}
diff --git a/core/Migrations/Version32000Date20250402182800.php b/core/Migrations/Version32000Date20250402182800.php
deleted file mode 100644
index c63e95766f5..00000000000
--- a/core/Migrations/Version32000Date20250402182800.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OC\Core\Migrations;
-
-use OCP\IConfig;
-use OCP\Migration\IOutput;
-use OCP\Migration\SimpleMigrationStep;
-
-/**
- * Add `allow_user_to_change_email` system config
- */
-class Version32000Date20250402182800 extends SimpleMigrationStep {
-
- public function __construct(
- private IConfig $config,
- ) {
- }
-
- public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
- $allowDisplayName = $this->config->getSystemValue('allow_user_to_change_display_name', null);
- $allowEmail = $this->config->getSystemValue('allow_user_to_change_email', null);
-
- // if displayname was set, but not the email setting, then set the email setting to the same as the email setting
- if ($allowDisplayName !== null && $allowEmail === null) {
- $this->config->setSystemValue('allow_user_to_change_email', $allowDisplayName === true);
- }
- }
-
-}
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 9d876636624..3ba403dab25 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -1450,7 +1450,6 @@ return array(
'OC\\Core\\Migrations\\Version31000Date20240101084401' => $baseDir . '/core/Migrations/Version31000Date20240101084401.php',
'OC\\Core\\Migrations\\Version31000Date20240814184402' => $baseDir . '/core/Migrations/Version31000Date20240814184402.php',
'OC\\Core\\Migrations\\Version31000Date20250213102442' => $baseDir . '/core/Migrations/Version31000Date20250213102442.php',
- 'OC\\Core\\Migrations\\Version32000Date20250402182800' => $baseDir . '/core/Migrations/Version32000Date20250402182800.php',
'OC\\Core\\Notification\\CoreNotifier' => $baseDir . '/core/Notification/CoreNotifier.php',
'OC\\Core\\ResponseDefinitions' => $baseDir . '/core/ResponseDefinitions.php',
'OC\\Core\\Service\\LoginFlowV2Service' => $baseDir . '/core/Service/LoginFlowV2Service.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index a919864da21..e2ab6999525 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -1499,7 +1499,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Core\\Migrations\\Version31000Date20240101084401' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20240101084401.php',
'OC\\Core\\Migrations\\Version31000Date20240814184402' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20240814184402.php',
'OC\\Core\\Migrations\\Version31000Date20250213102442' => __DIR__ . '/../../..' . '/core/Migrations/Version31000Date20250213102442.php',
- 'OC\\Core\\Migrations\\Version32000Date20250402182800' => __DIR__ . '/../../..' . '/core/Migrations/Version32000Date20250402182800.php',
'OC\\Core\\Notification\\CoreNotifier' => __DIR__ . '/../../..' . '/core/Notification/CoreNotifier.php',
'OC\\Core\\ResponseDefinitions' => __DIR__ . '/../../..' . '/core/ResponseDefinitions.php',
'OC\\Core\\Service\\LoginFlowV2Service' => __DIR__ . '/../../..' . '/core/Service/LoginFlowV2Service.php',
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 9d61aaf48e0..f04977314e2 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -448,7 +448,8 @@ class User implements IUser {
}
public function canChangeEmail(): bool {
- return $this->config->getSystemValueBool('allow_user_to_change_email', true);
+ // Fallback to display name value to avoid changing behavior with the new option.
+ return $this->config->getSystemValueBool('allow_user_to_change_email', $this->config->getSystemValueBool('allow_user_to_change_display_name', true));
}
/**