From 72ffab998d021cf8a27b78b1ba719cbd6d08967e Mon Sep 17 00:00:00 2001 From: szaimen Date: Fri, 25 Mar 2022 10:03:38 +0100 Subject: [PATCH] address review Signed-off-by: szaimen --- apps/updatenotification/lib/Settings/Admin.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index 1ca0d83cb5d75..f7e23ea0964ee 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -213,22 +213,16 @@ private function getUserCount(): int { $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; - + // Disabled users are not subtracted because they lengthen the overall update size, too if ($userCount < 0) { $userCount = 0; // this should never happen - $this->logger->warning("Total user count was negative (users: $userCount, disabled: $disabledUsersCount)", ['app' => 'updatenotification']); + $this->logger->warning("Total user count was negative (users: $userCount)", ['app' => 'updatenotification']); } return $userCount;