Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Gaussorgues <[email protected]>
  • Loading branch information
Altahrim committed Oct 29, 2024
1 parent 2895767 commit c463a32
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -785,8 +785,11 @@ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string
));
}

echo $queryBuilder->getSQL(), PHP_EOL;
/** @var list<string> */
$list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_COLUMN);
//$list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_COLUMN);
$list = $queryBuilder->executeQuery()->fetchAll(\PDO::FETCH_ASSOC);
var_dump($list);

Check failure on line 792 in lib/private/User/Manager.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

ForbiddenCode

lib/private/User/Manager.php:792:3: ForbiddenCode: Unsafe var_dump (see https://psalm.dev/002)

return $list;
}
Expand Down

0 comments on commit c463a32

Please sign in to comment.