Skip to content

Commit

Permalink
adjust external storage config format to the one used in primary storage
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Feb 26, 2018
1 parent dde27ba commit 4147496
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function __construct(IL10N $l) {
->setScheme(self::SCHEME_OPENSTACK)
->setText($l->t('OpenStack v3'))
->addParameters([
new DefinitionParameter('userid', $l->t('User Id')),
new DefinitionParameter('user', $l->t('Username')),
new DefinitionParameter('domain', $l->t('Domain')),
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
new DefinitionParameter('url', $l->t('Identity endpoint URL'))
Expand Down
11 changes: 7 additions & 4 deletions apps/files_external/lib/Lib/Storage/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function __construct($params) {
throw new StorageBadConfigException("API Key or password, Username, Bucket and Region have to be configured.");
}

$user = isset($params['user']) ? $params['user'] : $params['userid'];
$user = $params['user'];
$this->id = 'swift::' . $user . md5($params['bucket']);

$bucketUrl = new Uri($params['bucket']);
Expand All @@ -181,10 +181,13 @@ public function __construct($params) {

$params['autocreate'] = true;

if (isset($params['userid'])) {
if (isset($params['domain'])) {
$params['user'] = [
'id' => $params['userid'],
'password' => $params['password']
'name' => $params['user'],
'password' => $params['password'],
'domain' => [
'name' => $params['domain'],
]
];
}

Expand Down

0 comments on commit 4147496

Please sign in to comment.