aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-10-02 09:43:35 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-10-02 09:43:35 +0200
commit6db51324fa5ecbd12728b1e86e0d4a7b860a92d4 (patch)
treecb50b786f3d2292c465c9b15428bc6158d92f139 /lib
parent74dcd84ee86fa6812f2d03a7004bf921c9ad43c1 (diff)
downloadnextcloud-server-6db51324fa5ecbd12728b1e86e0d4a7b860a92d4.tar.gz
nextcloud-server-6db51324fa5ecbd12728b1e86e0d4a7b860a92d4.zip
Fix DB usersInGroups fetching
* Follow the interface defaults * Only set limit or offset if they are properly set Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Group/Database.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php
index 7a5728b957d..4df70f143ba 100644
--- a/lib/private/Group/Database.php
+++ b/lib/private/Group/Database.php
@@ -322,7 +322,7 @@ class Database extends ABackend
* @param int $offset
* @return array an array of user ids
*/
- public function usersInGroup($gid, $search = '', $limit = null, $offset = null) {
+ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$this->fixDI();
$query = $this->dbConn->getQueryBuilder();
@@ -337,8 +337,13 @@ class Database extends ABackend
)));
}
- $query->setMaxResults($limit)
- ->setFirstResult($offset);
+ if ($limit !== -1) {
+ $query->setMaxResults($limit);
+ }
+ if ($offset !== 0) {
+ $query->setFirstResult($offset);
+ }
+
$result = $query->execute();
$users = [];