Fix the removeMount for personal mounts

This commit is contained in:
Robin Appelman 2014-05-22 01:53:33 +02:00
parent 4fbc991ea2
commit a66c2e6a47
2 changed files with 4 additions and 1 deletions

View File

@ -517,6 +517,7 @@ class OC_Mount_Config {
} else { } else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/'); $mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
} }
$mountPoint = \OC\Files\Filesystem::normalizePath($mountPoint);
$mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL); $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);
// Remove mount point // Remove mount point
unset($mountPoints[$mountType][$applicable][$mountPoint]); unset($mountPoints[$mountType][$applicable][$mountPoint]);

View File

@ -33,6 +33,8 @@ class PersonalMount extends Mount implements MoveableMount {
* @return bool * @return bool
*/ */
public function removeMount() { 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);
} }
} }