summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-06-26 14:51:00 +0200
committerGitHub <noreply@github.com>2016-06-26 14:51:00 +0200
commitdb6361ef0314868edc9d58a81c0806c8c758af0a (patch)
treea2c168943d0e15a2d28febf82e31e74b15504117 /apps/federatedfilesharing
parent03449dcb9a56e642ff4eee31145498bbaeb83319 (diff)
parent7a9d60d87eb8e4414e5fe05830b088d426ff810d (diff)
downloadnextcloud-server-db6361ef0314868edc9d58a81c0806c8c758af0a.tar.gz
nextcloud-server-db6361ef0314868edc9d58a81c0806c8c758af0a.zip
Merge pull request #226 from nextcloud/master-upstream-sync
[Master] upstream sync
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/l10n/ast.js5
-rw-r--r--apps/federatedfilesharing/l10n/ast.json5
-rw-r--r--apps/federatedfilesharing/lib/DiscoveryManager.php5
-rw-r--r--apps/federatedfilesharing/lib/Notifications.php4
-rw-r--r--apps/federatedfilesharing/tests/DiscoveryManagerTest.php25
5 files changed, 35 insertions, 9 deletions
diff --git a/apps/federatedfilesharing/l10n/ast.js b/apps/federatedfilesharing/l10n/ast.js
index 4ae5f2b9cc1..3b5affabbb9 100644
--- a/apps/federatedfilesharing/l10n/ast.js
+++ b/apps/federatedfilesharing/l10n/ast.js
@@ -1,6 +1,9 @@
OC.L10N.register(
"federatedfilesharing",
{
- "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s"
+ "Invalid Federated Cloud ID" : "Inválidu ID de Ñube Federada",
+ "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s",
+ "Not allowed to create a federated share with the same user" : "Nun s'almite crear un recursu compartíu federáu col mesmu usuariu",
+ "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Compartir %s falló, nun pudo atopase %s, pue qu'el servidor nun seya anguaño algamable."
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/federatedfilesharing/l10n/ast.json b/apps/federatedfilesharing/l10n/ast.json
index 70d90ab6578..e5eb10cf14e 100644
--- a/apps/federatedfilesharing/l10n/ast.json
+++ b/apps/federatedfilesharing/l10n/ast.json
@@ -1,4 +1,7 @@
{ "translations": {
- "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s"
+ "Invalid Federated Cloud ID" : "Inválidu ID de Ñube Federada",
+ "Sharing %s failed, because this item is already shared with %s" : "Compartir %s falló, porque esti elementu yá ta compartiéndose con %s",
+ "Not allowed to create a federated share with the same user" : "Nun s'almite crear un recursu compartíu federáu col mesmu usuariu",
+ "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "Compartir %s falló, nun pudo atopase %s, pue qu'el servidor nun seya anguaño algamable."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/federatedfilesharing/lib/DiscoveryManager.php b/apps/federatedfilesharing/lib/DiscoveryManager.php
index 279f86eda30..d65dad3085e 100644
--- a/apps/federatedfilesharing/lib/DiscoveryManager.php
+++ b/apps/federatedfilesharing/lib/DiscoveryManager.php
@@ -84,7 +84,10 @@ class DiscoveryManager {
// Read the data from the response body
try {
- $response = $this->client->get($remote . '/ocs-provider/');
+ $response = $this->client->get($remote . '/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ]);
if($response->getStatusCode() === 200) {
$decodedService = json_decode($response->getBody(), true);
if(is_array($decodedService)) {
diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php
index b2e665ed5fd..ac55642b858 100644
--- a/apps/federatedfilesharing/lib/Notifications.php
+++ b/apps/federatedfilesharing/lib/Notifications.php
@@ -287,7 +287,9 @@ class Notifications {
$endpoint = $this->discoveryManager->getShareEndpoint($protocol . $remoteDomain);
try {
$response = $client->post($protocol . $remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [
- 'body' => $fields
+ 'body' => $fields,
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
]);
$result['result'] = $response->getBody();
$result['success'] = true;
diff --git a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php
index 73f79b2c169..a9c324f0244 100644
--- a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php
+++ b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php
@@ -77,7 +77,10 @@ class DiscoveryManagerTest extends \Test\TestCase {
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$this->cache
->expects($this->at(0))
@@ -111,7 +114,10 @@ class DiscoveryManagerTest extends \Test\TestCase {
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/public.php/MyCustomEndpoint/';
@@ -131,7 +137,10 @@ class DiscoveryManagerTest extends \Test\TestCase {
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/public.php/webdav';
@@ -151,7 +160,10 @@ class DiscoveryManagerTest extends \Test\TestCase {
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$expectedResult = '/ocs/v2.php/cloud/MyCustomShareEndpoint';
@@ -171,7 +183,10 @@ class DiscoveryManagerTest extends \Test\TestCase {
$this->client
->expects($this->once())
->method('get')
- ->with('https://myhost.com/ocs-provider/', [])
+ ->with('https://myhost.com/ocs-provider/', [
+ 'timeout' => 10,
+ 'connect_timeout' => 10,
+ ])
->willReturn($response);
$this->cache
->expects($this->at(0))