}
return $users;
}
+
+ /**\r
+ * @brief get a list of all display names in a group\r
+ * @returns array with display names (key) and user ids(value)\r
+ */\r
+ public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
+ $displayNames=array();\r
+ foreach(self::$_usedBackends as $backend) {\r
+ $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);\r
+ }\r
+ return $displayNames;\r
+ }
+
+ /**\r
+ * @brief get a list of all display names in several groups\r
+ * @param array $gids\r
+ * @param string $search\r
+ * @param int $limit\r
+ * @param int $offset\r
+ * @return array with display names (Key) user ids (value)\r
+ */\r
+ public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {\r
+ $displayNames = array();\r
+ foreach ($gids as $gid) {\r
+ // TODO Need to apply limits to groups as total\r
+ $displayNames = array_merge(array_diff(self::displayNamesInGroup($gid, $search, $limit, $offset), $displayNames), $displayNames);\r
+ }\r
+ return $displayNames;\r
+ }
}
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
return array();
}
+
+ /**\r
+ * @brief get a list of all display names in a group\r
+ * @param string $gid\r
+ * @param string $search\r
+ * @param int $limit\r
+ * @param int $offset\r
+ * @return array with display names (key) and user ids (value)\r
+ */\r
+ public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
+ $displayNames = '';\r
+ $users = $this->usersInGroup($gid, $search, $limit, $offset);\r
+ foreach ( $users as $user ) {\r
+ $DisplayNames[$user] = $user;\r
+ }\r
+ \r
+ return $DisplayNames;\r
+ }
}
/**\r
* @brief Get a list of all display names\r
- * @returns array with all display names and the correspondig uids\r
+ * @returns array with all display names (key) and the correspondig uids (value)\r
*\r
- * Get a list of all display names.\r
+ * Get a list of all display names and user ids.\r
*/\r
public static function getDisplayNames($search = '', $limit = null, $offset = null) {\r
return \OC_USER::getDisplayNames($search, $limit, $offset);\r
/**\r
* @brief Get a list of all users display name\r
- * @returns associative array with all display names and corresponding uids\r
+ * @returns associative array with all display names (key) and corresponding uids (value)\r
*\r
- * Get a list of all users.\r
+ * Get a list of all display names and user ids.\r
*/\r
public static function getDisplayNames($search = '', $limit = null, $offset = null) {\r
$displayNames = array();\r
/**\r
* @brief Get a list of all display names\r
- * @returns array with all displayNames and the correspondig uids\r
+ * @returns array with all displayNames (key) and the correspondig uids (value)\r
*\r
- * Get a list of all display names.\r
+ * Get a list of all display names and user ids.\r
*/\r
public function getDisplayNames($search = '', $limit = null, $offset = null) {\r
$displayNames = array();
$subadmins = OC_SubAdmin::getAllSubAdmins();
}else{
$accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
- $accessibleusers = OC_Group::usersInGroups($accessiblegroups, '', 30);
+ $accessibleusers = OC_Group::displayNamesInGroups($accessiblegroups, '', 30);
$subadmins = false;
}