Skip to content

Commit 1bba7de

Browse files
authored
Merge pull request #21017 from nextcloud/enh/noid/clean-excluded-groups-list
Remove group from excluded_groups_list after delete
2 parents 73f5848 + 16da29c commit 1bba7de

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/private/Share20/Manager.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,19 @@ public function userDeleted($uid) {
15111511
public function groupDeleted($gid) {
15121512
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_GROUP);
15131513
$provider->groupDeleted($gid);
1514+
1515+
$excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
1516+
if ($excludedGroups === '') {
1517+
return;
1518+
}
1519+
1520+
$excludedGroups = json_decode($excludedGroups, true);
1521+
if (json_last_error() !== JSON_ERROR_NONE) {
1522+
return;
1523+
}
1524+
1525+
$excludedGroups = array_diff($excludedGroups, [$gid]);
1526+
$this->config->setAppValue('core', 'shareapi_exclude_groups_list', json_encode($excludedGroups));
15141527
}
15151528

15161529
/**

0 commit comments

Comments
 (0)