Make getting all users and groups the default
This commit is contained in:
parent
9d2ae5fa1f
commit
874f31b8d7
|
@ -237,7 +237,7 @@ class OC_Group {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* 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();
|
$groups = array();
|
||||||
foreach (self::$_usedBackends as $backend) {
|
foreach (self::$_usedBackends as $backend) {
|
||||||
$groups = array_merge($backend->getGroups($search, $limit, $offset), $groups);
|
$groups = array_merge($backend->getGroups($search, $limit, $offset), $groups);
|
||||||
|
|
|
@ -105,7 +105,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* Returns a list with all groups
|
||||||
*/
|
*/
|
||||||
public function getGroups($search = '', $limit = 10, $offset = 0) {
|
public function getGroups($search = '', $limit = -1, $offset = 0) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,8 +164,12 @@ class OC_Group_Database extends OC_Group_Backend {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* Returns a list with all groups
|
||||||
*/
|
*/
|
||||||
public function getGroups($search = '', $limit = 10, $offset = 0) {
|
public function getGroups($search = '', $limit = -1, $offset = 0) {
|
||||||
$query = OC_DB::prepare('SELECT gid FROM *PREFIX*groups WHERE gid LIKE ? LIMIT '.$limit.' OFFSET '.$offset);
|
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.'%'));
|
$result = $query->execute(array($search.'%'));
|
||||||
$groups = array();
|
$groups = array();
|
||||||
while ($row = $result->fetchRow()) {
|
while ($row = $result->fetchRow()) {
|
||||||
|
|
|
@ -141,7 +141,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* Returns a list with all groups
|
||||||
*/
|
*/
|
||||||
public function getGroups(){
|
public function getGroups($search = '', $limit = -1, $offset = 0) {
|
||||||
return array_keys($this->groups);
|
return array_keys($this->groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ abstract class OC_Group_Example {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* 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
|
* check if a group exists
|
||||||
|
|
|
@ -58,7 +58,7 @@ interface OC_Group_Interface {
|
||||||
*
|
*
|
||||||
* Returns a list with all groups
|
* 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
|
* check if a group exists
|
||||||
|
|
|
@ -51,7 +51,7 @@ class User {
|
||||||
*
|
*
|
||||||
* Get a list of all users.
|
* 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();
|
return \OC_USER::getUsers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
|
||||||
*
|
*
|
||||||
* Get a list of all users.
|
* Get a list of all users.
|
||||||
*/
|
*/
|
||||||
public function getUsers($search = '', $limit = 10, $offset = 0) {
|
public function getUsers($search = '', $limit = -1, $offset = 0) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,8 +154,12 @@ class OC_User_Database extends OC_User_Backend {
|
||||||
*
|
*
|
||||||
* Get a list of all users.
|
* Get a list of all users.
|
||||||
*/
|
*/
|
||||||
public function getUsers($search = '', $limit = 10, $offset = 0) {
|
public function getUsers($search = '', $limit = -1, $offset = 0) {
|
||||||
$query = OC_DB::prepare('SELECT uid FROM *PREFIX*users WHERE uid LIKE ? LIMIT '.$limit.' OFFSET '.$offset);
|
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.'%'));
|
$result = $query->execute(array($search.'%'));
|
||||||
$users = array();
|
$users = array();
|
||||||
while ($row = $result->fetchRow()) {
|
while ($row = $result->fetchRow()) {
|
||||||
|
|
|
@ -100,7 +100,7 @@ class OC_User_Dummy extends OC_User_Backend {
|
||||||
*
|
*
|
||||||
* Get a list of all users.
|
* Get a list of all users.
|
||||||
*/
|
*/
|
||||||
public function getUsers(){
|
public function getUsers($search = '', $limit = -1, $offset = 0) {
|
||||||
return array_keys($this->users);
|
return array_keys($this->users);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ interface OC_User_Interface {
|
||||||
*
|
*
|
||||||
* Get a list of all users.
|
* 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
|
* @brief check if a user exists
|
||||||
|
|
Loading…
Reference in New Issue