aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2025-04-07 09:55:05 +0200
committerprovokateurin <kate@provokateurin.de>2025-04-07 10:25:35 +0200
commit820090999fa6988f9dc6a9f6eafcc3637dae33e5 (patch)
treec5c3e5a0f0f57ed9ec994a8e259e1c3f5ea9ea58
parentcd763a95186bd77eb17d57e72f71eba46bd7feff (diff)
downloadnextcloud-server-backport/51982/stable29.tar.gz
nextcloud-server-backport/51982/stable29.zip
Revert "refactor: add migration for email setting"backport/51982/stable29
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 ef90adc7f2a..39c6df4160e 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -717,7 +717,7 @@ class UsersController extends AUserData {
}
// 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;
}
@@ -873,7 +873,8 @@ class UsersController extends AUserData {
$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 5b4b1ba1e83..1ef4f8817f9 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -1284,7 +1284,6 @@ return array(
'OC\\Core\\Migrations\\Version29000Date20240124132202' => $baseDir . '/core/Migrations/Version29000Date20240124132202.php',
'OC\\Core\\Migrations\\Version29000Date20240131122720' => $baseDir . '/core/Migrations/Version29000Date20240131122720.php',
'OC\\Core\\Migrations\\Version30000Date20240814180800' => $baseDir . '/core/Migrations/Version30000Date20240814180800.php',
- 'OC\\Core\\Migrations\\Version32000Date20250402182800' => $baseDir . '/core/Migrations/Version32000Date20250402182800.php',
'OC\\Core\\Notification\\CoreNotifier' => $baseDir . '/core/Notification/CoreNotifier.php',
'OC\\Core\\Service\\LoginFlowV2Service' => $baseDir . '/core/Service/LoginFlowV2Service.php',
'OC\\DB\\Adapter' => $baseDir . '/lib/private/DB/Adapter.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index c40cb79efb9..ebce96ca018 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -1317,7 +1317,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Core\\Migrations\\Version29000Date20240124132202' => __DIR__ . '/../../..' . '/core/Migrations/Version29000Date20240124132202.php',
'OC\\Core\\Migrations\\Version29000Date20240131122720' => __DIR__ . '/../../..' . '/core/Migrations/Version29000Date20240131122720.php',
'OC\\Core\\Migrations\\Version30000Date20240814180800' => __DIR__ . '/../../..' . '/core/Migrations/Version30000Date20240814180800.php',
- 'OC\\Core\\Migrations\\Version32000Date20250402182800' => __DIR__ . '/../../..' . '/core/Migrations/Version32000Date20250402182800.php',
'OC\\Core\\Notification\\CoreNotifier' => __DIR__ . '/../../..' . '/core/Notification/CoreNotifier.php',
'OC\\Core\\Service\\LoginFlowV2Service' => __DIR__ . '/../../..' . '/core/Service/LoginFlowV2Service.php',
'OC\\DB\\Adapter' => __DIR__ . '/../../..' . '/lib/private/DB/Adapter.php',
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 81893a3f28e..ccc1e587db3 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -441,7 +441,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));
}
/**