use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Auth\IUserProvided;
-use OCA\Files_External\Lib\Auth\Password\UserProvided;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use \OCP\IRequest;
use \OCP\IL10N;
$storage->setBackendOptions([]);
$storage->setMountOptions([]);
- if ($storage->getAuthMechanism() instanceof UserProvided) {
+ if ($storage->getAuthMechanism() instanceof IUserProvided) {
try {
$storage->getAuthMechanism()->manipulateStorageConfig($storage, $this->userSession->getUser());
} catch (InsufficientDataForMeaningfulAnswerException $e) {
-
+ // not configured yet
}
}
}
ERROR: 1,
INDETERMINATE: 2
};
+StorageConfig.Visibility = {
+ NONE: 0,
+ PERSONAL: 1,
+ ADMIN: 2,
+ DEFAULT: 3
+};
/**
* @memberof OCA.External.Settings
*/
$tr.find('.backend').data('identifier', backend.identifier);
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) {
if (backend.authSchemes[authMechanism.scheme] && (authMechanism.visibility & neededVisibility)) {
selectAuthMechanism.append(
var onCompletion = jQuery.Deferred();
$.each(result, function(i, storageParams) {
var storageConfig;
- console.log(storageParams);
var isUserGlobal = storageParams.type === 'system' && self._isPersonal;
storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash
if (isUserGlobal) {
var newElement;
var trimmedPlaceholder = placeholder;
- var flags = ['@', '*', '!', '#', '&'];
+ var flags = ['@', '*', '!', '#', '&']; // used to determine what kind of parameter
while(flags.indexOf(trimmedPlaceholder[0]) !== -1) {
trimmedPlaceholder = trimmedPlaceholder.substr(1);
}