Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-06-29 18:18:43 +0300
committerOlivier Paroz <github@oparoz.com>2015-06-29 18:18:43 +0300
commit8a8baf42ec3205991b23b2a720977faf57603936 (patch)
treead9550239749bcec684c0c1452d2ac6d157b3551 /environment
parent01d2f29a4c13b516abb8450d85392c96e34196dd (diff)
Re-enable features on public spaces
Fixes #195
Diffstat (limited to 'environment')
-rw-r--r--environment/environment.php39
1 files changed, 30 insertions, 9 deletions
diff --git a/environment/environment.php b/environment/environment.php
index 35504273..633a9e07 100644
--- a/environment/environment.php
+++ b/environment/environment.php
@@ -191,15 +191,6 @@ 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
@@ -218,6 +209,36 @@ class Environment {
}
/**
+ * Returns the shared node
+ *
+ * @return File|Folder
+ */
+ public function getSharedNode() {
+ return $this->getResourceFromId($this->sharedNodeId);
+ }
+
+ /**
+ * Returns the virtual root where the user lands after logging in or when following a link
+ *
+ * @return Folder
+ *
+ * @throws EnvironmentException
+ */
+ public function getVirtualRootFolder() {
+ $rootFolder = $this->userFolder;
+ if (!empty($this->sharedNodeId)) {
+ $node = $this->getResourceFromId($this->sharedNodeId);
+ if ($node->getType() === 'dir') {
+ $rootFolder = $node;
+ } else {
+ $this->logAndThrowNotFound($node->getPath() . ' is not a folder');
+ }
+ }
+
+ return $rootFolder;
+ }
+
+ /**
* Returns the userId of the currently logged-in user or the sharer
*
* @return string