Sfoglia il codice sorgente

fix: Also cleanup orphaned shares user cannot be found anymore

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v28.0.0rc1
Julius Härtl 7 mesi fa
parent
commit
9677ca062e
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6
    1
      apps/files_sharing/lib/OrphanHelper.php

+ 6
- 1
apps/files_sharing/lib/OrphanHelper.php Vedi File

@@ -23,6 +23,7 @@ declare(strict_types=1);

namespace OCA\Files_Sharing;

use OC\User\NoUserException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\IRootFolder;
use OCP\IDBConnection;
@@ -40,7 +41,11 @@ class OrphanHelper {
}

public function isShareValid(string $owner, int $fileId): bool {
$userFolder = $this->rootFolder->getUserFolder($owner);
try {
$userFolder = $this->rootFolder->getUserFolder($owner);
} catch (NoUserException $e) {
return false;
}
$nodes = $userFolder->getById($fileId);
return count($nodes) > 0;
}

Loading…
Annulla
Salva