diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-05-23 17:18:19 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-05-23 17:18:19 +0200 |
commit | 285c42ab14199ab1c6a5f32cf1590e7a0aa3be49 (patch) | |
tree | 54332cdf71b591da2954a7954416445bffb2c069 | |
parent | 50ccfb4f5bd200c2b12b737c3c7ba8c0e4eb1302 (diff) | |
download | nextcloud-server-285c42ab14199ab1c6a5f32cf1590e7a0aa3be49.tar.gz nextcloud-server-285c42ab14199ab1c6a5f32cf1590e7a0aa3be49.zip |
Fix user tests, avoid setting enabled state to the same value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/private/User/User.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 8830b4aae71..3b7123bd575 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -467,10 +467,11 @@ class User implements IUser { return (bool) $this->enabled; }; $this->backend->setUserEnabled($this->uid, $enabled, $queryDatabaseValue, $setDatabaseValue); - } else { + if ($oldStatus !== $enabled) { + $this->triggerChange('enabled', $enabled, $oldStatus); + } + } elseif ($oldStatus !== $enabled) { $setDatabaseValue($enabled); - } - if ($oldStatus !== $enabled) { $this->triggerChange('enabled', $enabled, $oldStatus); } } |