diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/group.php | 15 | ||||
-rw-r--r-- | lib/group/database.php | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/group.php b/lib/group.php index 6afe1440030..8c06ddc0fd0 100644 --- a/lib/group.php +++ b/lib/group.php @@ -308,15 +308,16 @@ class OC_Group { * @return array with display names (Key) user ids (value)
*/
public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
- $displayNames = array();
+ $displayNames = array(); foreach ($gids as $gid) {
// TODO Need to apply limits to groups as total
- $displayNames = array_merge( - array_diff( - self::displayNamesInGroup($gid, $search, $limit, $offset), - $displayNames - ), - $displayNames); + $diff = array_diff( + self::displayNamesInGroup($gid, $search, $limit, $offset), + $displayNames + ); + if ($diff) { + $displayNames = array_merge($diff, $displayNames); + } }
return $displayNames;
} diff --git a/lib/group/database.php b/lib/group/database.php index 8816dd8169c..93dc05c53a1 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -225,7 +225,7 @@ class OC_Group_Database extends OC_Group_Backend { $stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname`' .' FROM `*PREFIX*users`' .' INNER JOIN `*PREFIX*group_user` ON `*PREFIX*group_user`.`uid` = `*PREFIX*users`.`uid`' - .' WHERE `gid` = ? AND `*PREFIX*group_user.uid` LIKE ?', + .' WHERE `gid` = ? AND `*PREFIX*group_user`.`uid` LIKE ?', $limit, $offset); $result = $stmt->execute(array($gid, $search.'%'));
|