summaryrefslogtreecommitdiffstats
path: root/lib/group.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/group.php')
-rw-r--r--lib/group.php65
1 files changed, 33 insertions, 32 deletions
diff --git a/lib/group.php b/lib/group.php
index 6afe1440030..88f0a2a032c 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -286,38 +286,39 @@ class OC_Group {
}
return $users;
}
-
- /**
- * @brief get a list of all display names in a group
- * @returns array with display names (value) and user ids(key)
- */
- public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- $displayNames=array();
- foreach(self::$_usedBackends as $backend) {
- $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);
- }
- return $displayNames;
+
+ /**
+ * @brief get a list of all display names in a group
+ * @returns array with display names (value) and user ids(key)
+ */
+ public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
+ $displayNames=array();
+ foreach(self::$_usedBackends as $backend) {
+ $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);
+ }
+ return $displayNames;
}
-
- /**
- * @brief get a list of all display names in several groups
- * @param array $gids
- * @param string $search
- * @param int $limit
- * @param int $offset
- * @return array with display names (Key) user ids (value)
- */
- public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
- $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);
- }
- return $displayNames;
+
+ /**
+ * @brief get a list of all display names in several groups
+ * @param array $gids
+ * @param string $search
+ * @param int $limit
+ * @param int $offset
+ * @return array with display names (Key) user ids (value)
+ */
+ public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
+ $displayNames = array();
+ foreach ($gids as $gid) {
+ // TODO Need to apply limits to groups as total
+ $diff = array_diff(
+ self::displayNamesInGroup($gid, $search, $limit, $offset),
+ $displayNames
+ );
+ if ($diff) {
+ $displayNames = array_merge($diff, $displayNames);
+ }
+ }
+ return $displayNames;
}
}