]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix user tests, avoid setting enabled state to the same value
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 23 May 2023 15:18:19 +0000 (17:18 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 23 May 2023 15:18:19 +0000 (17:18 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/User/User.php

index 8830b4aae71c4994144a6255201b9b3d6e7a4913..3b7123bd5751db804513b1acac1dfa1e7b866d56 100644 (file)
@@ -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);
                }
        }