show "shared by ..." for share mount point
This commit is contained in:
parent
6b19482f3e
commit
4967435237
|
@ -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
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
|
@ -512,6 +515,14 @@ class Shared extends \OC\Files\Storage\Common {
|
|||
return ltrim($this->mountPoint, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
|
Loading…
Reference in New Issue