diff options
Diffstat (limited to 'apps/files_external/ajax/addMountPoint.php')
-rw-r--r-- | apps/files_external/ajax/addMountPoint.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/files_external/ajax/addMountPoint.php b/apps/files_external/ajax/addMountPoint.php index 9100d47db3a..4903120c2a8 100644 --- a/apps/files_external/ajax/addMountPoint.php +++ b/apps/files_external/ajax/addMountPoint.php @@ -10,10 +10,17 @@ if ($_POST['isPersonal'] == 'true') { OCP\JSON::checkAdminUser(); $isPersonal = false; } -$status = OC_Mount_Config::addMountPoint($_POST['mountPoint'], - $_POST['class'], - $_POST['classOptions'], - $_POST['mountType'], - $_POST['applicable'], - $isPersonal); + +$mountPoint = $_POST['mountPoint']; +$oldMountPoint = $_POST['oldMountPoint']; +$class = $_POST['class']; +$options = $_POST['classOptions']; +$type = $_POST['mountType']; +$applicable = $_POST['applicable']; + +if ($oldMountPoint and $oldMountPoint !== $mountPoint) { + OC_Mount_Config::removeMountPoint($oldMountPoint, $type, $applicable, $isPersonal); +} + +$status = OC_Mount_Config::addMountPoint($mountPoint, $class, $options, $type, $applicable, $isPersonal); OCP\JSON::success(array('data' => array('message' => $status))); |