Skip to content

Commit

Permalink
Keep track of the relative mountpoint for renaming/unmounting
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Nov 12, 2014
1 parent 7ac72e5 commit fcd26b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/files_sharing/lib/sharedmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ class SharedMount extends Mount implements MoveableMount {

protected $share;

/**
* @var string
*/
protected $relativeMountPoint;

public function __construct($storage, $mountpoint, $arguments = null, $loader = null) {
// first update the mount point before creating the parent
$newMountPoint = $this->verifyMountPoint($arguments['share'], $arguments['user']);
$absMountPoint = '/' . $arguments['user'] . '/files' . $newMountPoint;
$this->relativeMountPoint = $newMountPoint;
$this->share = $arguments['share'];
$arguments['owner'] = $this->share['uid_owner'];
$arguments['mountpoint'] = $absMountPoint;
Expand Down Expand Up @@ -130,6 +136,7 @@ protected function stripUserFilesPath($path) {
public function moveMount($target) {

$relTargetPath = $this->stripUserFilesPath($target);
$this->relativeMountPoint = $relTargetPath;
$share = $this->share;

$result = true;
Expand Down Expand Up @@ -180,7 +187,7 @@ public function unshareStorage() {
$result = $result && \OCP\Share::unshareFromSelf($share['item_type'], $share['file_target']);
}
}
$result = $result && \OCP\Share::unshareFromSelf($this->share['item_type'], $this->getStorage()->getMountPoint());
$result = $result && \OCP\Share::unshareFromSelf($this->share['item_type'], $this->relativeMountPoint);

return $result;
}
Expand Down

0 comments on commit fcd26b2

Please sign in to comment.