summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-02-05 15:51:38 +0100
committerRobin Appelman <icewind@owncloud.com>2016-02-05 15:51:38 +0100
commit16ad612c83cf13dd3bc5c658556fcab0ac8f229f (patch)
tree4b4a04e468754c2a245c38f724a02d2c317a4a07 /apps/files_external
parent239cdd099a2ef9d4bead6d887c9dd2a0acdfee45 (diff)
downloadnextcloud-server-16ad612c83cf13dd3bc5c658556fcab0ac8f229f.tar.gz
nextcloud-server-16ad612c83cf13dd3bc5c658556fcab0ac8f229f.zip
verify that the auth backend is valid for the storage backend
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/command/create.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_external/command/create.php b/apps/files_external/command/create.php
index 2f2f0ca8f73..b2def1135bb 100644
--- a/apps/files_external/command/create.php
+++ b/apps/files_external/command/create.php
@@ -142,6 +142,11 @@ class Create extends Base {
$output->writeln('<error>Authentication backend with identifier "' . $authIdentifier . '" not found (see `occ files_external:backends` for possible values)</error>');
return 404;
}
+ $supportedSchemes = array_keys($storageBackend->getAuthSchemes());
+ if (!in_array($authBackend->getScheme(), $supportedSchemes)) {
+ $output->writeln('<error>Authentication backend "' . $authIdentifier . '" not valid for storage backend "' . $storageIdentifier . '" (see `occ files_external:backends storage ' . $storageIdentifier . '` for possible values)</error>');
+ return 1;
+ }
$config = [];
foreach ($configInput as $configOption) {