aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-01-14 12:38:02 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2025-01-14 12:38:02 +0100
commitb45bc2a4624d234ebd8d43f001aeedc6db52af58 (patch)
treed5f4896e4ed376e7ed387bb586e28f5be1ecd0a0
parente187e4e87f73b6b17e40248d8779b8defe139a90 (diff)
downloadnextcloud-server-b45bc2a4624d234ebd8d43f001aeedc6db52af58.tar.gz
nextcloud-server-b45bc2a4624d234ebd8d43f001aeedc6db52af58.zip
fix: Use the new countUsersTotal method where it makes sense
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--apps/dav/lib/Migration/Version1027Date20230504122946.php2
-rw-r--r--lib/base.php3
2 files changed, 2 insertions, 3 deletions
diff --git a/apps/dav/lib/Migration/Version1027Date20230504122946.php b/apps/dav/lib/Migration/Version1027Date20230504122946.php
index f294cf192c2..89c192a8419 100644
--- a/apps/dav/lib/Migration/Version1027Date20230504122946.php
+++ b/apps/dav/lib/Migration/Version1027Date20230504122946.php
@@ -33,7 +33,7 @@ class Version1027Date20230504122946 extends SimpleMigrationStep {
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
- if ($this->userManager->countSeenUsers() > 100 || array_sum($this->userManager->countUsers()) > 100) {
+ if ($this->userManager->countSeenUsers() > 100 || $this->userManager->countUsersTotal(100) >= 100) {
$this->config->setAppValue('dav', 'needs_system_address_book_sync', 'yes');
$output->info('Could not sync system address books during update - too many user records have been found. Please call occ dav:sync-system-addressbook manually.');
return;
diff --git a/lib/base.php b/lib/base.php
index b0334ecd729..25f978df836 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -279,8 +279,7 @@ class OC {
}
if (!$tooBig) {
// count users
- $stats = Server::get(\OCP\IUserManager::class)->countUsers();
- $totalUsers = array_sum($stats);
+ $totalUsers = Server::get(\OCP\IUserManager::class)->countUsersTotal(51);
$tooBig = ($totalUsers > 50);
}
}