diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-04-08 16:37:34 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-04-23 12:54:25 +0200 |
commit | 496743523729b69e311c170a810182f95568fb7d (patch) | |
tree | 409a8114cbf6291247d0a390c2f0edea03d4747a /apps/files_sharing | |
parent | 6b19482f3e1d97aab63c6c870c53a27d5e5a8524 (diff) | |
download | nextcloud-server-496743523729b69e311c170a810182f95568fb7d.tar.gz nextcloud-server-496743523729b69e311c170a810182f95568fb7d.zip |
show "shared by ..." for share mount point
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/cache.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 4017b7ad64a..250c1e872e3 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -86,7 +86,9 @@ class Shared_Cache extends Cache { public function get($file) { if (is_string($file)) { if ($cache = $this->getSourceCache($file)) { - return $cache->get($this->files[$file]); + $data = $cache->get($this->files[$file]); + $data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom()); + return $data; } } else { // if we are at the root of the mount point we want to return the diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 3fa2540b604..f38f29635a2 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -32,6 +32,7 @@ class Shared extends \OC\Files\Storage\Common { private $type; // can be "file" or "folder" private $shareId; // share Id to identify the share in the database private $fileSource; // file cache ID of the shared item + private $sharedFrom; // the user who shared the file private $files = array(); public function __construct($arguments) { @@ -39,6 +40,7 @@ class Shared extends \OC\Files\Storage\Common { $this->type = $arguments['shareType']; $this->shareId = $arguments['shareId']; $this->fileSource = $arguments['fileSource']; + $this->sharedFrom = $arguments['sharedFrom']; } /** @@ -498,6 +500,7 @@ class Shared extends \OC\Files\Storage\Common { 'shareType' => $share['item_type'], 'shareId' => $share['id'], 'fileSource' => $share['file_source'], + 'sharedFrom' => $share['uid_owner'], ), $options['user_dir'] . '/' . $share['file_target']); } @@ -513,6 +516,14 @@ class Shared extends \OC\Files\Storage\Common { } /** + * @brief get the user who shared the file + * @return string + */ + public function getSharedFrom() { + return $this->sharedFrom; + } + + /** * @brief return share type, can be "file" or "folder" * @return string */ |