From c463a32a3592583bcb723d5441b250588f4c46a1 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Tue, 29 Oct 2024 11:32:14 +0100 Subject: [PATCH] Test Signed-off-by: Benjamin Gaussorgues --- lib/private/User/Manager.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 7f5b06cc5f654..a49b2e34a936e 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -754,12 +754,12 @@ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string $connection = \OC::$server->getDatabaseConnection(); $queryBuilder = $connection->getQueryBuilder(); - $queryBuilder->select('pref_login.userid') + $queryBuilder->select('pref_login.*') ->from('preferences', 'pref_login') ->where($queryBuilder->expr()->eq('pref_login.appid', $queryBuilder->expr()->literal('login'))) ->andWhere($queryBuilder->expr()->eq('pref_login.configkey', $queryBuilder->expr()->literal('lastLogin'))) - ->setFirstResult($offset) - ->setMaxResults($limit) + //->setFirstResult($offset) + //->setMaxResults($limit) ; // Oracle don't want to run ORDER BY on CLOB column @@ -785,8 +785,11 @@ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string )); } + echo $queryBuilder->getSQL(), PHP_EOL; /** @var list */ - $list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_COLUMN); + //$list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_COLUMN); + $list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_ASSOC); + var_dump($list); return $list; }