Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-02 19:55:43 +0400
committerVincent Petry <pvince81@owncloud.com>2013-12-03 18:55:08 +0400
commit3bf30377b87fa128cb3fed5bdeaa7234edcff1d3 (patch)
treeac13a8dee0d22a41b5816b85642352e0cc070873 /apps/files_external
parent5ac3f9bfa5f3fd1a58d6a02b43e27a4105a03484 (diff)
Fixed Amazon S3 ext storage config UI
Optional parameters are now really optional Fixes #5861
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/amazons3.php6
-rwxr-xr-xapps/files_external/lib/config.php7
2 files changed, 7 insertions, 6 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index 9a682fb2d48..b6d02ee0c46 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -81,9 +81,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
$this->test = isset($params['test']);
$this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout'];
- $params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region'];
- $params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname'];
- if (!isset($params['port'])) {
+ $params['region'] = ( ! isset($params['region']) || $params['region'] === '' ) ? 'eu-west-1' : $params['region'];
+ $params['hostname'] = ( !isset($params['hostname']) || $params['hostname'] === '' ) ? 's3.amazonaws.com' : $params['hostname'];
+ if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
}
$base_url = $scheme.'://'.$params['hostname'].':'.$params['port'].'/';
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index aaa6c5be1a0..12836c7b88c 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -50,9 +50,9 @@ class OC_Mount_Config {
'key' => 'Access Key',
'secret' => '*Secret Key',
'bucket' => 'Bucket',
- 'hostname' => 'Hostname (optional)',
- 'port' => 'Port (optional)',
- 'region' => 'Region (optional)',
+ 'hostname' => '&Hostname (optional)',
+ 'port' => '&Port (optional)',
+ 'region' => '&Region (optional)',
'use_ssl' => '!Enable SSL',
'use_path_style' => '!Enable Path Style'));
@@ -244,6 +244,7 @@ class OC_Mount_Config {
$storage = new $class($options);
return $storage->test();
} catch (Exception $exception) {
+ \OCP\Util::logException('files_external', $exception);
return false;
}
}