diff options
author | Olivier Paroz <github@oparoz.com> | 2015-06-25 04:10:48 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-06-25 04:10:48 +0300 |
commit | e24b327de645fe874e09afb0ba7007911fdd8352 (patch) | |
tree | c2f047327a3123c6166114998f8e6b1cdf1f14df /environment | |
parent | 9c728d1c298b762f4ec1b127e26ecde9d25f36b8 (diff) |
A public link for a file will always download the file
Diffstat (limited to 'environment')
-rw-r--r-- | environment/environment.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/environment/environment.php b/environment/environment.php index d116b60a..35504273 100644 --- a/environment/environment.php +++ b/environment/environment.php @@ -57,6 +57,10 @@ class Environment { */ private $userManager; /** + * @var int + */ + private $sharedNodeId; + /** * @var IServerContainer */ private $serverContainer; @@ -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']; @@ -187,6 +191,15 @@ class Environment { } /** + * Returns the shared node + * + * @return File|Folder + */ + public function getSharedNode() { + return $this->getResourceFromId($this->sharedNodeId); + } + + /** * Returns the resource identified by the given ID * * @param int $resourceId |