aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/SubAdmin.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-02 15:21:35 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-08 17:13:49 +0100
commit00122fa02704c2e7dc02fde172472167cf3ad42b (patch)
treedb0e8bbc472a41bd3cbaba68d8054f57b7b63aca /lib/private/SubAdmin.php
parentcb2fbdd214ddda422fb7a57f5779ca450b6a0411 (diff)
downloadnextcloud-server-00122fa02704c2e7dc02fde172472167cf3ad42b.tar.gz
nextcloud-server-00122fa02704c2e7dc02fde172472167cf3ad42b.zip
Use group displayNames in users list
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/SubAdmin.php')
-rw-r--r--lib/private/SubAdmin.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php
index cd16d07e43d..44d79d8994e 100644
--- a/lib/private/SubAdmin.php
+++ b/lib/private/SubAdmin.php
@@ -62,7 +62,7 @@ class SubAdmin extends PublicEmitter {
$this->post_deleteUser($user);
});
$this->groupManager->listen('\OC\Group', 'postDelete', function($group) {
- $this->post_deleteGroup($group);
+ $this->post_deleteGroup($group);
});
}
@@ -123,7 +123,7 @@ class SubAdmin extends PublicEmitter {
while($row = $result->fetch()) {
$group = $this->groupManager->get($row['gid']);
if(!is_null($group)) {
- $groups[] = $group;
+ $groups[$group->getGID()] = $group;
}
}
$result->closeCursor();
@@ -132,6 +132,17 @@ class SubAdmin extends PublicEmitter {
}
/**
+ * get an array of groupid and displayName for a user
+ * @param IUser $user
+ * @return array ['displayName' => displayname]
+ */
+ public function getSubAdminsGroupsName(IUser $user) {
+ return array_map(function($group) {
+ return array('displayName' => $group->getDisplayName());
+ }, $this->getSubAdminsGroups($user));
+ }
+
+ /**
* get SubAdmins of a group
* @param IGroup $group the group
* @return IUser[]
@@ -185,7 +196,7 @@ class SubAdmin extends PublicEmitter {
/**
* checks if a user is a SubAdmin of a group
- * @param IUser $user
+ * @param IUser $user
* @param IGroup $group
* @return bool
*/
@@ -210,7 +221,7 @@ class SubAdmin extends PublicEmitter {
/**
* checks if a user is a SubAdmin
- * @param IUser $user
+ * @param IUser $user
* @return bool
*/
public function isSubAdmin(IUser $user) {