]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove group from excluded_groups_list after delete 21017/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Fri, 24 Jan 2020 15:34:07 +0000 (16:34 +0100)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 17 May 2020 13:15:06 +0000 (15:15 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Share20/Manager.php

index 004076db493ae1b9db2d93b7a37abfa987cf8905..36cbd511b8d8cc52590a59c8511a105d7c8dde50 100644 (file)
@@ -1511,6 +1511,19 @@ class Manager implements IManager {
        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));
        }
 
        /**