Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions lib/Controller/QueueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,17 @@ private function getFileSource(QueueFile $document, IRootFolder $rootFolder, Sto
if (empty($mounts)) {
throw new \Exception('Couldn\'t find any mounts for this storage');
}
$userId = $mounts[0]->getUser()->getUID();

try {
$file = $rootFolder->getUserFolder($userId)->getFirstNodeById($document->getFileId());
} catch (NotPermittedException $e) {
throw new \Exception('Not allowed to get user folder');
$file = null;
foreach ($mounts as $mount) {
$userId = $mount->getUser()->getUID();
try {
$file = $rootFolder->getUserFolder($userId)->getFirstNodeById($document->getFileId());
} catch (NotPermittedException $e) {
throw new \Exception('Not allowed to get user folder');
}
if ($file instanceof File) {
break;
}
}
if (!($file instanceof File)) {
throw new \Exception('File not found or not a file');
Expand Down