diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-11 16:06:31 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-11 16:25:27 -0400 |
commit | 874f31b8d773cc0df3572c275d1ac42642a7f719 (patch) | |
tree | 89db1284bdd10cf570ec017a215c4ec273150e91 /lib/group | |
parent | 9d2ae5fa1f2feed1c3907747b3bccd1193cb2981 (diff) | |
download | nextcloud-server-874f31b8d773cc0df3572c275d1ac42642a7f719.tar.gz nextcloud-server-874f31b8d773cc0df3572c275d1ac42642a7f719.zip |
Make getting all users and groups the default
Diffstat (limited to 'lib/group')
-rw-r--r-- | lib/group/backend.php | 2 | ||||
-rw-r--r-- | lib/group/database.php | 8 | ||||
-rw-r--r-- | lib/group/dummy.php | 2 | ||||
-rw-r--r-- | lib/group/example.php | 2 | ||||
-rw-r--r-- | lib/group/interface.php | 2 |
5 files changed, 10 insertions, 6 deletions
diff --git a/lib/group/backend.php b/lib/group/backend.php index 3f2909caa15..7a7cebc726f 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -105,7 +105,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface { * * Returns a list with all groups */ - public function getGroups($search = '', $limit = 10, $offset = 0) { + public function getGroups($search = '', $limit = -1, $offset = 0) { return array(); } 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()) { diff --git a/lib/group/dummy.php b/lib/group/dummy.php index 1243891023f..092aa9beda8 100644 --- a/lib/group/dummy.php +++ b/lib/group/dummy.php @@ -141,7 +141,7 @@ class OC_Group_Dummy extends OC_Group_Backend { * * Returns a list with all groups */ - public function getGroups(){ + public function getGroups($search = '', $limit = -1, $offset = 0) { return array_keys($this->groups); } diff --git a/lib/group/example.php b/lib/group/example.php index 9c9ece5ac77..c33b435ca05 100644 --- a/lib/group/example.php +++ b/lib/group/example.php @@ -91,7 +91,7 @@ abstract class OC_Group_Example { * * Returns a list with all groups */ - abstract public static function getGroups(); + abstract public static function getGroups($search = '', $limit = -1, $offset = 0); /** * check if a group exists diff --git a/lib/group/interface.php b/lib/group/interface.php index 6e492e72748..f496d502df6 100644 --- a/lib/group/interface.php +++ b/lib/group/interface.php @@ -58,7 +58,7 @@ interface OC_Group_Interface { * * Returns a list with all groups */ - public function getGroups($search = '', $limit = 10, $offset = 0); + public function getGroups($search = '', $limit = -1, $offset = 0); /** * check if a group exists |