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)));
OC.MountConfig={
saveStorage:function(tr, callback) {
var mountPoint = $(tr).find('.mountPoint input').val();
+ var oldMountPoint = $(tr).find('.mountPoint input').data('mountpoint');
if (mountPoint == '') {
return false;
}
classOptions: classOptions,
mountType: mountType,
applicable: applicable,
- isPersonal: isPersonal
+ isPersonal: isPersonal,
+ oldMountPoint: oldMountPoint
},
success: function(result) {
+ $(tr).find('.mountPoint input').data('mountpoint', mountPoint);
status = updateStatus(statusSpan, result);
if (callback) {
callback(status);
classOptions: classOptions,
mountType: mountType,
applicable: applicable,
- isPersonal: isPersonal
+ isPersonal: isPersonal,
+ oldMountPoint: oldMountPoint
},
success: function(result) {
+ $(tr).find('.mountPoint input').data('mountpoint', mountPoint);
status = updateStatus(statusSpan, result);
if (callback) {
callback(status);
</td>
<td class="mountPoint"><input type="text" name="mountPoint"
value="<?php p(isset($mount['mountpoint']) ? $mount['mountpoint'] : ''); ?>"
+ data-mountpoint="<?php p(isset($mount['mountpoint']) ? $mount['mountpoint'] : ''); ?>"
placeholder="<?php p($l->t('Folder name')); ?>" /></td>
<?php if (!isset($mount['mountpoint'])): ?>
<td class="backend">