Skip to content

Commit

Permalink
Use array_map to determine sub admin groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Klingele committed May 11, 2017
1 parent 9e84b8a commit 8d1c1d7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions user/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,14 @@ private function getAdministeredGroups() {
return \OC_SubAdmin::getSubAdminsGroups($this->getUserId());
}
// Nextcloud 9
$subadmin = new \OC\SubAdmin(
$groups = (new \OC\SubAdmin(
\OC::$server->getUserManager(),
\OC::$server->getGroupManager(),
\OC::$server->getDatabaseConnection()
);
$ocgroups = $subadmin->getSubAdminsGroups($this->user);
$groups = array();
foreach ($ocgroups as $ocgroup) {
$groups[] = $ocgroup->getGID();
}
return $groups;
))->getSubAdminsGroups($this->user);
return array_map(function ($group) {
return $group->getGID();
}, $groups);
}

private function isAdmin() {
Expand Down

0 comments on commit 8d1c1d7

Please sign in to comment.