diff options
Diffstat (limited to 'lib/group')
-rw-r--r-- | lib/group/backend.php | 2 | ||||
-rw-r--r-- | lib/group/database.php | 16 | ||||
-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, 14 insertions, 10 deletions
diff --git a/lib/group/backend.php b/lib/group/backend.php index 7a7cebc726f..4c7d09bcb16 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -122,7 +122,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface { * @brief get a list of all users in a group * @returns array with user ids */ - public function usersInGroup($gid){ + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { return array(); } diff --git a/lib/group/database.php b/lib/group/database.php index 669edc662cc..1cb4171f49f 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -182,12 +182,16 @@ class OC_Group_Database extends OC_Group_Backend { * @brief get a list of all users in a group * @returns array with user ids */ - public function usersInGroup($gid){ - $query=OC_DB::prepare('SELECT uid FROM *PREFIX*group_user WHERE gid=?'); - $users=array(); - $result=$query->execute(array($gid)); - while($row=$result->fetchRow()){ - $users[]=$row['uid']; + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { + if ($limit == -1) { + $query = OC_DB::prepare('SELECT uid FROM *PREFIX*group_user WHERE gid = ? AND uid LIKE ?'); + } else { + $query = OC_DB::prepare('SELECT uid FROM *PREFIX*group_user WHERE gid = ? AND uid LIKE ? LIMIT '.$limit.' OFFSET '.$offset); + } + $result = $query->execute(array($gid, $search.'%')); + $users = array(); + while ($row = $result->fetchRow()) { + $users[] = $row['uid']; } return $users; } diff --git a/lib/group/dummy.php b/lib/group/dummy.php index 092aa9beda8..51eca28f3f4 100644 --- a/lib/group/dummy.php +++ b/lib/group/dummy.php @@ -149,7 +149,7 @@ class OC_Group_Dummy extends OC_Group_Backend { * @brief get a list of all users in a group * @returns array with user ids */ - public function usersInGroup($gid){ + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { if(isset($this->groups[$gid])){ return $this->groups[$gid]; }else{ diff --git a/lib/group/example.php b/lib/group/example.php index c33b435ca05..76d12629763 100644 --- a/lib/group/example.php +++ b/lib/group/example.php @@ -104,6 +104,6 @@ abstract class OC_Group_Example { * @brief get a list of all users in a group * @returns array with user ids */ - abstract public static function usersInGroup($gid); + abstract public static function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); } diff --git a/lib/group/interface.php b/lib/group/interface.php index f496d502df6..12cc07a5374 100644 --- a/lib/group/interface.php +++ b/lib/group/interface.php @@ -71,6 +71,6 @@ interface OC_Group_Interface { * @brief get a list of all users in a group * @returns array with user ids */ - public function usersInGroup($gid); + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); }
\ No newline at end of file |