Skip to content

Commit

Permalink
Merge pull request #35822 from owncloud/bugfix/not-load-groups-if-not…
Browse files Browse the repository at this point in the history
…-necessary

Bugfix/not load groups if not necessary
  • Loading branch information
DeepDiver1975 authored Jul 16, 2019
2 parents 42649c6 + 11106ea commit 806010c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,17 @@ public static function setupFS($user = '') {
if (!\is_array($readOnlyGroups)) {
$readOnlyGroups = [];
}

$userGroups = \array_keys(
\OC::$server->getGroupManager()->getUserIdGroups($user)
);

$readOnlyGroupMemberships = \array_intersect(
$readOnlyGroups,
$userGroups
);
$readOnlyGroupMemberships = [];
if ($readOnlyGroups) {
$userGroups = \array_keys(
\OC::$server->getGroupManager()->getUserIdGroups($user)
);

$readOnlyGroupMemberships = \array_intersect(
$readOnlyGroups,
$userGroups
);
}
}

if ($isGuest === '1' || !empty($readOnlyGroupMemberships)) {
Expand Down

0 comments on commit 806010c

Please sign in to comment.