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

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Linnik <sergey.linnik@onlyoffice.com>2020-12-09 17:04:16 +0300
committerGitHub <noreply@github.com>2020-12-09 17:04:16 +0300
commit742b55ffb90caaa9d3718a41e6cb7a6baea5d175 (patch)
tree6b5f3f00d6c47b46fba867b387c5b3bddb10119e
parent7bdd9a68de1104292a9b9d4e2d868f4c508224c6 (diff)
parent17cb7606aef6ebbe9c9257c2468ba269a3a28898 (diff)
Merge pull request #414 from ONLYOFFICE/developv6.2.0
Release/6.2.0
-rw-r--r--CHANGELOG.md4
-rw-r--r--README.md8
-rw-r--r--appinfo/application.php2
-rw-r--r--appinfo/info.xml2
-rw-r--r--appinfo/routes.php3
-rw-r--r--controller/callbackcontroller.php31
-rw-r--r--controller/editorcontroller.php5
-rw-r--r--controller/federationcontroller.php43
-rw-r--r--css/main.css5
-rw-r--r--js/editor.js2
-rw-r--r--js/listener.js1
-rw-r--r--js/main.js16
-rw-r--r--js/settings.js2
-rw-r--r--js/viewer.js2
-rw-r--r--l10n/bg.js34
-rw-r--r--l10n/bg.json34
-rw-r--r--l10n/de.js2
-rw-r--r--l10n/de.json2
-rw-r--r--l10n/de_DE.js2
-rw-r--r--l10n/de_DE.json2
-rw-r--r--l10n/es.js2
-rw-r--r--l10n/es.json2
-rw-r--r--l10n/fr.js2
-rw-r--r--l10n/fr.json2
-rw-r--r--l10n/it.js4
-rw-r--r--l10n/it.json4
-rw-r--r--l10n/ja.js2
-rw-r--r--l10n/ja.json2
-rw-r--r--l10n/pl.js1
-rw-r--r--l10n/pl.json1
-rw-r--r--l10n/pt_BR.js2
-rw-r--r--l10n/pt_BR.json2
-rw-r--r--l10n/ru.js2
-rw-r--r--l10n/ru.json2
-rw-r--r--l10n/sv.js1
-rw-r--r--l10n/sv.json1
-rw-r--r--l10n/zh_CN.js2
-rw-r--r--l10n/zh_CN.json2
-rw-r--r--lib/documentservice.php2
-rw-r--r--lib/hooks.php2
-rw-r--r--lib/keymanager.php62
-rw-r--r--lib/preview.php5
-rw-r--r--templates/settings.php12
43 files changed, 249 insertions, 72 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1fa28d1..12779dc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 6.2.0
+## Changed
+- the ability to use forcesave for federated share files
+
## 6.1.0
## Added
- use guest name from talk
diff --git a/README.md b/README.md
index 5bb2c6e..f61458f 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,14 @@ Enable or disable the _Open file in the same tab_ setting.
The **Open in ONLYOFFICE** action will be added to the file context menu.
You can specify this action as default and it will be used when the file name is clicked for the selected file types.
+## Checking the connection
+
+You can check the connection to ONLYOFFICE Document Server by using the following occ command:
+
+`occ onlyoffice:documentserver --check`
+
+You will see a text either with information about the successful connection or the cause of the error.
+
## How it works
The ONLYOFFICE integration follows the API documented here https://api.onlyoffice.com/editors/basic:
diff --git a/appinfo/application.php b/appinfo/application.php
index f14d2c8..9fa2177 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -122,7 +122,7 @@ class Application extends App {
//todo: remove in v20
$detector = $container->query(IMimeTypeDetector::class);
$detector->getAllMappings();
- $detector->registerType("ott","application/vnd.oasis.opendocument.text-template");
+ $detector->registerType("ott", "application/vnd.oasis.opendocument.text-template");
$detector->registerType("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
$detector->registerType("otp", "application/vnd.oasis.opendocument.presentation-template");
diff --git a/appinfo/info.xml b/appinfo/info.xml
index c752bd0..28e9aa2 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -6,7 +6,7 @@
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.</description>
<licence>apache</licence>
<author mail="dev@onlyoffice.com" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
- <version>6.1.0</version>
+ <version>6.2.0</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 1a71352..f5ab6ec 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -38,6 +38,7 @@ return [
["name" => "settings#get_settings", "url" => "/ajax/settings", "verb" => "GET"],
],
"ocs" => [
- ["name" => "federation#key", "url" => "/api/v1/key", "verb" => "POST"]
+ ["name" => "federation#key", "url" => "/api/v1/key", "verb" => "POST"],
+ ["name" => "federation#keylock", "url" => "/api/v1/keylock", "verb" => "POST"]
]
]; \ No newline at end of file
diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php
index 00b9ed0..8659509 100644
--- a/controller/callbackcontroller.php
+++ b/controller/callbackcontroller.php
@@ -231,10 +231,10 @@ class CallbackController extends Controller {
if (isset($hashData->userId)) {
$userId = $hashData->userId;
- \OC_User::setUserId($userId);
$user = $this->userManager->get($userId);
if (!empty($user)) {
+ \OC_User::setUserId($userId);
\OC_Util::setupFS($userId);
}
}
@@ -445,10 +445,10 @@ class CallbackController extends Controller {
// author of the latest changes
$userId = $this->parseUserId($users[0]);
- \OC_User::setUserId($userId);
$user = $this->userManager->get($userId);
if (!empty($user)) {
+ \OC_User::setUserId($userId);
\OC_Util::setupFS($userId);
if ($userId === $hashData->userId) {
@@ -458,11 +458,11 @@ class CallbackController extends Controller {
if (empty($shareToken)) {
// author of the callback link
$userId = $hashData->userId;
- \OC_User::setUserId($userId);
$this->logger->debug("Track for $userId: $fileId status $status", ["app" => $this->appName]);
$user = $this->userManager->get($userId);
if (!empty($user)) {
+ \OC_User::setUserId($userId);
\OC_Util::setupFS($userId);
// path for author of the callback link
@@ -513,23 +513,28 @@ class CallbackController extends Controller {
$isForcesave = $status === self::TrackerStatus_ForceSave || $status === self::TrackerStatus_CorruptedForceSave;
- if ($isForcesave
- && $file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
- $this->logger->info("Track: $fileId status $status not allowed for external file", ["app" => $this->appName]);
- break;
+ if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
+ $isLock = KeyManager::lockFederatedKey($file, $isForcesave, null);
+ if ($isForcesave && !$isLock) {
+ break;
+ }
+ } else {
+ KeyManager::lock($fileId, $isForcesave);
}
- //lock the key when forcesave and unlock if last forcesave is broken
- KeyManager::lock($fileId, $isForcesave);
-
$this->logger->debug("Track put content " . $file->getPath(), ["app" => $this->appName]);
$this->retryOperation(function () use ($file, $newData) {
return $file->putContent($newData);
});
- //unlock key for future federated save
- KeyManager::lock($fileId, false);
- KeyManager::setForcesave($fileId, $isForcesave);
+ if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
+ if ($isForcesave) {
+ KeyManager::lockFederatedKey($file, false, $isForcesave);
+ }
+ } else {
+ KeyManager::lock($fileId, false);
+ KeyManager::setForcesave($fileId, $isForcesave);
+ }
if (!$isForcesave
&& !$prevIsForcesave
diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php
index 426e1ad..7222181 100644
--- a/controller/editorcontroller.php
+++ b/controller/editorcontroller.php
@@ -983,11 +983,6 @@ class EditorController extends Controller {
$params = $this->setCustomization($params);
- if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
- //otherwise forcesave will delete the key
- $params["editorConfig"]["customization"]["forcesave"] = false;
- }
-
$params = $this->setWatermark($params, !empty($shareToken), $userId, $file);
if ($this->config->UseDemo()) {
diff --git a/controller/federationcontroller.php b/controller/federationcontroller.php
index 5e98f78..7aa324b 100644
--- a/controller/federationcontroller.php
+++ b/controller/federationcontroller.php
@@ -27,9 +27,12 @@ use OCP\IRequest;
use OCP\ISession;
use OCP\Share\IManager;
+use OCA\Files_Sharing\External\Storage as SharingExternalStorage;
+
use OCA\Onlyoffice\AppConfig;
use OCA\Onlyoffice\DocumentService;
use OCA\Onlyoffice\FileUtility;
+use OCA\Onlyoffice\KeyManager;
/**
* OCS handler
@@ -108,4 +111,44 @@ class FederationController extends OCSController {
return new DataResponse(["key" => $key]);
}
+
+ /**
+ * Lock the origin document key for editor
+ *
+ * @param string $shareToken - access token
+ * @param string $path - file path
+ * @param bool $lock - status
+ * @param bool $fs - status
+ *
+ * @return DataResponse
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ * @PublicPage
+ */
+ public function keylock($shareToken, $path, $lock, $fs) {
+ list ($file, $error, $share) = $this->fileUtility->getFileByToken(null, $shareToken, $path);
+
+ if (isset($error)) {
+ $this->logger->error("Federated getFileByToken: $error", ["app" => $this->appName]);
+ return new DataResponse(["error" => $error]);
+ }
+
+ $fileId = $file->getId();
+
+ if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
+ $isLock = KeyManager::lockFederatedKey($file, $lock, $fs);
+ if (!$isLock) {
+ return new DataResponse(["error" => "Failed request"]);
+ }
+ } else {
+ KeyManager::lock($fileId, $lock);
+ if (!empty($fs)) {
+ KeyManager::setForcesave($fileId, $fs);
+ }
+ }
+
+ $this->logger->debug("Federated request lock for " . $fileId, ["app" => $this->appName]);
+ return new DataResponse();
+ }
}
diff --git a/css/main.css b/css/main.css
index 954b9fb..44e018d 100644
--- a/css/main.css
+++ b/css/main.css
@@ -66,6 +66,11 @@ body.onlyoffice-inline #content #app-content {
height: 50px;
}
+.onlyoffice-public-open {
+ display: inline-block;
+ margin-top: 10px;
+}
+
/* AscDesktopEditor */
.AscDesktopEditor #body-user #header {
display: none;
diff --git a/js/editor.js b/js/editor.js
index 784e6fd..4509c6c 100644
--- a/js/editor.js
+++ b/js/editor.js
@@ -418,6 +418,6 @@
});
};
- $(document).ready(OCA.Onlyoffice.InitEditor);
+ OCA.Onlyoffice.InitEditor();
})(jQuery, OCA);
diff --git a/js/listener.js b/js/listener.js
index e56318c..840088b 100644
--- a/js/listener.js
+++ b/js/listener.js
@@ -26,7 +26,6 @@
OCA.Onlyoffice.onRequestClose = function () {
$(OCA.Onlyoffice.frameSelector).remove();
- OCA.Onlyoffice.frameSelector = null;
if (OCA.Viewer && OCA.Viewer.close) {
OCA.Viewer.close();
diff --git a/js/main.js b/js/main.js
index 8fe6f0a..c4428e6 100644
--- a/js/main.js
+++ b/js/main.js
@@ -140,6 +140,8 @@
};
OCA.Onlyoffice.CloseEditor = function () {
+ OCA.Onlyoffice.frameSelector = null;
+
$("body").removeClass("onlyoffice-inline");
$("#onlyofficeHeader").remove();
@@ -151,9 +153,7 @@
OCA.Onlyoffice.folderUrl = null;
}
- if (OCA.Versions) {
- OCA.Onlyoffice.bindVersionClick();
- }
+ OCA.Onlyoffice.bindVersionClick();
};
OCA.Onlyoffice.OpenShareDialog = function () {
@@ -364,14 +364,14 @@
var button = document.createElement("a");
button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val()));
- button.className = "button";
+ button.className = "onlyoffice-public-open button";
button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE")
if (!OCA.Onlyoffice.setting.sameTab) {
button.target = "_blank";
}
- $("#preview").append(button);
+ $("#preview").prepend(button);
};
OCA.Onlyoffice.GetSettings(initSharedButton);
@@ -379,12 +379,10 @@
OC.Plugins.register("OCA.Files.FileList", OCA.Onlyoffice.FileList);
OC.Plugins.register("OCA.Files.NewFileMenu", OCA.Onlyoffice.NewFileMenu);
- if (OCA.Versions) {
- OCA.Onlyoffice.bindVersionClick();
- }
+ OCA.Onlyoffice.bindVersionClick();
}
};
- $(document).ready(initPage);
+ initPage();
})(OCA);
diff --git a/js/settings.js b/js/settings.js
index 7385535..ea1e9e8 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -200,7 +200,7 @@
var feedback = $("#onlyofficeFeedback").is(":checked");
var forcesave = $("#onlyofficeForcesave").is(":checked");
var help = $("#onlyofficeHelp").is(":checked");
- var toolbarNoTabs = !$("#onlyofficeToolbarNoTabs").is(":checked");
+ var toolbarNoTabs = $("#onlyofficeToolbarNoTabs").is(":checked");
var reviewDisplay = $("input[type='radio'][name='reviewDisplay']:checked").attr("id").replace("onlyofficeReviewDisplay_", "");
$.ajax({
diff --git a/js/viewer.js b/js/viewer.js
index e31a6ce..027af99 100644
--- a/js/viewer.js
+++ b/js/viewer.js
@@ -104,6 +104,6 @@
}
};
- $(document).ready(initPage)
+ initPage();
})(OCA);
diff --git a/l10n/bg.js b/l10n/bg.js
index 618cbe9..a65609e 100644
--- a/l10n/bg.js
+++ b/l10n/bg.js
@@ -45,12 +45,46 @@ OC.L10N.register(
"Save" : "Запази",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.",
"Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи",
+ "Server settings" : "Настройки на сървъра",
+ "Common settings" : "Общи настройки",
+ "Editor customization settings" : "Персонализиращи настройки на редактора",
+ "The customization section allows personalizing the editor interface" : "Разделът за персонализация позволява персонализиране на редакторския интерфейс",
+ "Display Chat menu button" : "Бутон за показване на Чат",
+ "Display the header more compact" : "По-компактно показване на заглавната част",
+ "Display Feedback & Support menu button" : "Показване на бутоните за Обратна връзка и Поддръжка",
+ "Display Help menu button" : "Показване на бутон за меню Помощ",
+ "Display monochrome toolbar header" : "Показване на монохромна заглавна лента с инструменти",
"Save as" : "Запази като",
"File saved" : "Файлът е запазен",
"Insert image" : "Вмъкване на изображение",
"Select recipients" : "Изберете получатели",
+ "Connect to demo ONLYOFFICE Document Server" : "Свързване с демо ONLYOFFICE Сървър за Документи",
+ "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Това е обществен тестов сървър, моля, не използвайте за чувствителни частни данни. Сървърът ще е на разположение по време на 30-дневния период.",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "30-дневният тестов период приключи, вече не можете да се свържете с демо ONLYOFFICE Сървър за Документи.",
+ "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Използвате обществения демо ONLYOFFICE Сървър за Документи. Моля, не съхранявайте чувствителни частни данни на него.",
+ "Secure view settings" : "Настройки за защитен изглед",
+ "Secure view enables you to secure documents by embedding a watermark" : "Защитеният изглед активира вашите защитени документи, като вгражда в тях воден знак",
+ "Enable watermarking" : "Активиране на воден знак",
+ "Watermark text" : "Текст на водния знак",
+ "DO NOT SHARE THIS" : "НЕ СПОДЕЛЯЙТЕ ТОВА",
+ "Show watermark on tagged files" : "Показване на водния знак на маркираните файлове",
+ "Show watermark for users of groups" : "Показване на водния знак за потребителите на групи",
+ "Supported placeholders" : "Поддържани заместители",
+ "Show watermark for all shares" : "Показване на водния знак за всички споделяния",
+ "Show watermark for read only shares" : "Показване на водния знак за споделяния само за четене",
+ "Link shares" : "Споделяния на линкове",
+ "Show watermark for all link shares" : "Показване на водния знак за всички споделяния на линкове",
+ "Show watermark for download hidden shares" : "Показване на водния знак за изтеглени скрити споделяния",
+ "Show watermark for read only link shares" : "Показване на водния знак за споделяния на линкове само за четене",
+ "Show watermark on link shares with specific system tags" : "Показване на водния знак за споделяния на линкове със специални системни маркировки",
"Select tag" : "Изберете етикет",
+ "Select file to compare" : "Изберете файл за сравнение",
+ "Review mode for viewing": "Режим на преглед за преглеждане",
+ "Markup": "Маркиране",
+ "Final": "Последни",
+ "Original": "Оригинални",
"version": "версия",
+ "Disable certificate verification (insecure)": "Деактивиране на проверката на сертификата (несигурно)",
"Keep intermediate versions when editing": "Съхранявайте междинни версии при редактиране",
"Generate document preview": "Генериране на визуализация на документ"
},
diff --git a/l10n/bg.json b/l10n/bg.json
index dd67604..6850ed2 100644
--- a/l10n/bg.json
+++ b/l10n/bg.json
@@ -43,12 +43,46 @@
"Save" : "Запази",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.",
"Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи",
+ "Server settings" : "Настройки на сървъра",
+ "Common settings" : "Общи настройки",
+ "Editor customization settings" : "Персонализиращи настройки на редактора",
+ "The customization section allows personalizing the editor interface" : "Разделът за персонализация позволява персонализиране на редакторския интерфейс",
+ "Display Chat menu button" : "Бутон за показване на Чат",
+ "Display the header more compact" : "По-компактно показване на заглавната част",
+ "Display Feedback & Support menu button" : "Показване на бутоните за Обратна връзка и Поддръжка",
+ "Display Help menu button" : "Показване на бутон за меню Помощ",
+ "Display monochrome toolbar header" : "Показване на монохромна заглавна лента с инструменти",
"Save as" : "Запази като",
"File saved" : "Файлът е запазен",
"Insert image" : "Вмъкване на изображение",
"Select recipients" : "Изберете получатели",
+ "Connect to demo ONLYOFFICE Document Server" : "Свързване с демо ONLYOFFICE Сървър за Документи",
+ "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." : "Това е обществен тестов сървър, моля, не използвайте за чувствителни частни данни. Сървърът ще е на разположение по време на 30-дневния период.",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "30-дневният тестов период приключи, вече не можете да се свържете с демо ONLYOFFICE Сървър за Документи.",
+ "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "Използвате обществения демо ONLYOFFICE Сървър за Документи. Моля, не съхранявайте чувствителни частни данни на него.",
+ "Secure view settings" : "Настройки за защитен изглед",
+ "Secure view enables you to secure documents by embedding a watermark" : "Защитеният изглед активира вашите защитени документи, като вгражда в тях воден знак",
+ "Enable watermarking" : "Активиране на воден знак",
+ "Watermark text" : "Текст на водния знак",
+ "DO NOT SHARE THIS" : "НЕ СПОДЕЛЯЙТЕ ТОВА",
+ "Show watermark on tagged files" : "Показване на водния знак на маркираните файлове",
+ "Show watermark for users of groups" : "Показване на водния знак за потребителите на групи",
+ "Supported placeholders" : "Поддържани заместители",
+ "Show watermark for all shares" : "Показване на водния знак за всички споделяния",
+ "Show watermark for read only shares" : "Показване на водния знак за споделяния само за четене",
+ "Link shares" : "Споделяния на линкове",
+ "Show watermark for all link shares" : "Показване на водния знак за всички споделяния на линкове",
+ "Show watermark for download hidden shares" : "Показване на водния знак за изтеглени скрити споделяния",
+ "Show watermark for read only link shares" : "Показване на водния знак за споделяния на линкове само за четене",
+ "Show watermark on link shares with specific system tags" : "Показване на водния знак за споделяния на линкове със специални системни маркировки",
"Select tag" : "Изберете етикет",
+ "Select file to compare" : "Изберете файл за сравнение",
+ "Review mode for viewing": "Режим на преглед за преглеждане",
+ "Markup": "Маркиране",
+ "Final": "Последни",
+ "Original": "Оригинални",
"version": "версия",
+ "Disable certificate verification (insecure)": "Деактивиране на проверката на сертификата (несигурно)",
"Keep intermediate versions when editing": "Съхранявайте междинни версии при редактиране",
"Generate document preview": "Генериране на визуализация на документ"
},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"
diff --git a/l10n/de.js b/l10n/de.js
index 077c31e..38b1c13 100644
--- a/l10n/de.js
+++ b/l10n/de.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Kompakten Header anzeigen",
"Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
"Display Help menu button" : "Hilfetaste anzeigen",
- "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen",
+ "Display monochrome toolbar header" : "Monochromen Kopfbereich der Symbolleiste anzeigen",
"Save as" : "Speichern als",
"File saved" : "Datei wurde gespeichert",
"Insert image" : "Bild einfügen",
diff --git a/l10n/de.json b/l10n/de.json
index 0580b93..4fc47a8 100644
--- a/l10n/de.json
+++ b/l10n/de.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Kompakten Header anzeigen",
"Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
"Display Help menu button" : "Hilfetaste anzeigen",
- "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen",
+ "Display monochrome toolbar header" : "Monochromen Kopfbereich der Symbolleiste anzeigen",
"Save as" : "Speichern als",
"File saved" : "Datei wurde gespeichert",
"Insert image" : "Bild einfügen",
diff --git a/l10n/de_DE.js b/l10n/de_DE.js
index 85547d3..2760f75 100644
--- a/l10n/de_DE.js
+++ b/l10n/de_DE.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Kompakten Header anzeigen",
"Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
"Display Help menu button" : "Hilfetaste anzeigen",
- "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen",
+ "Display monochrome toolbar header" : "Monochromen Kopfbereich der Symbolleiste anzeigen",
"Save as" : "Speichern als",
"File saved" : "Datei wurde gespeichert",
"Insert image" : "Bild einfügen",
diff --git a/l10n/de_DE.json b/l10n/de_DE.json
index d2c0966..74e7e7f 100644
--- a/l10n/de_DE.json
+++ b/l10n/de_DE.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Kompakten Header anzeigen",
"Display Feedback & Support menu button" : "Feedback-& Support-Taste anzeigen",
"Display Help menu button" : "Hilfetaste anzeigen",
- "Display toolbar tabs" : "Symbolleiste-Registerkarten anzeigen",
+ "Display monochrome toolbar header" : "Monochromen Kopfbereich der Symbolleiste anzeigen",
"Save as" : "Speichern als",
"File saved" : "Datei wurde gespeichert",
"Insert image" : "Bild einfügen",
diff --git a/l10n/es.js b/l10n/es.js
index f2e24ed..dbb0e77 100644
--- a/l10n/es.js
+++ b/l10n/es.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Mostrar el encabezado más compacto",
"Display Feedback & Support menu button" : "Mostrar el botón de Feedback y Soporte",
"Display Help menu button" : "Mostrar el botón de Ayuda",
- "Display toolbar tabs" : "Mostrar pestañas de barra de herramientas",
+ "Display monochrome toolbar header" : "Mostrar el encabezado monocromático de la barra de herramientas",
"Save as" : "Guardar como",
"File saved" : "El archivo ha sido guardado",
"Insert image" : "Insertar imagen",
diff --git a/l10n/es.json b/l10n/es.json
index bfe04a0..d9ee8b0 100644
--- a/l10n/es.json
+++ b/l10n/es.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Mostrar el encabezado más compacto",
"Display Feedback & Support menu button" : "Mostrar el botón de Feedback y Soporte",
"Display Help menu button" : "Mostrar el botón de Ayuda",
- "Display toolbar tabs" : "Mostrar pestañas de barra de herramientas",
+ "Display monochrome toolbar header" : "Mostrar el encabezado monocromático de la barra de herramientas",
"Save as" : "Guardar como",
"File saved" : "El archivo ha sido guardado",
"Insert image" : "Insertar imagen",
diff --git a/l10n/fr.js b/l10n/fr.js
index de5ad91..0ce77c1 100644
--- a/l10n/fr.js
+++ b/l10n/fr.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Afficher l'en-tête plus compact",
"Display Feedback & Support menu button" : "Afficher le bouton du menu 'Feedback & Support'",
"Display Help menu button" : "Afficher le bouton du menu 'Aide'",
- "Display toolbar tabs" : "Afficher les onglets de la barre d'outils",
+ "Display monochrome toolbar header" : "Afficher un en-tête monochrome de la barre d'outils",
"Save as" : "Enregistrer sous",
"File saved" : "Le fichier a été enregistré",
"Insert image" : "Insérer une image",
diff --git a/l10n/fr.json b/l10n/fr.json
index fa94c6f..070aba5 100644
--- a/l10n/fr.json
+++ b/l10n/fr.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Afficher l'en-tête plus compact",
"Display Feedback & Support menu button" : "Afficher le bouton du menu 'Feedback & Support'",
"Display Help menu button" : "Afficher le bouton du menu 'Aide'",
- "Display toolbar tabs" : "Afficher les onglets de la barre d'outils",
+ "Display monochrome toolbar header" : "Afficher un en-tête monochrome de la barre d'outils",
"Save as" : "Enregistrer sous",
"File saved" : "Le fichier a été enregistré",
"Insert image" : "Insérer une image",
diff --git a/l10n/it.js b/l10n/it.js
index dee11eb..e190c7c 100644
--- a/l10n/it.js
+++ b/l10n/it.js
@@ -45,7 +45,7 @@ OC.L10N.register(
"Save" : "Salva",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Il contenuto attivo misto non è consentito. È richiesto l'indirizzo HTTPS per Document Server.",
"Restrict access to editors to following groups" : "Limita l'accesso degli editor ai seguenti gruppi",
- "Server settings" : "Impostazioni del server" ,
+ "Server settings" : "Impostazioni del server",
"Common settings" : "Impostazioni comuni",
"Editor customization settings" : "Impostazioni di personalizzazione dell'editor",
"The customization section allows personalizing the editor interface": "La sezione di personalizzazione permette di personalizzare l'interfaccia dell'editor",
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Mostra l'intestazione più compatta",
"Display Feedback & Support menu button" : "Pulsante del menu Mostra feedback e supporto",
"Display Help menu button" : "Pulsante del menu Mostra guida",
- "Display toolbar tabs" : "Mostra le schede della barra degli strumenti",
+ "Display monochrome toolbar header" : "Visualizza intestazione della barra degli strumenti monocromatica",
"Save as" : "Salva come",
"File saved" : "File salvato",
"Insert image" : "Inserisci l'immagine",
diff --git a/l10n/it.json b/l10n/it.json
index ade3635..4c9c8ab 100644
--- a/l10n/it.json
+++ b/l10n/it.json
@@ -43,7 +43,7 @@
"Save" : "Salva",
"Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Il contenuto attivo misto non è consentito. È richiesto l'indirizzo HTTPS per Document Server.",
"Restrict access to editors to following groups" : "Limita l'accesso degli editor ai seguenti gruppi",
- "Server settings" : "Impostazioni del server" ,
+ "Server settings" : "Impostazioni del server",
"Common settings" : "Impostazioni comuni",
"Editor customization settings" : "Impostazioni di personalizzazione dell'editor",
"The customization section allows personalizing the editor interface": "La sezione di personalizzazione permette di personalizzare l'interfaccia dell'editor",
@@ -51,7 +51,7 @@
"Display the header more compact" : "Mostra l'intestazione più compatta",
"Display Feedback & Support menu button" : "Pulsante del menu Mostra feedback e supporto",
"Display Help menu button" : "Pulsante del menu Mostra guida",
- "Display toolbar tabs" : "Mostra le schede della barra degli strumenti",
+ "Display monochrome toolbar header" : "Visualizza intestazione della barra degli strumenti monocromatica",
"Save as" : "Salva come",
"File saved" : "File salvato",
"Insert image" : "Inserisci l'immagine",
diff --git a/l10n/ja.js b/l10n/ja.js
index 6536833..d666659 100644
--- a/l10n/ja.js
+++ b/l10n/ja.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "ヘッダーをよりコンパクトに表示",
"Display Feedback & Support menu button" : "フィードバックとサポートメニューホタンを表示",
"Display Help menu button" : "ヘルプメニューホタンを表示",
- "Display toolbar tabs" : "ツールバータブを表示",
+ "Display monochrome toolbar header" : "モノクローム・ツールバーヘッダーを表示する",
"Save as" : "別名で保存",
"File saved" : "ファイルが保存されました",
"Insert image" : "画像を挿入",
diff --git a/l10n/ja.json b/l10n/ja.json
index b5d2540..ea327fb 100644
--- a/l10n/ja.json
+++ b/l10n/ja.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "ヘッダーをよりコンパクトに表示",
"Display Feedback & Support menu button" : "フィードバックとサポートメニューホタンを表示",
"Display Help menu button" : "ヘルプメニューホタンを表示",
- "Display toolbar tabs" : "ツールバータブを表示",
+ "Display monochrome toolbar header" : "モノクローム・ツールバーヘッダーを表示する",
"Save as" : "別名で保存",
"File saved" : "ファイルが保存されました",
"Insert image" : "画像を挿入",
diff --git a/l10n/pl.js b/l10n/pl.js
index 9056e2f..e611966 100644
--- a/l10n/pl.js
+++ b/l10n/pl.js
@@ -53,7 +53,6 @@ OC.L10N.register(
"Display the header more compact" : "Wyświetlaj bardziej kompaktowy nagłówek",
"Display Feedback & Support menu button" : "Wyświetlaj Opinie i Support",
"Display Help menu button" : "Wyświetlaj menu pomocy",
- "Display toolbar tabs" : "Wyświetlaj wstążki",
"Save as" : "Zapisz jako",
"File saved" : "Plik zapisany",
"Insert image" : "Wstaw obraz",
diff --git a/l10n/pl.json b/l10n/pl.json
index 2c9fb3f..39aa1af 100644
--- a/l10n/pl.json
+++ b/l10n/pl.json
@@ -51,7 +51,6 @@
"Display the header more compact" : "Wyświetlaj bardziej kompaktowy nagłówek",
"Display Feedback & Support menu button" : "Wyświetlaj Opinie i Support",
"Display Help menu button" : "Wyświetlaj menu pomocy",
- "Display toolbar tabs" : "Wyświetlaj wstążki",
"Save as" : "Zapisz jako",
"File saved" : "Plik zapisany",
"Insert image" : "Wstaw obraz",
diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js
index b28b155..e7571dc 100644
--- a/l10n/pt_BR.js
+++ b/l10n/pt_BR.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Exibir o cabeçalho mais compacto",
"Display Feedback & Support menu button" : "Exibir o botão do menu de feedback e suporte",
"Display Help menu button" : "Exibir o botão do menu Ajuda",
- "Display toolbar tabs" : "Exibir guias da barra de ferramentas",
+ "Display monochrome toolbar header" : "Exibir cabeçalho da barra de ferramentas monocromático",
"Save as" : "Salvar como",
"File saved" : "O arquivo foi salvo",
"Insert image" : "Inserir imagem",
diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json
index 3dfb3b2..e2e7957 100644
--- a/l10n/pt_BR.json
+++ b/l10n/pt_BR.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Exibir o cabeçalho mais compacto",
"Display Feedback & Support menu button" : "Exibir o botão do menu de feedback e suporte",
"Display Help menu button" : "Exibir o botão do menu Ajuda",
- "Display toolbar tabs" : "Exibir guias da barra de ferramentas",
+ "Display monochrome toolbar header" : "Exibir cabeçalho da barra de ferramentas monocromático",
"Save as" : "Salvar como",
"File saved" : "O arquivo foi salvo",
"Insert image" : "Inserir imagem",
diff --git a/l10n/ru.js b/l10n/ru.js
index 5ccdb87..d6c652d 100644
--- a/l10n/ru.js
+++ b/l10n/ru.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "Отображать заголовок компактным",
"Display Feedback & Support menu button" : "Отображать кнопку Обратной связи и поддержки",
"Display Help menu button" : "Отображать кнопку справки",
- "Display toolbar tabs" : "Отображать вкладки панели инструментов",
+ "Display monochrome toolbar header" : "Отображать монохромный заголовок панели инструментов",
"Save as" : "Сохранить как",
"File saved" : "Файл сохранён",
"Insert image" : "Вставить изображение",
diff --git a/l10n/ru.json b/l10n/ru.json
index 551f57b..3118ed0 100644
--- a/l10n/ru.json
+++ b/l10n/ru.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "Отображать заголовок компактным",
"Display Feedback & Support menu button" : "Отображать кнопку Обратной связи и поддержки",
"Display Help menu button" : "Отображать кнопку справки",
- "Display toolbar tabs" : "Отображать вкладки панели инструментов",
+ "Display monochrome toolbar header" : "Отображать монохромный заголовок панели инструментов",
"Save as" : "Сохранить как",
"File saved" : "Файл сохранён",
"Insert image" : "Вставить изображение",
diff --git a/l10n/sv.js b/l10n/sv.js
index 1d668c5..62e62ad 100644
--- a/l10n/sv.js
+++ b/l10n/sv.js
@@ -53,7 +53,6 @@ OC.L10N.register(
"Display the header more compact" : "Visa kompakt sidhuvud",
"Display Feedback & Support menu button" : "Visa Feedback & Support i menyn",
"Display Help menu button" : "Visa hjälp i menyn",
- "Display toolbar tabs" : "Visa flikar i verktygsfältet",
"Save as" : "Spara som",
"File saved" : "Filen har sparats",
"Insert image" : "Infoga bild",
diff --git a/l10n/sv.json b/l10n/sv.json
index cface4e..1f9233e 100644
--- a/l10n/sv.json
+++ b/l10n/sv.json
@@ -51,7 +51,6 @@
"Display the header more compact" : "Visa kompakt sidhuvud",
"Display Feedback & Support menu button" : "Visa Feedback & Support i menyn",
"Display Help menu button" : "Visa hjälp i menyn",
- "Display toolbar tabs" : "Visa flikar i verktygsfältet",
"Save as" : "Spara som",
"File saved" : "Filen har sparats",
"Insert image" : "Infoga bild",
diff --git a/l10n/zh_CN.js b/l10n/zh_CN.js
index 01158e7..8a3ca54 100644
--- a/l10n/zh_CN.js
+++ b/l10n/zh_CN.js
@@ -53,7 +53,7 @@ OC.L10N.register(
"Display the header more compact" : "更紧致的显示菜单栏",
"Display Feedback & Support menu button" : "显示反馈&支持菜单按钮",
"Display Help menu button" : "显示帮助菜单按钮",
- "Display toolbar tabs" : "显示工具栏切签",
+ "Display monochrome toolbar header" : "显示单色工具栏标题",
"Save as" : "另存为",
"File saved" : "文件已保存",
"Insert image" : "插入图片",
diff --git a/l10n/zh_CN.json b/l10n/zh_CN.json
index dc00ad2..d2e3500 100644
--- a/l10n/zh_CN.json
+++ b/l10n/zh_CN.json
@@ -51,7 +51,7 @@
"Display the header more compact" : "更紧致的显示菜单栏",
"Display Feedback & Support menu button" : "显示反馈&支持菜单按钮",
"Display Help menu button" : "显示帮助菜单按钮",
- "Display toolbar tabs" : "显示工具栏切签",
+ "Display monochrome toolbar header" : "显示单色工具栏标题",
"Save as" : "另存为",
"File saved" : "文件已保存",
"Insert image" : "插入图片",
diff --git a/lib/documentservice.php b/lib/documentservice.php
index ea193b2..f3c751d 100644
--- a/lib/documentservice.php
+++ b/lib/documentservice.php
@@ -432,7 +432,7 @@ class DocumentService {
$convertedFileUri = $this->GetConvertedUri($fileUrl, "docx", "docx", "check_" . rand());
if (strcmp($convertedFileUri, $fileUrl) === 0) {
- $this->logger->debug("GetConvertedUri skipped", ["app" => $this->appName]);
+ $logger->debug("GetConvertedUri skipped", ["app" => $this->appName]);
}
} catch (\Exception $e) {
diff --git a/lib/hooks.php b/lib/hooks.php
index 586d8d1..b07c52f 100644
--- a/lib/hooks.php
+++ b/lib/hooks.php
@@ -87,6 +87,8 @@ class Hooks {
$fileId = $fileInfo->getId();
KeyManager::delete($fileId);
+
+ \OC::$server->getLogger()->debug("Hook fileUpdate " . json_encode($params), ["app" => self::$appName]);
}
/**
diff --git a/lib/keymanager.php b/lib/keymanager.php
index 3571696..7be503d 100644
--- a/lib/keymanager.php
+++ b/lib/keymanager.php
@@ -19,6 +19,7 @@
namespace OCA\Onlyoffice;
+use OCP\Files\File;
/**
* Key manager
@@ -28,6 +29,11 @@ namespace OCA\Onlyoffice;
class KeyManager {
/**
+ * App name
+ */
+ private const App_Name = "onlyoffice";
+
+ /**
* Table name
*/
private const TableName_Key = "onlyoffice_filekey";
@@ -94,7 +100,7 @@ class KeyManager {
* Change lock status
*
* @param integer $fileId - file identifier
- * @param integer $lock - status
+ * @param bool $lock - status
*
* @return bool
*/
@@ -112,7 +118,7 @@ class KeyManager {
* Change forcesave status
*
* @param integer $fileId - file identifier
- * @param integer $fs - status
+ * @param bool $fs - status
*
* @return bool
*/
@@ -147,4 +153,56 @@ class KeyManager {
return $fs === "1";
}
+
+ /**
+ * Change lock status in the federated share
+ *
+ * @param File $file - file
+ * @param bool $lock - status
+ * @param bool $fs - status
+ *
+ * @return bool
+ */
+ public static function lockFederatedKey($file, $lock, $fs) {
+ $logger = \OC::$server->getLogger();
+ $action = $lock ? "lock" : "unlock";
+
+ $remote = $file->getStorage()->getRemote();
+ $shareToken = $file->getStorage()->getToken();
+ $internalPath = $file->getInternalPath();
+
+ $httpClientService = \OC::$server->getHTTPClientService();
+ $client = $httpClientService->newClient();
+ $data = [
+ "timeout" => 5,
+ "body" => [
+ "shareToken" => $shareToken,
+ "path" => $internalPath,
+ "lock" => $lock
+ ]
+ ];
+ if (!empty($fs)) {
+ $data["body"]["fs"] = $fs;
+ }
+
+ try {
+ $response = $client->post($remote . "ocs/v2.php/apps/" . self::App_Name . "/api/v1/keylock?format=json", $data);
+ $body = \json_decode($response->getBody(), true);
+
+ $data = $body["ocs"]["data"];
+
+ if (empty($data)) {
+ $logger->debug("Federated request " . $action . " for " . $file->getFileInfo()->getId() . " is successful", ["app" => self::App_Name]);
+ return true;
+ }
+
+ if (!empty($data["error"])) {
+ $logger->error("Error " . $action . " federated key for " . $file->getFileInfo()->getId() . ": " . $data["error"], ["app" => self::App_Name]);
+ return false;
+ }
+ } catch (\Exception $e) {
+ $logger->logException($e, ["message" => "Failed to request federated " . $action . " for " . $file->getFileInfo()->getId(), "app" => self::App_Name]);
+ return false;
+ }
+ }
}
diff --git a/lib/preview.php b/lib/preview.php
index eb9c107..d8fb57c 100644
--- a/lib/preview.php
+++ b/lib/preview.php
@@ -213,7 +213,6 @@ class Preview extends Provider {
*/
public function getMimeType() {
$m = self::getMimeTypeRegex();
- $this->logger->debug("getMimeType $m", ["app" => $this->appName]);
return $m;
}
@@ -228,10 +227,10 @@ class Preview extends Provider {
if ($this->config->GetPreview() !== true) {
return false;
}
- if (!in_array($fileInfo->getMimetype(), self::$capabilities, true)) {
+ if (!$fileInfo || $fileInfo->getSize() === 0) {
return false;
}
- if (!$fileInfo || $fileInfo->getSize() === 0) {
+ if (!in_array($fileInfo->getMimetype(), self::$capabilities, true)) {
return false;
}
if ($fileInfo->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
diff --git a/templates/settings.php b/templates/settings.php
index 4e48e10..e2ea85c 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -22,11 +22,7 @@
if ($_["tagsEnabled"]) {
script("core", [
- "systemtags/systemtags",
- "systemtags/systemtagmodel",
- "systemtags/systemtagsmappingcollection",
- "systemtags/systemtagscollection",
- "systemtags/systemtagsinputfield",
+ "dist/systemtags",
]);
}
?>
@@ -186,8 +182,8 @@
<p>
<input type="checkbox" class="checkbox" id="onlyofficeToolbarNoTabs"
- <?php if (!$_["toolbarNoTabs"]) { ?>checked="checked"<?php } ?> />
- <label for="onlyofficeToolbarNoTabs"><?php p($l->t("Display toolbar tabs")) ?></label>
+ <?php if ($_["toolbarNoTabs"]) { ?>checked="checked"<?php } ?> />
+ <label for="onlyofficeToolbarNoTabs"><?php p($l->t("Display monochrome toolbar header")) ?></label>
</p>
<p class="onlyoffice-header">
@@ -303,4 +299,4 @@
<br />
<p><button id="onlyofficeWatermarkSave" class="button"><?php p($l->t("Save")) ?></button></p>
-</div> \ No newline at end of file
+</div>