Skip to content
Snippets Groups Projects
Commit a66c2e6a authored by Robin Appelman's avatar Robin Appelman
Browse files

Fix the removeMount for personal mounts

parent 4fbc991e
Branches
No related tags found
No related merge requests found
......@@ -517,6 +517,7 @@ class OC_Mount_Config {
} else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
}
$mountPoint = \OC\Files\Filesystem::normalizePath($mountPoint);
$mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);
// Remove mount point
unset($mountPoints[$mountType][$applicable][$mountPoint]);
......
......@@ -33,6 +33,8 @@ class PersonalMount extends Mount implements MoveableMount {
* @return bool
*/
public function removeMount() {
return \OC_Mount_Config::removeMountPoint($this->mountPoint, \OC_Mount_Config::MOUNT_TYPE_USER, \OCP\User::getUser(), true);
$user = \OCP\User::getUser();
$relativeMountPoint = substr($this->getMountPoint(), strlen('/' . $user . '/files/'));
return \OC_Mount_Config::removeMountPoint($relativeMountPoint, \OC_Mount_Config::MOUNT_TYPE_USER, $user , true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment