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

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-04-26 20:01:08 +0300
committerJulius Härtl <jus@bitgrid.net>2021-04-28 11:40:59 +0300
commitcee905c3fff723c806b0611daa9379af894ea462 (patch)
tree195de3e0f139c8fa7078ec2031769cd1d7d23741 /lib
parentca0b424e3459f3b34c9d723072b0f7e8cd510f29 (diff)
Add documentation and improve parameter naming
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/OCSController.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Controller/OCSController.php b/lib/Controller/OCSController.php
index c7cf7520..3294ea67 100644
--- a/lib/Controller/OCSController.php
+++ b/lib/Controller/OCSController.php
@@ -128,27 +128,25 @@ class OCSController extends \OCP\AppFramework\OCSController {
/**
* Generate a direct editing link for a file in a public share to open with the current user
*
- * If
- *
* @NoAdminRequired
* @throws OCSForbiddenException
*/
public function createPublic(
- string $shareTokenSourceInstance = null,
string $shareToken,
+ string $host = null,
string $path = '',
string $password = null
): DataResponse {
- if ($shareTokenSourceInstance) {
- $remoteCollabora = $this->federationService->getRemoteCollaboraURL($shareTokenSourceInstance);
+ if ($host) {
+ $remoteCollabora = $this->federationService->getRemoteCollaboraURL($host);
if ($remoteCollabora === '') {
throw new OCSNotFoundException('Failed to connect to remote collabora instance.');
}
- $wopi = $this->tokenManager->newInitiatorToken($shareTokenSourceInstance, null, $shareToken, true, $this->userId);
+ $wopi = $this->tokenManager->newInitiatorToken($host, null, $shareToken, true, $this->userId);
$client = \OC::$server->getHTTPClientService()->newClient();
- $response = $client->post(rtrim($shareTokenSourceInstance, '/') . '/ocs/v2.php/apps/richdocuments/api/v1/direct/share/initiator?format=json', [
+ $response = $client->post(rtrim($host, '/') . '/ocs/v2.php/apps/richdocuments/api/v1/direct/share/initiator?format=json', [
'body' => [
'initiatorServer' => \OC::$server->getURLGenerator()->getAbsoluteURL(''),
'initiatorToken' => $wopi->getToken(),