aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-31 11:41:07 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-12 18:51:02 +0100
commitce94a998dd5a5801beef7874dd13752095e35de0 (patch)
tree8d91631f709549c40555dcb74e9976519f895ae2 /apps/files_external/ajax
parent23cc3cc5f2f42166c37fbe03fa62d3dd1dbfe5ed (diff)
downloadnextcloud-server-ce94a998dd5a5801beef7874dd13752095e35de0.tar.gz
nextcloud-server-ce94a998dd5a5801beef7874dd13752095e35de0.zip
Use storage id + appframework for ext storage CRUD
- Added StorageConfig class to replace ugly arrays - Implemented StorageService and StorageController for Global and User storages - Async status checking for storages (from Xenopathic) - Auto-generate id for external storage configs (not the same as storage_id) - Refactor JS classes for external storage settings, this mostly moves/encapsulated existing global event handlers into the MountConfigListView class. - Added some JS unit tests for the external storage UI
Diffstat (limited to 'apps/files_external/ajax')
-rw-r--r--apps/files_external/ajax/addMountPoint.php26
-rw-r--r--apps/files_external/ajax/removeMountPoint.php23
2 files changed, 0 insertions, 49 deletions
diff --git a/apps/files_external/ajax/addMountPoint.php b/apps/files_external/ajax/addMountPoint.php
deleted file mode 100644
index 4e27ef98756..00000000000
--- a/apps/files_external/ajax/addMountPoint.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-OCP\JSON::checkAppEnabled('files_external');
-OCP\JSON::callCheck();
-
-if ($_POST['isPersonal'] == 'true') {
- OCP\JSON::checkLoggedIn();
- $isPersonal = true;
-} else {
- OCP\JSON::checkAdminUser();
- $isPersonal = false;
-}
-
-$mountPoint = (string)$_POST['mountPoint'];
-$oldMountPoint = (string)$_POST['oldMountPoint'];
-$class = (string)$_POST['class'];
-$options = (array)$_POST['classOptions'];
-$type = (string)$_POST['mountType'];
-$applicable = (string)$_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)));
diff --git a/apps/files_external/ajax/removeMountPoint.php b/apps/files_external/ajax/removeMountPoint.php
deleted file mode 100644
index 0870911544b..00000000000
--- a/apps/files_external/ajax/removeMountPoint.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-OCP\JSON::checkAppEnabled('files_external');
-OCP\JSON::callCheck();
-
-if (!isset($_POST['isPersonal']))
- return;
-if (!isset($_POST['mountPoint']))
- return;
-if (!isset($_POST['mountType']))
- return;
-if (!isset($_POST['applicable']))
- return;
-
-if ($_POST['isPersonal'] == 'true') {
- OCP\JSON::checkLoggedIn();
- $isPersonal = true;
-} else {
- OCP\JSON::checkAdminUser();
- $isPersonal = false;
-}
-
-OC_Mount_Config::removeMountPoint((string)$_POST['mountPoint'], (string)$_POST['mountType'], (string)$_POST['applicable'], $isPersonal);