[Pkg-owncloud-commits] [owncloud] 05/18: use the correct user if we update the share table
David Prévot
taffit at moszumanska.debian.org
Sat Sep 19 14:16:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 3b30dd43940e223ae5c68ddf764e3a301a7e42ed
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Fri Jul 3 15:58:52 2015 +0200
use the correct user if we update the share table
---
apps/files_sharing/lib/sharedmount.php | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php
index 7b7a465..b101aac 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list