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>2020-08-21 17:03:04 +0300
committerJulius Härtl <jus@bitgrid.net>2020-10-13 15:36:52 +0300
commit8c69d3637f451ff4c9391b5342e2ba850419c06d (patch)
treee52fc0d71994db2474bfa7ee44f6b993c65a8659 /lib
parenteff8898bd86fc306775fe0e68c66c9a8f82cda0a (diff)
Add full path to redirect
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/DocumentController.php7
-rw-r--r--lib/Service/FederationService.php8
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/Controller/DocumentController.php b/lib/Controller/DocumentController.php
index aa98c239..3f2071db 100644
--- a/lib/Controller/DocumentController.php
+++ b/lib/Controller/DocumentController.php
@@ -194,9 +194,10 @@ class DocumentController extends Controller {
$remoteCollabora = $this->federationService->getRemoteCollaboraURL($remote);
if ($remoteCollabora !== '') {
$absolute = $item->getParent()->getPath();
- $relative = $folder->getRelativePath($absolute);
- $url = '/index.php/apps/files?dir=' . $relative .
- '&richdocuments_open=' . $item->getName() .
+ $relativeFolderPath = $folder->getRelativePath($absolute);
+ $relativeFilePath = $folder->getRelativePath($item->getPath());
+ $url = '/index.php/apps/files/?dir=' . $relativeFolderPath .
+ '&richdocuments_open=' . $relativeFilePath .
'&richdocuments_fileId=' . $fileId .
'&richdocuments_remote_access=' . $remote;
diff --git a/lib/Service/FederationService.php b/lib/Service/FederationService.php
index 665cbe1e..fce2ea74 100644
--- a/lib/Service/FederationService.php
+++ b/lib/Service/FederationService.php
@@ -60,10 +60,14 @@ class FederationService {
} catch (QueryException $e) {}
}
+ /**
+ * @param $remote
+ * @return string
+ * @throws \Exception
+ */
public function getRemoteCollaboraURL($remote) {
if ($this->trustedServers === null || !$this->trustedServers->isTrustedServer($remote)) {
- $this->logger->info('Unable to determine collabora URL of remote server ' . $remote . ' - Remote is not a trusted server');
- return '';
+ throw new \Exception('Unable to determine collabora URL of remote server ' . $remote . ' - Remote is not a trusted server');
}
if ($remoteCollabora = $this->cache->get('richdocuments_remote/' . $remote)) {
return $remoteCollabora;