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-08-06 03:44:19 +0300
committerOlivier Paroz <github@oparoz.com>2015-08-06 03:45:06 +0300
commit8bcba705e317bc163d5ba0984acb1235edba3ff3 (patch)
tree670451340293963dac5480668c4cd37aadfcd996 /environment
parent2913af616df6559f7bd52fcdc9ba3456e09ebfcf (diff)
More integration tests for Environment
Diffstat (limited to 'environment')
-rw-r--r--environment/environment.php29
1 files changed, 14 insertions, 15 deletions
diff --git a/environment/environment.php b/environment/environment.php
index 2cf642c0..d9569096 100644
--- a/environment/environment.php
+++ b/environment/environment.php
@@ -86,7 +86,7 @@ class Environment {
/**
* @var string
*/
- private $shareWith;
+ private $sharePassword;
/***
* Constructor
@@ -134,7 +134,7 @@ class Environment {
$this->folderName = $linkItem['file_target'];
$this->userId = $rootLinkItem['uid_owner'];
- $this->shareWith = $linkItem['share_with'];
+ $this->sharePassword = $linkItem['share_with'];
}
/**
@@ -149,26 +149,25 @@ class Environment {
}
/**
- * Returns the resource located at the given path
- *
- * The path starts from the user's files folder because we'll query that folder to get the
- * information we need. The resource is either a File or a Folder
+ * Returns the Node based on a path starting from the virtual root
*
* @param string $subPath
*
* @return File|Folder
*/
- public function getResourceFromPath($subPath) {
+ public function getNodeFromVirtualRoot($subPath) {
$relativePath = $this->getRelativePath($this->fromRootToFolder);
$path = $relativePath . '/' . $subPath;
- $node = $this->getNode($path);
+ $node = $this->getNodeFromUserFolder($path);
return $this->getResourceFromId($node->getId());
}
/**
- * Returns the Node based on the current user's files folder and a given
- * path
+ * Returns the Node based on a path starting from the files' owner user folder
+ *
+ * When logged in, this is the current user's user folder
+ * When visiting a link, this is the sharer's user folder
*
* @param string $path
*
@@ -176,7 +175,7 @@ class Environment {
*
* @throws EnvironmentException
*/
- public function getNode($path) {
+ public function getNodeFromUserFolder($path) {
$node = false;
$folder = $this->userFolder;
if ($folder === null) {
@@ -279,12 +278,12 @@ class Environment {
}
/**
- * Returns if the share is protected (share_with === true)
+ * Returns the password for the share, if there is one
*
- * @return string
+ * @return string|null
*/
- public function isShareProtected() {
- return $this->shareWith;
+ public function getSharePassword() {
+ return $this->sharePassword;
}
/**