diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-19 12:18:09 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-29 14:50:52 +0100 |
commit | f3e9729a5f68fa36ee6633955b7913f37e1c890e (patch) | |
tree | 95c5cee3d5c4e952d24296754490abbda24078c1 /apps | |
parent | 419507c1181e8b9685ebaa4fee8973c62967ac6e (diff) | |
download | nextcloud-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.php | 1 | ||||
-rw-r--r-- | apps/files_external/controller/userglobalstoragescontroller.php | 10 |
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) { + + } + } } } |