Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Peijnik <speijnik@anexia-it.com>2014-07-11 09:12:04 +0400
committerArthur Schiwon <blizzz@owncloud.com>2014-07-16 14:23:26 +0400
commit4d74aa09bf7102a1104549b08c6bebe2382ec0cd (patch)
tree4f332cce50f89590ccd0f6a083e29fe0d4640398 /settings/users.php
parent7d8a8e78fa7afad6a004341b67cab19f7a4eccf8 (diff)
Port of #9584
Fixes #9583 lib/private/group/metadata.php: For subadmins also return an array of groups, indexed by their GIDs. settings/users.php: Convert array of arrays to array of GIDs before calling into OC_Group::displayNamesInGroups. Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com> Fix indentation. Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com> Renamed $grp to $group in foreach loop. Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com> Use is_null() instead of empty() when checking the return value of GroupManager::get(). Additionally, $grp was renamed to $group inside \OC\Group\MetaData::fetchGroups(). Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com> Updated code to reflect changes introduced to \OC\Group\MetaData. Now that fetchGroups() does not exist anymore and getGroups() is called directory, the 'groups' property does not exist anymore. Instead, we now generate that array on the fly and return it from getGroups. Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com>
Diffstat (limited to 'settings/users.php')
-rw-r--r--settings/users.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/settings/users.php b/settings/users.php
index 29a63a4496a..bc6c2ea7e7c 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -35,7 +35,14 @@ if($isAdmin) {
$accessibleUsers = OC_User::getDisplayNames('', 30);
$subadmins = OC_SubAdmin::getAllSubAdmins();
}else{
- $accessibleUsers = OC_Group::displayNamesInGroups($groups, '', 30);
+ /* Retrieve group IDs from $groups array, so we can pass that information into OC_Group::displayNamesInGroups() */
+ $gids = array();
+ foreach($groups as $group) {
+ if (isset($group['id'])) {
+ $gids[] = $group['id'];
+ }
+ }
+ $accessibleUsers = OC_Group::displayNamesInGroups($gids, '', 30);
$subadmins = false;
}