summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-01-19 14:21:59 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-29 14:51:30 +0100
commit5bdcd534b18ce842c6775f588c9a7330a82ed89d (patch)
treee49a4a0331fbec40d068806e5a3910140eca6271
parent860d51487b103f4c050d2427c35ee70dd4b2b05e (diff)
downloadnextcloud-server-5bdcd534b18ce842c6775f588c9a7330a82ed89d.tar.gz
nextcloud-server-5bdcd534b18ce842c6775f588c9a7330a82ed89d.zip
dont show user provided auth as option for personal mounts
-rw-r--r--apps/files_external/js/settings.js5
-rw-r--r--apps/files_external/lib/auth/authmechanism.php1
-rw-r--r--apps/files_external/lib/auth/password/userprovided.php2
3 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 16576ce7087..52b46db6cc0 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -836,8 +836,9 @@ MountConfigListView.prototype = _.extend({
$tr.find('.backend').data('identifier', backend.identifier);
var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>');
+ var neededVisibility = (this._isPersonal) ? 1 : 2;
$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {
- if (backend.authSchemes[authMechanism.scheme]) {
+ if (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {
selectAuthMechanism.append(
$('<option value="'+authMechanism.identifier+'" data-scheme="'+authMechanism.scheme+'">'+authMechanism.name+'</option>')
);
@@ -1136,9 +1137,7 @@ MountConfigListView.prototype = _.extend({
saveStorageConfig:function($tr, callback, concurrentTimer) {
var self = this;
var storage = this.getStorageConfig($tr);
- console.log(storage);
if (!storage || !storage.validate()) {
- console.log('invalid');
return false;
}
diff --git a/apps/files_external/lib/auth/authmechanism.php b/apps/files_external/lib/auth/authmechanism.php
index 72b56e0bc06..36e55de92c5 100644
--- a/apps/files_external/lib/auth/authmechanism.php
+++ b/apps/files_external/lib/auth/authmechanism.php
@@ -95,6 +95,7 @@ class AuthMechanism implements \JsonSerializable {
$data += $this->jsonSerializeIdentifier();
$data['scheme'] = $this->getScheme();
+ $data['visibility'] = $this->getVisibility();
return $data;
}
diff --git a/apps/files_external/lib/auth/password/userprovided.php b/apps/files_external/lib/auth/password/userprovided.php
index b0ff50a279a..1c2cc0a6d97 100644
--- a/apps/files_external/lib/auth/password/userprovided.php
+++ b/apps/files_external/lib/auth/password/userprovided.php
@@ -22,6 +22,7 @@
namespace OCA\Files_External\Lib\Auth\Password;
use OCA\Files_External\Lib\DefinitionParameter;
+use OCA\Files_External\Service\BackendService;
use OCP\IL10N;
use OCP\IUser;
use OCA\Files_External\Lib\Auth\AuthMechanism;
@@ -45,6 +46,7 @@ class UserProvided extends AuthMechanism {
$this
->setIdentifier('password::userprovided')
+ ->setVisibility(BackendService::VISIBILITY_ADMIN)
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('User provided'))
->addParameters([