aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/cache.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-04-04 18:32:49 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-04-23 12:54:24 +0200
commita02fb3722bae6655ffdd5b0e6c522331612c255b (patch)
treee53fd2d97ffe0f413b04f2c45bc3688f7ebeb75f /apps/files_sharing/lib/cache.php
parent72bbb9ca20498eba18d6b6a31ed1de2306f90faf (diff)
downloadnextcloud-server-a02fb3722bae6655ffdd5b0e6c522331612c255b.tar.gz
nextcloud-server-a02fb3722bae6655ffdd5b0e6c522331612c255b.zip
user should be able to rename/delete shared files if the owner allowed it
Diffstat (limited to 'apps/files_sharing/lib/cache.php')
-rw-r--r--apps/files_sharing/lib/cache.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index becd436f798..4017b7ad64a 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -89,6 +89,12 @@ class Shared_Cache extends Cache {
return $cache->get($this->files[$file]);
}
} else {
+ // if we are at the root of the mount point we want to return the
+ // cache information for the source item
+ if (!is_int($file) || $file === 0) {
+ $file = $this->storage->getSourceId();
+ $mountPoint = $this->storage->getMountPoint();
+ }
$query = \OC_DB::prepare(
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
. ' `size`, `mtime`, `encrypted`, `unencrypted_size`'
@@ -110,6 +116,9 @@ class Shared_Cache extends Cache {
} else {
$data['size'] = (int)$data['size'];
}
+ if (isset($mountPoint)) {
+ $data['path'] = 'files/' . $mountPoint;
+ }
return $data;
}
return false;