diff options
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 */ |