summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-19 12:18:09 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-29 14:50:52 +0100
commitf3e9729a5f68fa36ee6633955b7913f37e1c890e (patch)
tree95c5cee3d5c4e952d24296754490abbda24078c1 /apps
parent419507c1181e8b9685ebaa4fee8973c62967ac6e (diff)
downloadnextcloud-server-f3e9729a5f68fa36ee6633955b7913f37e1c890e.tar.gz
nextcloud-server-f3e9729a5f68fa36ee6633955b7913f37e1c890e.zip
expose user provided credentials for admin mounts
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/controller/usercredentialscontroller.php1
-rw-r--r--apps/files_external/controller/userglobalstoragescontroller.php10
2 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_external/controller/usercredentialscontroller.php b/apps/files_external/controller/usercredentialscontroller.php
index 2944611d8a9..bc514cba088 100644
--- a/apps/files_external/controller/usercredentialscontroller.php
+++ b/apps/files_external/controller/usercredentialscontroller.php
@@ -49,7 +49,6 @@ class UserCredentialsController extends Controller {
* @param string $password
*
* @NoAdminRequired
- * @NoCSRFRequired
*/
public function store($storageId, $username, $password) {
$this->authMechanism->saveCredentials($this->userSession->getUser(), $storageId, $username, $password);
diff --git a/apps/files_external/controller/userglobalstoragescontroller.php b/apps/files_external/controller/userglobalstoragescontroller.php
index 6d4548754df..97b5c90e20c 100644
--- a/apps/files_external/controller/userglobalstoragescontroller.php
+++ b/apps/files_external/controller/userglobalstoragescontroller.php
@@ -22,6 +22,8 @@
namespace OCA\Files_External\Controller;
use OCA\Files_External\Lib\Auth\AuthMechanism;
+use OCA\Files_External\Lib\Auth\Password\UserProvided;
+use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use \OCP\IRequest;
use \OCP\IL10N;
use \OCP\AppFramework\Http\DataResponse;
@@ -135,6 +137,14 @@ class UserGlobalStoragesController extends StoragesController {
protected function sanitizeStorage(StorageConfig $storage) {
$storage->setBackendOptions([]);
$storage->setMountOptions([]);
+
+ if ($storage->getAuthMechanism() instanceof UserProvided) {
+ try {
+ $storage->getAuthMechanism()->manipulateStorageConfig($storage, $this->userSession->getUser());
+ } catch (InsufficientDataForMeaningfulAnswerException $e) {
+
+ }
+ }
}
}