From e24b327de645fe874e09afb0ba7007911fdd8352 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Thu, 25 Jun 2015 03:10:48 +0200 Subject: A public link for a file will always download the file --- environment/environment.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'environment') diff --git a/environment/environment.php b/environment/environment.php index d116b60a..35504273 100644 --- a/environment/environment.php +++ b/environment/environment.php @@ -56,6 +56,10 @@ class Environment { * @var IUserManager */ private $userManager; + /** + * @var int + */ + private $sharedNodeId; /** * @var IServerContainer */ @@ -122,8 +126,8 @@ class Environment { $this->userFolder = $this->setupFilesystem($origShareOwner); // This is actually the node ID - $fileSource = $linkItem['file_source']; - $this->fromRootToFolder = $this->buildFromRootToFolder($fileSource); + $this->sharedNodeId = $linkItem['file_source']; + $this->fromRootToFolder = $this->buildFromRootToFolder($this->sharedNodeId); $this->folderName = $linkItem['file_target']; $this->userId = $rootLinkItem['uid_owner']; @@ -186,6 +190,15 @@ class Environment { return $node; } + /** + * Returns the shared node + * + * @return File|Folder + */ + public function getSharedNode() { + return $this->getResourceFromId($this->sharedNodeId); + } + /** * Returns the resource identified by the given ID * -- cgit v1.2.3