diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-06-04 12:16:03 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:28 +0200 |
commit | fab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab (patch) | |
tree | 723753d2819808ab0ed16d7c9574a3fd6a74ab26 /apps/cloud_federation_api/lib | |
parent | 41a1528888062610af58e319ce7bfa3ef8784da3 (diff) | |
download | nextcloud-server-fab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab.tar.gz nextcloud-server-fab4e561f4f3ea9a3cf90a01c39c8d1e87ee9eab.zip |
send reshare over OCM API
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/cloud_federation_api/lib')
-rw-r--r-- | apps/cloud_federation_api/lib/Controller/RequestHandlerController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index 4ee8344b6b5..a7601d1ce18 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -117,6 +117,7 @@ class RequestHandlerController extends Controller { * Example: curl -H "Content-Type: application/json" -X POST -d '{"shareWith":"admin1@serve1","name":"welcome server2.txt","description":"desc","providerId":"2","owner":"admin2@http://localhost/server2","ownerDisplayName":"admin2 display","shareType":"user","resourceType":"file","protocol":{"name":"webdav","options":{"sharedSecret":"secret","permissions":"webdav-property"}}}' http://localhost/server/index.php/ocm/shares */ public function addShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $protocol, $shareType, $resourceType) { + if (!$this->config->incomingRequestsEnabled()) { return new JSONResponse( ['message' => 'This server doesn\'t support outgoing federated shares'], @@ -227,7 +228,7 @@ class RequestHandlerController extends Controller { try { $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType); - $provider->notificationReceived($notificationType, $providerId, $notification); + $result = $provider->notificationReceived($notificationType, $providerId, $notification); } catch (ProviderDoesNotExistsException $e) { return new JSONResponse( ['message' => $e->getMessage()], @@ -255,8 +256,7 @@ class RequestHandlerController extends Controller { ); } - - return new JSONResponse([],Http::STATUS_CREATED); + return new JSONResponse($result,Http::STATUS_CREATED); } |