]> source.dussan.org Git - nextcloud-server.git/commitdiff
More verbose output for repair share ownership cmd
authorVincent Petry <vincent@nextcloud.com>
Thu, 29 Sep 2022 19:23:45 +0000 (21:23 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Tue, 8 Nov 2022 22:38:33 +0000 (22:38 +0000)
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
core/Command/Maintenance/RepairShareOwnership.php

index 351f2b9b0edea525807862a7fd426deb6c4d9645..1175ff469b70aaaa7af5c835708da36f743d0cdd 100644 (file)
@@ -92,7 +92,7 @@ class RepairShareOwnership extends Command {
        protected function repairWrongShareOwnershipForUser(IUser $user, bool $dryRun = true): array {
                $qb = $this->dbConnection->getQueryBuilder();
                $brokenShare = $qb
-                       ->select('s.id', 'm.user_id', 's.uid_owner', 's.uid_initiator', 's.share_with', 's.share_type')
+                       ->select('s.id', 'm.user_id', 's.uid_owner', 's.uid_initiator', 's.share_with', 's.share_type', 's.file_target')
                        ->from('share', 's')
                        ->join('s', 'filecache', 'f', $qb->expr()->eq('s.item_source', $qb->expr()->castColumn('f.fileid', IQueryBuilder::PARAM_STR)))
                        ->join('s', 'mounts', 'm', $qb->expr()->eq('f.storage', 'm.storage_id'))
@@ -107,12 +107,13 @@ class RepairShareOwnership extends Command {
                foreach ($brokenShare as $queryResult) {
                        $shareId = (int) $queryResult['id'];
                        $shareType = (int) $queryResult['share_type'];
+                       $fileTarget = $queryResult['file_target'];
                        $initiator = $queryResult['uid_initiator'];
                        $receiver = $queryResult['share_with'];
                        $owner = $queryResult['uid_owner'];
                        $mountOwner = $queryResult['user_id'];
 
-                       $found[] = "Found share from $initiator to $receiver, owned by $owner, that should be owned by $mountOwner";
+                       $found[] = "Found share with id $shareId from \"$initiator\" to \"$receiver\" (target mount \"$fileTarget\"), owned by \"$owner\", that should be owned by \"$mountOwner\"";
 
                        if ($dryRun) {
                                continue;