Skip to content

Commit 5d01de8

Browse files
committed
address reviews
Signed-off-by: szaimen <szaimen@e.mail.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 71ff8e5 commit 5d01de8

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

apps/updatenotification/js/updatenotification.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/updatenotification/js/updatenotification.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/updatenotification/lib/Settings/Admin.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ private function isWebUpdaterRecommended(): bool {
202202
return $this->getUserCount() < 100;
203203
}
204204

205-
// Copied from https://github.com/nextcloud/server/blob/a06001e0851abc6073af678b742da3e1aa96eec9/lib/private/Support/Subscription/Registry.php#L187-L214
205+
/**
206+
* @see https://github.com/nextcloud/server/blob/39494fbf794d982f6f6551c984e6ca4c4e947d01/lib/private/Support/Subscription/Registry.php#L188-L216 implementation reference
207+
*/
206208
private function getUserCount(): int {
207209
$userCount = 0;
208210
$backends = $this->userManager->getBackends();
@@ -213,24 +215,10 @@ private function getUserCount(): int {
213215
$backendUsers = $backend->countUsers();
214216
if ($backendUsers !== false) {
215217
$userCount += $backendUsers;
216-
} else {
217-
// TODO what if the user count can't be determined?
218-
$this->logger->warning('Can not determine user count for ' . get_class($backend), ['app' => 'updatenotification']);
219218
}
220219
}
221220
}
222221

223-
$disabledUsers = $this->config->getUsersForUserValue('core', 'enabled', 'false');
224-
$disabledUsersCount = count($disabledUsers);
225-
$userCount = $userCount - $disabledUsersCount;
226-
227-
if ($userCount < 0) {
228-
$userCount = 0;
229-
230-
// this should never happen
231-
$this->logger->warning("Total user count was negative (users: $userCount, disabled: $disabledUsersCount)", ['app' => 'updatenotification']);
232-
}
233-
234222
return $userCount;
235223
}
236224
}

0 commit comments

Comments
 (0)