]> source.dussan.org Git - nextcloud-server.git/commitdiff
show suggestion to clean up possible invalid shares later
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 29 Jan 2021 16:43:58 +0000 (17:43 +0100)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 17 Feb 2021 14:59:50 +0000 (15:59 +0100)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Repair/RepairDavShares.php

index ff4c51484eb6f1d93512815fa4acfcf4e9fcd604..64104c1e28a59296443de827723c3f30efece853 100644 (file)
@@ -48,6 +48,8 @@ class RepairDavShares implements IRepairStep {
        private $groupManager;
        /** @var LoggerInterface */
        private $logger;
+       /** @var bool */
+       private $hintInvalidShares = false;
 
        public function __construct(
                IConfig $config,
@@ -88,6 +90,7 @@ class RepairDavShares implements IRepairStep {
                                || !$this->groupManager->groupExists($gid)
                                || ($gid !== $decodedGid && $this->groupManager->groupExists($decodedGid))
                        ) {
+                               $this->hintInvalidShares = $this->hintInvalidShares || $gid !== $encodedGid;
                                continue;
                        }
 
@@ -127,6 +130,9 @@ class RepairDavShares implements IRepairStep {
                        && $this->repairUnencodedGroupShares()
                ) {
                        $output->info('Repaired DAV group shares');
+                       if ($this->hintInvalidShares) {
+                               $output->info('Invalid shares might be left in the database, running "occ dav:remove-invalid-shares" can remove them.');
+                       }
                }
        }
 }