summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/group.php2
-rw-r--r--lib/group/backend.php2
-rw-r--r--lib/group/database.php8
-rw-r--r--lib/group/dummy.php2
-rw-r--r--lib/group/example.php2
-rw-r--r--lib/group/interface.php2
-rw-r--r--lib/public/user.php2
-rw-r--r--lib/user/backend.php2
-rw-r--r--lib/user/database.php8
-rw-r--r--lib/user/dummy.php2
-rw-r--r--lib/user/interface.php2
11 files changed, 21 insertions, 13 deletions
diff --git a/lib/group.php b/lib/group.php
index a3bdbf9e003..e47b770f597 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -237,7 +237,7 @@ class OC_Group {
*
* Returns a list with all groups
*/
- public static function getGroups($search = '', $limit = 10, $offset = 0) {
+ public static function getGroups($search = '', $limit = -1, $offset = 0) {
$groups = array();
foreach (self::$_usedBackends as $backend) {
$groups = array_merge($backend->getGroups($search, $limit, $offset), $groups);
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
diff --git a/lib/public/user.php b/lib/public/user.php
index 178d1dddd36..2fa599488a7 100644
--- a/lib/public/user.php
+++ b/lib/public/user.php
@@ -51,7 +51,7 @@ class User {
*
* Get a list of all users.
*/
- public static function getUsers($search = '', $limit = 10, $offset = 0) {
+ public static function getUsers($search = '', $limit = -1, $offset = 0) {
return \OC_USER::getUsers();
}
diff --git a/lib/user/backend.php b/lib/user/backend.php
index ff00ef08f6c..f67908cdac0 100644
--- a/lib/user/backend.php
+++ b/lib/user/backend.php
@@ -97,7 +97,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
*
* Get a list of all users.
*/
- public function getUsers($search = '', $limit = 10, $offset = 0) {
+ public function getUsers($search = '', $limit = -1, $offset = 0) {
return array();
}
diff --git a/lib/user/database.php b/lib/user/database.php
index 968814d9d57..1deed517610 100644
--- a/lib/user/database.php
+++ b/lib/user/database.php
@@ -154,8 +154,12 @@ class OC_User_Database extends OC_User_Backend {
*
* Get a list of all users.
*/
- public function getUsers($search = '', $limit = 10, $offset = 0) {
- $query = OC_DB::prepare('SELECT uid FROM *PREFIX*users WHERE uid LIKE ? LIMIT '.$limit.' OFFSET '.$offset);
+ public function getUsers($search = '', $limit = -1, $offset = 0) {
+ if ($limit == -1) {
+ $query = OC_DB::prepare('SELECT uid FROM *PREFIX*users WHERE uid LIKE ?');
+ } else {
+ $query = OC_DB::prepare('SELECT uid FROM *PREFIX*users WHERE uid LIKE ? LIMIT '.$limit.' OFFSET '.$offset);
+ }
$result = $query->execute(array($search.'%'));
$users = array();
while ($row = $result->fetchRow()) {
diff --git a/lib/user/dummy.php b/lib/user/dummy.php
index a946d4e6214..da3edfb2df4 100644
--- a/lib/user/dummy.php
+++ b/lib/user/dummy.php
@@ -100,7 +100,7 @@ class OC_User_Dummy extends OC_User_Backend {
*
* Get a list of all users.
*/
- public function getUsers(){
+ public function getUsers($search = '', $limit = -1, $offset = 0) {
return array_keys($this->users);
}
diff --git a/lib/user/interface.php b/lib/user/interface.php
index b3286cd2f9e..a4903898fb1 100644
--- a/lib/user/interface.php
+++ b/lib/user/interface.php
@@ -48,7 +48,7 @@ interface OC_User_Interface {
*
* Get a list of all users.
*/
- public function getUsers($search = '', $limit = 10, $offset = 0);
+ public function getUsers($search = '', $limit = -1, $offset = 0);
/**
* @brief check if a user exists