From 1765e17207956ec24479bbdf6dd5336200e64019 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 27 Jan 2020 14:12:28 +0300 Subject: [PATCH 1/2] direct editing for selected groups (Fixed #228) --- appinfo/application.php | 3 +-- lib/directeditor.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index 8e7375e1..af63b6ae 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -133,8 +133,7 @@ function() { $eventDispatcher->addListener(RegisterDirectEditorEvent::class, function (RegisterDirectEditorEvent $event) use ($container) { if (!empty($this->appConfig->GetDocumentServerUrl()) - && $this->appConfig->SettingsAreSuccessful() - && $this->appConfig->isUserAllowedToUse()) { + && $this->appConfig->SettingsAreSuccessful()) { $editor = $container->query("DirectEditor"); $event->register($editor); } diff --git a/lib/directeditor.php b/lib/directeditor.php index 601e71aa..11b99c16 100644 --- a/lib/directeditor.php +++ b/lib/directeditor.php @@ -139,6 +139,10 @@ public function getName(): string { */ public function getMimetypes(): array { $mimes = array(); + if (!$this->config->isUserAllowedToUse()) { + return $mimes; + } + $formats = $this->config->FormatsSetting(); foreach ($formats as $format => $setting) { if (array_key_exists("edit", $setting) && $setting["edit"] @@ -157,6 +161,10 @@ public function getMimetypes(): array { */ public function getMimetypesOptional(): array { $mimes = array(); + if (!$this->config->isUserAllowedToUse()) { + return $mimes; + } + $formats = $this->config->FormatsSetting(); foreach ($formats as $format => $setting) { if (array_key_exists("edit", $setting) && $setting["edit"] @@ -174,6 +182,10 @@ public function getMimetypesOptional(): array { * @return array of ACreateFromTemplate|ACreateEmpty */ public function getCreators(): array { + if (!$this->config->isUserAllowedToUse()) { + return array(); + } + return [ new FileCreator($this->appName, $this->trans, $this->logger, "docx"), new FileCreator($this->appName, $this->trans, $this->logger, "xlsx"), @@ -194,7 +206,7 @@ public function isSecure(): bool { * Return a template response for displaying the editor * * open can only be called once when the client requests the editor with a one-time-use token - * For handling editing and later requests, editors need to impelement their own token handling + * For handling editing and later requests, editors need to implement their own token handling * and take care of invalidation * * @param IToken $token - one time token From ca730047d247ae9ec9cec826afaf39a63532013d Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 28 Jan 2020 13:24:23 +0300 Subject: [PATCH 2/2] 4.1.4 --- CHANGELOG.md | 4 ++++ appinfo/info.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06e7cf99..fc5df765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 4.1.4 +## Changed +- fix file opening in Nextcloud Android mobile application + ## 4.1.2 ## Changed - fix file opening with a sidebar diff --git a/appinfo/info.xml b/appinfo/info.xml index 811ae8a8..f4c8a4be 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,7 +6,7 @@ ONLYOFFICE connector enables you to edit Office documents within ONLYOFFICE from the familiar web interface. This will create a new Open in ONLYOFFICE action within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to your file storage. agpl Ascensio System SIA - 4.1.2 + 4.1.4 Onlyoffice