show suggestion to clean up possible invalid shares later

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-01-29 17:43:58 +01:00 committed by backportbot[bot]
parent cfc00aa2cd
commit 6ebb368265
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class RepairDavShares implements IRepairStep {
private $groupManager; private $groupManager;
/** @var LoggerInterface */ /** @var LoggerInterface */
private $logger; private $logger;
/** @var bool */
private $hintInvalidShares = false;
public function __construct( public function __construct(
IConfig $config, IConfig $config,
@ -88,6 +90,7 @@ class RepairDavShares implements IRepairStep {
|| !$this->groupManager->groupExists($gid) || !$this->groupManager->groupExists($gid)
|| ($gid !== $decodedGid && $this->groupManager->groupExists($decodedGid)) || ($gid !== $decodedGid && $this->groupManager->groupExists($decodedGid))
) { ) {
$this->hintInvalidShares = $this->hintInvalidShares || $gid !== $encodedGid;
continue; continue;
} }
@ -127,6 +130,9 @@ class RepairDavShares implements IRepairStep {
&& $this->repairUnencodedGroupShares() && $this->repairUnencodedGroupShares()
) { ) {
$output->info('Repaired DAV group shares'); $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.');
}
} }
} }
} }