diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-12-24 13:45:52 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-12-24 13:45:52 -0500 |
commit | 0dbf1d02600ef4075ceffe9c62c1ed32cc24592f (patch) | |
tree | 2db27ca226035add120fec8f2ca529c84001d0f6 /apps/files_external/lib/swift.php | |
parent | 5fb4ed2d92b28bfcd0647233421a3614b00e6d4c (diff) | |
download | nextcloud-server-0dbf1d02600ef4075ceffe9c62c1ed32cc24592f.tar.gz nextcloud-server-0dbf1d02600ef4075ceffe9c62c1ed32cc24592f.zip |
Show status icons for mount points in external storage UI
Diffstat (limited to 'apps/files_external/lib/swift.php')
-rw-r--r-- | apps/files_external/lib/swift.php | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index a071dfdbb03..e2add2c9873 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -267,32 +267,37 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ } public function __construct($params) { - $this->token=$params['token']; - $this->host=$params['host']; - $this->user=$params['user']; - $this->root=isset($params['root'])?$params['root']:'/'; - if (isset($params['secure'])) { - if (is_string($params['secure'])) { - $this->secure = ($params['secure'] === 'true'); + if (isset($params['token']) && isset($params['host']) && isset($params['user'])) { + $this->token=$params['token']; + $this->host=$params['host']; + $this->user=$params['user']; + $this->root=isset($params['root'])?$params['root']:'/'; + if (isset($params['secure'])) { + if (is_string($params['secure'])) { + $this->secure = ($params['secure'] === 'true'); + } else { + $this->secure = (bool)$params['secure']; + } } else { - $this->secure = (bool)$params['secure']; + $this->secure = false; } - } else { - $this->secure = false; - } - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; - } - $this->auth = new CF_Authentication($this->user, $this->token, null, $this->host); - $this->auth->authenticate(); + if ( ! $this->root || $this->root[0]!='/') { + $this->root='/'.$this->root; + } + $this->auth = new CF_Authentication($this->user, $this->token, null, $this->host); + $this->auth->authenticate(); - $this->conn = new CF_Connection($this->auth); + $this->conn = new CF_Connection($this->auth); - if ( ! $this->containerExists('/')) { - $this->rootContainer=$this->createContainer('/'); + if ( ! $this->containerExists('/')) { + $this->rootContainer=$this->createContainer('/'); + } else { + $this->rootContainer=$this->getContainer('/'); + } } else { - $this->rootContainer=$this->getContainer('/'); + throw new Exception(); } + } |