diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DAV/WorkspacePlugin.php | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index 764aa1f36..2f88f2d8d 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -97,38 +97,25 @@ class WorkspacePlugin extends ServerPlugin { // Only return the property for the parent node and ignore it for further in depth nodes if ($propFind->getDepth() === $this->server->getHTTPDepth()) { - $propFind->handle(self::WORKSPACE_PROPERTY, function () use ($node) { - /** @var Folder[] $nodes */ - $nodes = $this->rootFolder->getUserFolder($this->userId)->getById($node->getId()); - if (count($nodes) > 0) { + $owner = $this->userId ?? $node->getFileInfo()->getStorage()->getOwner(''); + /** @var Folder[] $nodes */ + $nodes = $this->rootFolder->getUserFolder($owner)->getById($node->getId()); + if (count($nodes) > 0) { + try { /** @var File $file */ - try { - $file = $this->workspaceService->getFile($nodes[0]); - if ($file instanceof File) { + $file = $this->workspaceService->getFile($nodes[0]); + if ($file instanceof File) { + $propFind->handle(self::WORKSPACE_PROPERTY, function () use ($file) { return $file->getContent(); - } - } catch (StorageNotAvailableException $e) { - // If a storage is not available we can for the propfind response assume that there is no rich workspace present + }); + $propFind->handle(self::WORKSPACE_FILE_PROPERTY, function () use ($file) { + return $file->getFileInfo()->getId(); + }); } + } catch (StorageNotAvailableException $e) { + // If a storage is not available we can for the propfind response assume that there is no rich workspace present } - return ''; - }); - $propFind->handle(self::WORKSPACE_FILE_PROPERTY, function () use ($node) { - /** @var Folder[] $nodes */ - $nodes = $this->rootFolder->getUserFolder($this->userId)->getById($node->getId()); - if (count($nodes) > 0) { - /** @var File $file */ - try { - $file = $this->workspaceService->getFile($nodes[0]); - if ($file instanceof File) { - return $file->getFileInfo()->getName(); - } - } catch (StorageNotAvailableException $e) { - // If a storage is not available we can for the propfind response assume that there is no rich workspace present - } - } - return ''; - }); + } } } } |