diff options
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/Swift.php')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 15 |
1 files changed, 13 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..a638169dcb2 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 = $params['user']; + $this->id = 'swift::' . $user . md5($params['bucket']); $bucketUrl = new Uri($params['bucket']); if ($bucketUrl->getHost()) { @@ -180,6 +181,16 @@ class Swift extends \OC\Files\Storage\Common { $params['autocreate'] = true; + if (isset($params['domain'])) { + $params['user'] = [ + 'name' => $params['user'], + 'password' => $params['password'], + 'domain' => [ + 'name' => $params['domain'], + ] + ]; + } + $this->params = $params; // FIXME: private class... $this->objectCache = new \OC\Cache\CappedMemoryCache(); |