summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-04-24 17:14:11 +0200
committerGitHub <noreply@github.com>2023-04-24 17:14:11 +0200
commit6d9f785afbd7805597f366ae44412961130d21b2 (patch)
tree436022e962441256323d4d48ac4ac9e1675c3cc0 /core
parent2abefff2899952ea422d708fbda611f1695125fd (diff)
parentb89621e8da04f0365dcc53fff85b31e5d36aaac9 (diff)
downloadnextcloud-server-6d9f785afbd7805597f366ae44412961130d21b2.tar.gz
nextcloud-server-6d9f785afbd7805597f366ae44412961130d21b2.zip
Merge pull request #37622 from nextcloud/group-list-numeric-userid
fix output for group:list command with numeric user ids
Diffstat (limited to 'core')
-rw-r--r--core/Command/Group/ListCommand.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/Command/Group/ListCommand.php b/core/Command/Group/ListCommand.php
index 5100a00c60a..0285cc05dcd 100644
--- a/core/Command/Group/ListCommand.php
+++ b/core/Command/Group/ListCommand.php
@@ -76,6 +76,17 @@ class ListCommand extends Base {
}
/**
+ * @param IGroup $group
+ * @return string[]
+ */
+ public function usersForGroup(IGroup $group) {
+ $users = array_keys($group->getUsers());
+ return array_map(function ($userId) {
+ return (string)$userId;
+ }, $users);
+ }
+
+ /**
* @param IGroup[] $groups
* @return array
*/
@@ -88,12 +99,12 @@ class ListCommand extends Base {
$values = array_map(function (IGroup $group) {
return [
'backends' => $group->getBackendNames(),
- 'users' => array_keys($group->getUsers()),
+ 'users' => $this->usersForGroup($group),
];
}, $groups);
} else {
$values = array_map(function (IGroup $group) {
- return array_keys($group->getUsers());
+ return $this->usersForGroup($group);
}, $groups);
}
return array_combine($keys, $values);