diff options
author | szaimen <szaimen@e.mail.de> | 2022-03-25 12:03:38 +0300 |
---|---|---|
committer | szaimen <szaimen@e.mail.de> | 2022-03-28 22:12:35 +0300 |
commit | 4e11d7d0f991bf9d74a3e6fa7fce89430d52402b (patch) | |
tree | 7a3d21d75d8fc37933846bca884cbf0a18d6d2ad /apps/updatenotification | |
parent | e8122f21c5bdba3e284931b3b076f5b127c062e0 (diff) |
address reviews
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'apps/updatenotification')
-rw-r--r-- | apps/updatenotification/lib/Settings/Admin.php | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index 1ca0d83cb5d..b8062efd81f 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -202,7 +202,9 @@ class Admin implements ISettings { return $this->getUserCount() < 100; } - // Copied from https://github.com/nextcloud/server/blob/a06001e0851abc6073af678b742da3e1aa96eec9/lib/private/Support/Subscription/Registry.php#L187-L214 + /** + * @see https://github.com/nextcloud/server/blob/39494fbf794d982f6f6551c984e6ca4c4e947d01/lib/private/Support/Subscription/Registry.php#L188-L216 implementation reference + */ private function getUserCount(): int { $userCount = 0; $backends = $this->userManager->getBackends(); @@ -213,24 +215,10 @@ class Admin implements ISettings { $backendUsers = $backend->countUsers(); if ($backendUsers !== false) { $userCount += $backendUsers; - } else { - // TODO what if the user count can't be determined? - $this->logger->warning('Can not determine user count for ' . get_class($backend), ['app' => 'updatenotification']); } } } - $disabledUsers = $this->config->getUsersForUserValue('core', 'enabled', 'false'); - $disabledUsersCount = count($disabledUsers); - $userCount = $userCount - $disabledUsersCount; - - if ($userCount < 0) { - $userCount = 0; - - // this should never happen - $this->logger->warning("Total user count was negative (users: $userCount, disabled: $disabledUsersCount)", ['app' => 'updatenotification']); - } - return $userCount; } } |