diff options
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/Swift.php')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index 051c65350d5..2f8207cac4f 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -156,13 +156,14 @@ class Swift extends \OC\Files\Storage\Common { public function __construct($params) { if ((empty($params['key']) and empty($params['password'])) - or empty($params['user']) or empty($params['bucket']) + or (empty($params['user']) && empty($params['userid'])) or empty($params['bucket']) or empty($params['region']) ) { throw new StorageBadConfigException("API Key or password, Username, Bucket and Region have to be configured."); } - $this->id = 'swift::' . $params['user'] . md5($params['bucket']); + $user = isset($params['user']) ? $params['user'] : $params['userid']; + $this->id = 'swift::' . $user . md5($params['bucket']); $bucketUrl = new Uri($params['bucket']); if ($bucketUrl->getHost()) { @@ -180,6 +181,13 @@ class Swift extends \OC\Files\Storage\Common { $params['autocreate'] = true; + if (isset($params['userid'])) { + $params['user'] = [ + 'id' => $params['userid'], + 'password' => $params['password'] + ]; + } + $this->params = $params; // FIXME: private class... $this->objectCache = new \OC\Cache\CappedMemoryCache(); |