diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-21 13:30:41 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-21 13:30:41 +0200 |
commit | 2d691c2fb4f00558f4bac55fb9c6b23b85b416c5 (patch) | |
tree | 945f9952fece87ba050ba7d30b5f4bad0a3bfae4 /apps | |
parent | a35193c7043acbaa5157c6cafc78e7e71e00a1be (diff) | |
parent | 058d910f5e85ca71d20272d8ca89dc3caf64cef2 (diff) | |
download | nextcloud-server-2d691c2fb4f00558f4bac55fb9c6b23b85b416c5.tar.gz nextcloud-server-2d691c2fb4f00558f4bac55fb9c6b23b85b416c5.zip |
Merge pull request #17381 from owncloud/fix_sharing_add_to_group
[sharing] fix addToGroup hook
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/sharedmount.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php index fd672d0500c..2771e0415b0 100644 --- a/apps/files_sharing/lib/sharedmount.php +++ b/apps/files_sharing/lib/sharedmount.php @@ -46,12 +46,18 @@ class SharedMount extends MountPoint implements MoveableMount { */ private $recipientView; + /** + * @var string + */ + private $user; + public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { // first update the mount point before creating the parent $this->ownerPropagator = $arguments['propagator']; - $this->recipientView = new View('/' . $arguments['user'] . '/files'); + $this->user = $arguments['user']; + $this->recipientView = new View('/' . $this->user . '/files'); $newMountPoint = $this->verifyMountPoint($arguments['share']); - $absMountPoint = '/' . $arguments['user'] . '/files' . $newMountPoint; + $absMountPoint = '/' . $this->user . '/files' . $newMountPoint; $arguments['ownerView'] = new View('/' . $arguments['share']['uid_owner'] . '/files'); parent::__construct($storage, $absMountPoint, $arguments, $loader); } @@ -90,7 +96,7 @@ class SharedMount extends MountPoint implements MoveableMount { * @param array $share reference to the share which should be modified * @return bool */ - private static function updateFileTarget($newPath, &$share) { + private function updateFileTarget($newPath, &$share) { // if the user renames a mount point from a group share we need to create a new db entry // for the unique name if ($share['share_type'] === \OCP\Share::SHARE_TYPE_GROUP && empty($share['unique_name'])) { @@ -98,7 +104,7 @@ class SharedMount extends MountPoint implements MoveableMount { .' `share_type`, `share_with`, `uid_owner`, `permissions`, `stime`, `file_source`,' .' `file_target`, `token`, `parent`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)'); $arguments = array($share['item_type'], $share['item_source'], $share['item_target'], - 2, \OCP\User::getUser(), $share['uid_owner'], $share['permissions'], $share['stime'], $share['file_source'], + 2, $this->user, $share['uid_owner'], $share['permissions'], $share['stime'], $share['file_source'], $newPath, $share['token'], $share['id']); } else { // rename mount point |