From d6121464a04ad86721e780d125a75d48a5c3fc27 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 2 Dec 2013 18:49:34 +0100 Subject: [PATCH 1/3] Fixed placeholder after page reload The placeholder somehow had too many characters stripping from it... --- apps/files_external/templates/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 0d318a183c7..3ca16c3c7a8 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -60,7 +60,7 @@ class="optional" data-parameter="" value="" - placeholder="" /> + placeholder="" /> Date: Mon, 2 Dec 2013 16:55:43 +0100 Subject: [PATCH 2/3] Fixed Amazon S3 ext storage config UI Optional parameters are now really optional Fixes #5861 --- apps/files_external/lib/amazons3.php | 6 +++--- apps/files_external/lib/config.php | 7 ++++--- 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; } } From 3b7905364f406969410d505a8804034051451376 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 2 Dec 2013 18:32:32 +0100 Subject: [PATCH 3/3] Fixed test function for S3 Fixes #5752 --- apps/files_external/lib/amazons3.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index b6d02ee0c46..00baacd488c 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -507,8 +507,10 @@ class AmazonS3 extends \OC\Files\Storage\Common { } public function test() { - $test = $this->s3->get_canonical_user_id(); - if (isset($test['id']) && $test['id'] != '') { + $test = $this->connection->getBucketAcl(array( + 'Bucket' => $this->bucket, + )); + if (isset($test) && !is_null($test->getPath('Owner/ID'))) { return true; } return false;