diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-30 20:20:46 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-30 20:20:46 -0400 |
commit | 2f1a990cadc5202dd20c3ec87e886685f6733595 (patch) | |
tree | 4e44165d0d87ad026f45b49a409f1bad87099ac7 /lib/group/database.php | |
parent | ed71343df8a3d35c2a0fe7d6c91778278f8d7dd1 (diff) | |
download | nextcloud-server-2f1a990cadc5202dd20c3ec87e886685f6733595.tar.gz nextcloud-server-2f1a990cadc5202dd20c3ec87e886685f6733595.zip |
Add search, limit, and offset parameters to getUsers() and getGroups()
Diffstat (limited to 'lib/group/database.php')
-rw-r--r-- | lib/group/database.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/group/database.php b/lib/group/database.php index 2770ec185c4..6314a127438 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -164,15 +164,13 @@ class OC_Group_Database extends OC_Group_Backend { * * Returns a list with all groups */ - public function getGroups(){ - $query = OC_DB::prepare( "SELECT gid FROM `*PREFIX*groups`" ); - $result = $query->execute(); - + public function getGroups($search = '', $limit = 10, $offset = 0) { + $query = OC_DB::prepare('SELECT gid FROM *PREFIX*groups WHERE gid LIKE ? LIMIT '.$limit.' OFFSET '.$offset); + $result = $query->execute(array($search.'%')); $groups = array(); - while( $row = $result->fetchRow()){ - $groups[] = $row["gid"]; + while ($row = $result->fetchRow()) { + $groups[] = $row['gid']; } - return $groups; } |