Skip to content

Commit

Permalink
Merge pull request #21017 from nextcloud/enh/noid/clean-excluded-grou…
Browse files Browse the repository at this point in the history
…ps-list

Remove group from excluded_groups_list after delete
  • Loading branch information
MorrisJobke authored May 18, 2020
2 parents 73f5848 + 16da29c commit 1bba7de
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,19 @@ public function userDeleted($uid) {
public function groupDeleted($gid) {
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP);
$provider->groupDeleted($gid);

$excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
if ($excludedGroups === '') {
return;
}

$excludedGroups = json_decode($excludedGroups, true);
if (json_last_error() !== JSON_ERROR_NONE) {
return;
}

$excludedGroups = array_diff($excludedGroups, [$gid]);
$this->config->setAppValue('core', 'shareapi_exclude_groups_list', json_encode($excludedGroups));
}

/**
Expand Down

0 comments on commit 1bba7de

Please sign in to comment.