Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/user
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-12 00:06:31 +0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-12 00:25:27 +0400
commit874f31b8d773cc0df3572c275d1ac42642a7f719 (patch)
tree89db1284bdd10cf570ec017a215c4ec273150e91 /lib/user
parent9d2ae5fa1f2feed1c3907747b3bccd1193cb2981 (diff)
Make getting all users and groups the default
Diffstat (limited to 'lib/user')
-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
4 files changed, 9 insertions, 5 deletions
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