Skip to content

Commit

Permalink
Merge branch 'nextcloud-12' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Klingele committed May 11, 2017
2 parents b6e2d34 + c687720 commit 9e84b8a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions user/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ private function getDisplayName() {
private function getGroups() {
$this->requireLogin();

// TODO(leon): This looks like a private API.
return \OC_Group::getUserGroups($this->getUserId());
if (class_exists('\OC_Group', true)) {
// Nextcloud <= 11, ownCloud
return \OC_Group::getUserGroups($this->getUserId());
}
// Nextcloud >= 12
$groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser());
return array_map(function ($group) {
return $group->getGID();
}, $groups);
}

private function getAdministeredGroups() {

This comment has been minimized.

Copy link
@meenu727

meenu727 Sep 19, 2019

Please can you share full path of user/user.php because I don't found this file in nextcloud 16

Expand Down

0 comments on commit 9e84b8a

Please sign in to comment.