summaryrefslogtreecommitdiffstats
path: root/lib/group/database.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/group/database.php')
-rw-r--r--lib/group/database.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/group/database.php b/lib/group/database.php
index 6314a127438..669edc662cc 100644
--- a/lib/group/database.php
+++ b/lib/group/database.php
@@ -164,8 +164,12 @@ class OC_Group_Database extends OC_Group_Backend {
*
* Returns a list with all groups
*/
- public function getGroups($search = '', $limit = 10, $offset = 0) {
- $query = OC_DB::prepare('SELECT gid FROM *PREFIX*groups WHERE gid LIKE ? LIMIT '.$limit.' OFFSET '.$offset);
+ public function getGroups($search = '', $limit = -1, $offset = 0) {
+ if ($limit == -1) {
+ $query = OC_DB::prepare('SELECT gid FROM *PREFIX*groups WHERE gid LIKE ?');
+ } else {
+ $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()) {