diff --git a/apps/settings/lib/Controller/UsersController.php b/apps/settings/lib/Controller/UsersController.php index 2e3b0d80ebcfc..46c149a1fed95 100644 --- a/apps/settings/lib/Controller/UsersController.php +++ b/apps/settings/lib/Controller/UsersController.php @@ -166,7 +166,7 @@ public function usersList(): TemplateResponse { $recentUsersGroup = [ 'id' => '__nc_internal_recent', 'name' => $this->l10n->t('Recently active'), - 'usercount' => $userCount, + 'usercount' => $this->userManager->countSeenUsers(), ]; $disabledUsersGroup = [ diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php index cb4d19279193a..f194f6e5f55c2 100644 --- a/tests/lib/User/ManagerTest.php +++ b/tests/lib/User/ManagerTest.php @@ -16,6 +16,7 @@ use OCP\ICacheFactory; use OCP\IConfig; use OCP\IUser; +use OCP\IUserManager; use Psr\Log\LoggerInterface; use Test\TestCase; @@ -579,7 +580,7 @@ public function testCountUsersTwoBackends(): void { } public function testCountUsersOnlyDisabled(): void { - $manager = \OC::$server->getUserManager(); + $manager = \OCP\Server::get(IUserManager::class); // count other users in the db before adding our own $countBefore = $manager->countDisabledUsers(); @@ -604,7 +605,7 @@ public function testCountUsersOnlyDisabled(): void { } public function testCountUsersOnlySeen(): void { - $manager = \OC::$server->getUserManager(); + $manager = \OCP\Server::get(IUserManager::class); // count other users in the db before adding our own $countBefore = $manager->countSeenUsers(); @@ -630,7 +631,7 @@ public function testCountUsersOnlySeen(): void { } public function testCallForSeenUsers(): void { - $manager = \OC::$server->getUserManager(); + $manager = \OCP\Server::get(IUserManager::class); // count other users in the db before adding our own $count = 0; $function = function (IUser $user) use (&$count) { @@ -664,7 +665,7 @@ public function testCallForSeenUsers(): void { } public function testRecentlyActive(): void { - $manager = \OC::$server->getUserManager(); + $manager = \OCP\Server::get(IUserManager::class); $config = \OC::$server->get(IConfig::class); // Create some users