aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/lib/Controller
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-07-14 20:41:10 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-07-14 20:48:45 +0200
commitf8a531c06c8095be4edcbd70063437e67833668e (patch)
treeb98c42b535229d9e72834cdc75adebfc54e2bded /apps/federatedfilesharing/lib/Controller
parentc7f6461c53e1d432f268305e63eb9a604e12cba4 (diff)
downloadnextcloud-server-f8a531c06c8095be4edcbd70063437e67833668e.tar.gz
nextcloud-server-f8a531c06c8095be4edcbd70063437e67833668e.zip
don't convert link share to federated share if outgoing federated shares are forbidden
Diffstat (limited to 'apps/federatedfilesharing/lib/Controller')
-rw-r--r--apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
index ec70090f97a..3e61d355b63 100644
--- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
+++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php
@@ -114,6 +114,13 @@ class MountPublicLinkController extends Controller {
*/
public function createFederatedShare($shareWith, $token, $password = '') {
+ if (!$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) {
+ return new JSONResponse(
+ ['message' => 'This server doesn\'t support outgoing federated shares'],
+ Http::STATUS_BAD_REQUEST
+ );
+ }
+
try {
list(, $server) = $this->addressHandler->splitUserRemote($shareWith);
$share = $this->shareManager->getShareByToken($token);
@@ -126,7 +133,10 @@ class MountPublicLinkController extends Controller {
$authenticated = $this->session->get('public_link_authenticated') === $share->getId() ||
$this->shareManager->checkPassword($share, $password);
if (!empty($storedPassword) && !$authenticated ) {
- return new JSONResponse(['message' => 'No permission to access the share'], Http::STATUS_BAD_REQUEST);
+ return new JSONResponse(
+ ['message' => 'No permission to access the share'],
+ Http::STATUS_BAD_REQUEST
+ );
}
$share->setSharedWith($shareWith);