Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-22 16:53:37 +0300
committerCôme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com>2022-03-31 11:38:05 +0300
commit9fc00fdb8289a0e1b65be39a5afa7d5ea8513e74 (patch)
treeb661911d24fe2a98b0884a9428d9c9ce6c40958b /apps/user_ldap
parentbd9c4fbc070cf41974900eb1fe03d3b72fcf1e01 (diff)
Avoid updating _lastChange when nothing is changed in the configurationfix/user_ldap-fix-last-change-updates
Had to set at least one var when creating an empty configuration in order to save the default values. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Command/CreateEmptyConfig.php1
-rw-r--r--apps/user_ldap/lib/Configuration.php5
-rw-r--r--apps/user_ldap/lib/Controller/ConfigAPIController.php1
3 files changed, 4 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Command/CreateEmptyConfig.php b/apps/user_ldap/lib/Command/CreateEmptyConfig.php
index 8b1736e3a53..f7f04e28e60 100644
--- a/apps/user_ldap/lib/Command/CreateEmptyConfig.php
+++ b/apps/user_ldap/lib/Command/CreateEmptyConfig.php
@@ -59,6 +59,7 @@ class CreateEmptyConfig extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$configPrefix = $this->helper->getNextServerConfigurationPrefix();
$configHolder = new Configuration($configPrefix);
+ $configHolder->ldapConfigurationActive = false;
$configHolder->saveConfiguration();
$prose = '';
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 799ff27a896..c16823d39ee 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -56,10 +56,9 @@ class Configuration {
*/
protected $configRead = false;
/**
- * @var string[] pre-filled with one reference key so that at least one entry is written on save request and
- * the config ID is registered
+ * @var string[]
*/
- protected $unsavedChanges = ['ldapConfigurationActive' => 'ldapConfigurationActive'];
+ protected array $unsavedChanges = [];
/**
* @var array<string, mixed> settings
diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php
index 72ded754880..e408d03fcd5 100644
--- a/apps/user_ldap/lib/Controller/ConfigAPIController.php
+++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php
@@ -118,6 +118,7 @@ class ConfigAPIController extends OCSController {
try {
$configPrefix = $this->ldapHelper->getNextServerConfigurationPrefix();
$configHolder = new Configuration($configPrefix);
+ $configHolder->ldapConfigurationActive = false;
$configHolder->saveConfiguration();
} catch (\Exception $e) {
$this->logger->logException($e);