From dd4401a31b9754573eaaa03bcb1b31333a957471 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Wed, 27 Oct 2021 11:58:59 +0300 Subject: [PATCH] versions history don't for external link --- controller/editorcontroller.php | 2 -- js/editor.js | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index a01ead4a..b146f052 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -667,7 +667,6 @@ public function save($name, $dir, $url) { * @return array * * @NoAdminRequired - * @PublicPage */ public function history($fileId, $shareToken = null) { $this->logger->debug("Request history for: $fileId", ["app" => $this->appName]); @@ -788,7 +787,6 @@ public function history($fileId, $shareToken = null) { * @return array * * @NoAdminRequired - * @PublicPage */ public function version($fileId, $version, $shareToken = null) { $this->logger->debug("Request version for: $fileId ($version)", ["app" => $this->appName]); diff --git a/js/editor.js b/js/editor.js index f5474ca3..71aa04d5 100644 --- a/js/editor.js +++ b/js/editor.js @@ -133,16 +133,6 @@ "onMakeActionLink": OCA.Onlyoffice.onMakeActionLink, }; - if (!OCA.Onlyoffice.template) { - config.events.onRequestHistory = OCA.Onlyoffice.onRequestHistory; - config.events.onRequestHistoryData = OCA.Onlyoffice.onRequestHistoryData; - config.events.onRequestRestore = OCA.Onlyoffice.onRequestRestore; - - if (!OCA.Onlyoffice.version) { - config.events.onRequestHistoryClose = OCA.Onlyoffice.onRequestHistoryClose; - } - } - if (config.editorConfig.tenant) { config.events.onAppReady = function () { OCA.Onlyoffice.docEditor.showMessage(t(OCA.Onlyoffice.AppName, "You are using public demo ONLYOFFICE Docs server. Please do not store private sensitive data.")); @@ -162,6 +152,16 @@ if (!OCA.Onlyoffice.filePath) { OCA.Onlyoffice.filePath = config._file_path; } + + if (!OCA.Onlyoffice.template) { + config.events.onRequestHistory = OCA.Onlyoffice.onRequestHistory; + config.events.onRequestHistoryData = OCA.Onlyoffice.onRequestHistoryData; + config.events.onRequestRestore = OCA.Onlyoffice.onRequestRestore; + + if (!OCA.Onlyoffice.version) { + config.events.onRequestHistoryClose = OCA.Onlyoffice.onRequestHistoryClose; + } + } } if (OCA.Onlyoffice.directEditor || OCA.Onlyoffice.inframe) {