minor fixes
This commit is contained in:
parent
eb29bc64de
commit
efcf790eff
|
@ -23,7 +23,6 @@ namespace OCA\Files_External\Controller;
|
||||||
|
|
||||||
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use OCA\Files_External\Lib\Auth\IUserProvided;
|
use OCA\Files_External\Lib\Auth\IUserProvided;
|
||||||
use OCA\Files_External\Lib\Auth\Password\UserProvided;
|
|
||||||
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
||||||
use \OCP\IRequest;
|
use \OCP\IRequest;
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
|
@ -186,11 +185,11 @@ class UserGlobalStoragesController extends StoragesController {
|
||||||
$storage->setBackendOptions([]);
|
$storage->setBackendOptions([]);
|
||||||
$storage->setMountOptions([]);
|
$storage->setMountOptions([]);
|
||||||
|
|
||||||
if ($storage->getAuthMechanism() instanceof UserProvided) {
|
if ($storage->getAuthMechanism() instanceof IUserProvided) {
|
||||||
try {
|
try {
|
||||||
$storage->getAuthMechanism()->manipulateStorageConfig($storage, $this->userSession->getUser());
|
$storage->getAuthMechanism()->manipulateStorageConfig($storage, $this->userSession->getUser());
|
||||||
} catch (InsufficientDataForMeaningfulAnswerException $e) {
|
} catch (InsufficientDataForMeaningfulAnswerException $e) {
|
||||||
|
// not configured yet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,12 @@ StorageConfig.Status = {
|
||||||
ERROR: 1,
|
ERROR: 1,
|
||||||
INDETERMINATE: 2
|
INDETERMINATE: 2
|
||||||
};
|
};
|
||||||
|
StorageConfig.Visibility = {
|
||||||
|
NONE: 0,
|
||||||
|
PERSONAL: 1,
|
||||||
|
ADMIN: 2,
|
||||||
|
DEFAULT: 3
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.External.Settings
|
* @memberof OCA.External.Settings
|
||||||
*/
|
*/
|
||||||
|
@ -809,7 +815,7 @@ MountConfigListView.prototype = _.extend({
|
||||||
$tr.find('.backend').data('identifier', backend.identifier);
|
$tr.find('.backend').data('identifier', backend.identifier);
|
||||||
|
|
||||||
var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>');
|
var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>');
|
||||||
var neededVisibility = (this._isPersonal) ? 1 : 2;
|
var neededVisibility = (this._isPersonal) ? StorageConfig.Visibility.PERSONAL : StorageConfig.Visibility.ADMIN;
|
||||||
$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {
|
$.each(this._allAuthMechanisms, function(authIdentifier, authMechanism) {
|
||||||
if (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {
|
if (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {
|
||||||
selectAuthMechanism.append(
|
selectAuthMechanism.append(
|
||||||
|
@ -887,7 +893,6 @@ MountConfigListView.prototype = _.extend({
|
||||||
var onCompletion = jQuery.Deferred();
|
var onCompletion = jQuery.Deferred();
|
||||||
$.each(result, function(i, storageParams) {
|
$.each(result, function(i, storageParams) {
|
||||||
var storageConfig;
|
var storageConfig;
|
||||||
console.log(storageParams);
|
|
||||||
var isUserGlobal = storageParams.type === 'system' && self._isPersonal;
|
var isUserGlobal = storageParams.type === 'system' && self._isPersonal;
|
||||||
storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash
|
storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash
|
||||||
if (isUserGlobal) {
|
if (isUserGlobal) {
|
||||||
|
@ -970,7 +975,7 @@ MountConfigListView.prototype = _.extend({
|
||||||
var newElement;
|
var newElement;
|
||||||
|
|
||||||
var trimmedPlaceholder = placeholder;
|
var trimmedPlaceholder = placeholder;
|
||||||
var flags = ['@', '*', '!', '#', '&'];
|
var flags = ['@', '*', '!', '#', '&']; // used to determine what kind of parameter
|
||||||
while(flags.indexOf(trimmedPlaceholder[0]) !== -1) {
|
while(flags.indexOf(trimmedPlaceholder[0]) !== -1) {
|
||||||
trimmedPlaceholder = trimmedPlaceholder.substr(1);
|
trimmedPlaceholder = trimmedPlaceholder.substr(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @author Robin McCorkell <robin@mccorkell.me.uk>
|
* @author Robin Appelman <icewind@owncloud.com>
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||||
* @license AGPL-3.0
|
* @license AGPL-3.0
|
||||||
|
|
Loading…
Reference in New Issue