From f6e36318f7253a424ff5267a85d77ddf22bdb8fe Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Apr 2019 11:36:19 +0300 Subject: [PATCH 01/23] changed sctipt sequence --- controller/editorcontroller.php | 18 ++++++------- js/main.js | 45 +++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index c3e1a888..0ba2c62e 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -485,6 +485,7 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals "document" => [ "fileType" => $ext, "key" => DocumentService::GenerateRevisionId($key), + "permissions" => [], "title" => $fileName, "url" => $fileUrl, ], @@ -494,8 +495,9 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals ] ]; - if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) { - $params["type"] = "mobile"; + $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); + if (isset($permissions_modifyFilter)) { + $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter; } $canEdit = isset($format["edit"]) && $format["edit"]; @@ -520,6 +522,10 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params["editorConfig"]["mode"] = "view"; } + if (\OC::$server->getRequest()->isUserAgent([$this::USER_AGENT_MOBILE])) { + $params["type"] = "mobile"; + } + if (!empty($userId)) { $params["editorConfig"]["user"] = [ "id" => $userId, @@ -569,14 +575,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params = $this->setCustomization($params); - $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); - if (isset($permissions_modifyFilter)) { - if (!array_key_exists("permissions", $params["document"])) { - $params["document"]["permissions"] = []; - } - $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter; - } - if (!empty($this->config->GetDocumentServerSecret())) { $token = \Firebase\JWT\JWT::encode($params, $this->config->GetDocumentServerSecret()); $params["token"] = $token; diff --git a/js/main.js b/js/main.js index 7b3825c0..d964209b 100644 --- a/js/main.js +++ b/js/main.js @@ -168,28 +168,28 @@ var register = function() { var formats = OCA.Onlyoffice.setting.formats; - $.each(formats, function (ext, attr) { - if (!attr.mime) { + $.each(formats, function (ext, config) { + if (!config.mime) { return true; } fileList.fileActions.registerAction({ name: "onlyofficeOpen", displayName: t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE"), - mime: attr.mime, + mime: config.mime, permissions: OC.PERMISSION_READ, iconClass: "icon-onlyoffice-open", actionHandler: OCA.Onlyoffice.FileClick }); - if (attr.def) { - fileList.fileActions.setDefault(attr.mime, "onlyofficeOpen"); + if (config.def) { + fileList.fileActions.setDefault(config.mime, "onlyofficeOpen"); } - if (attr.conv) { + if (config.conv) { fileList.fileActions.registerAction({ name: "onlyofficeConvert", displayName: t(OCA.Onlyoffice.AppName, "Convert with ONLYOFFICE"), - mime: attr.mime, + mime: config.mime, permissions: ($("#isPublic").val() ? OC.PERMISSION_UPDATE : OC.PERMISSION_READ), iconClass: "icon-onlyoffice-convert", actionHandler: OCA.Onlyoffice.FileConvertClick @@ -245,27 +245,34 @@ } }; - var initPage = function(){ + var getFileExtension = function (fileName) { + var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); + return extension; + } + + var initPage = function () { if ($("#isPublic").val() === "1" && !$("#filestable").length) { var fileName = $("#filename").val(); - var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); + var extension = getFileExtension(fileName); var initSharedButton = function() { var formats = OCA.Onlyoffice.setting.formats; - var conf = formats[extension]; - if (conf) { - var button = document.createElement("a"); - button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); - button.className = "button"; - button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") + var config = formats[extension]; + if (!config) { + return; + } - if (!OCA.Onlyoffice.setting.sameTab) { - button.target = "_blank"; - } + var button = document.createElement("a"); + button.href = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/s/" + encodeURIComponent($("#sharingToken").val())); + button.className = "button"; + button.innerText = t(OCA.Onlyoffice.AppName, "Open in ONLYOFFICE") - $("#preview").append(button); + if (!OCA.Onlyoffice.setting.sameTab) { + button.target = "_blank"; } + + $("#preview").append(button); }; OCA.Onlyoffice.GetSettings(initSharedButton); From 6bf9eba43b7a6109abb873160909ddba84841ecd Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Apr 2019 11:22:36 +0300 Subject: [PATCH 02/23] download permission --- controller/editorcontroller.php | 10 ++++++++++ js/main.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 0ba2c62e..64342be6 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -495,6 +495,16 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals ] ]; + $fileStorage = $file->getStorage(); + if (empty($token) && $fileStorage->instanceOfStorage("\OCA\Files_Sharing\SharedStorage")) { + $share = $fileStorage->getShare(); + + $permissionsDownload = $share->getAttributes()->getAttribute("permissions", "download"); + if ($permissionsDownload !== null) { + $params["document"]["permissions"]["download"] = $params["document"]["permissions"]["print"] = $permissionsDownload === true; + } + } + $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); if (isset($permissions_modifyFilter)) { $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter; diff --git a/js/main.js b/js/main.js index d964209b..9d08ee79 100644 --- a/js/main.js +++ b/js/main.js @@ -245,6 +245,35 @@ } }; + OCA.Onlyoffice.Share = { + attach: function (model) { + if (_.isUndefined(model)) { + return; + } + var fileName = model.getFileInfo().attributes.name; + + var extension = getFileExtension(fileName); + + var formats = OCA.Onlyoffice.setting.formats; + + var config = formats[extension]; + if (!config) { + return; + } + + var addDownload = model.getRegisteredShareAttributeLabel("permissions", "download") === null; + + if (addDownload) { + model.registerShareAttribute({ + "scope": "permissions", + "key": "download", + "default": true, + "label": t(OCA.Onlyoffice.AppName, "download"), + }); + } + } + }; + var getFileExtension = function (fileName) { var extension = fileName.substr(fileName.lastIndexOf(".") + 1).toLowerCase(); return extension; @@ -279,6 +308,7 @@ } else { OC.Plugins.register("OCA.Files.FileList", OCA.Onlyoffice.FileList); OC.Plugins.register("OCA.Files.NewFileMenu", OCA.Onlyoffice.NewFileMenu); + OC.Plugins.register("OC.Share.ShareItemModel", OCA.Onlyoffice.Share); } }; From aac2d54d1c3f5a48f59e8ddb7c76d8ea96517c51 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Apr 2019 12:03:50 +0300 Subject: [PATCH 03/23] review permission --- controller/editorcontroller.php | 8 ++++++++ js/main.js | 10 ++++++++++ lib/appconfig.php | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 64342be6..d9d2e7ce 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -503,6 +503,14 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals if ($permissionsDownload !== null) { $params["document"]["permissions"]["download"] = $params["document"]["permissions"]["print"] = $permissionsDownload === true; } + + if (isset($format["review"]) && $format["review"]) { + $permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "reviewOnly"); + if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) { + $params["document"]["permissions"]["edit"] = false; + $params["document"]["permissions"]["review"] = true; + } + } } $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); diff --git a/js/main.js b/js/main.js index 9d08ee79..d2678c81 100644 --- a/js/main.js +++ b/js/main.js @@ -271,6 +271,16 @@ "label": t(OCA.Onlyoffice.AppName, "download"), }); } + + if (config.review) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "reviewOnly", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "review only"), + "requiredPermissions": [OC.PERMISSION_UPDATE], + }); + } } }; diff --git a/lib/appconfig.php b/lib/appconfig.php index a92c1f9c..86ac3962 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -575,7 +575,7 @@ public function FormatsSetting() { "csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true, "editable" => true ], "doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], "docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ], - "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true ], + "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true ], "dot" => [ "type" => "text", "conv" => true ], "dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ], "epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ], From dabe576179cc74d3666aa9f5e0fa86ae8aca99d5 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Apr 2019 16:29:18 +0300 Subject: [PATCH 04/23] fillForms permissions # Conflicts: # l10n/ru.js # l10n/ru.json --- controller/editorcontroller.php | 8 ++++++++ js/main.js | 17 +++++++++++++++++ lib/appconfig.php | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index d9d2e7ce..267dd1da 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -511,6 +511,14 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params["document"]["permissions"]["review"] = true; } } + + if (isset($format["fillForms"]) && $format["fillForms"]) { + $permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillFormsOnly"); + if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) { + $params["document"]["permissions"]["edit"] = false; + $params["document"]["permissions"]["fillForms"] = true; + } + } } $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); diff --git a/js/main.js b/js/main.js index d2678c81..71c2841a 100644 --- a/js/main.js +++ b/js/main.js @@ -281,6 +281,23 @@ "requiredPermissions": [OC.PERMISSION_UPDATE], }); } + + if (config.fillForms) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "fillFormsOnly", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "filling forms only"), + "requiredPermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "reviewOnly", + "enabled": true + } + ] + }); + } } }; diff --git a/lib/appconfig.php b/lib/appconfig.php index 86ac3962..aa98d1e4 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -575,7 +575,7 @@ public function FormatsSetting() { "csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true, "editable" => true ], "doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], "docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ], - "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true ], + "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true, "fillForms" => true ], "dot" => [ "type" => "text", "conv" => true ], "dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ], "epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ], From 71db430e1e5b28b81cf0ef55819b7c3acca53c51 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Apr 2019 15:43:43 +0300 Subject: [PATCH 05/23] comment permission # Conflicts: # l10n/ru.js # l10n/ru.json --- controller/editorcontroller.php | 8 ++++++++ js/main.js | 22 ++++++++++++++++++++++ lib/appconfig.php | 5 +++-- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 267dd1da..6694634d 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -519,6 +519,14 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params["document"]["permissions"]["fillForms"] = true; } } + + if (isset($format["comment"]) && $format["comment"]) { + $permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "commentOnly"); + if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) { + $params["document"]["permissions"]["edit"] = false; + $params["document"]["permissions"]["comment"] = true; + } + } } $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); diff --git a/js/main.js b/js/main.js index 71c2841a..2a28418c 100644 --- a/js/main.js +++ b/js/main.js @@ -298,6 +298,28 @@ ] }); } + + if (config.comment) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "commentOnly", + "default": false, + "label": t(OCA.Onlyoffice.AppName, "comment only"), + "requiredPermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "reviewOnly", + "enabled": true + }, + { + "scope": OCA.Onlyoffice.AppName, + "key": "fillFormsOnly", + "enabled": true + } + ] + }); + } } }; diff --git a/lib/appconfig.php b/lib/appconfig.php index aa98d1e4..a0596981 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -576,6 +576,7 @@ public function FormatsSetting() { "doc" => [ "mime" => "application/msword", "type" => "text", "conv" => true ], "docm" => [ "mime" => "application/vnd.ms-word.document.macroEnabled.12", "type" => "text", "conv" => true ], "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true, "fillForms" => true ], + "docx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "text", "edit" => true, "def" => true, "review" => true, "fillForms" => true, "comment" => true ], "dot" => [ "type" => "text", "conv" => true ], "dotx" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "type" => "text", "conv" => true ], "epub" => [ "mime" => "application/epub+zip", "type" => "text", "conv" => true ], @@ -593,12 +594,12 @@ public function FormatsSetting() { "ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "conv" => true ], "ppt" => [ "mime" => "application/vnd.ms-powerpoint", "type" => "presentation", "conv" => true ], "pptm" => [ "mime" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12", "type" => "presentation", "conv" => true ], - "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true ], + "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true, "comment" => true ], "rtf" => [ "mime" => "text/rtf", "type" => "text", "conv" => true, "editable" => true ], "txt" => [ "mime" => "text/plain", "type" => "text", "edit" => true, "editable" => true ], "xls" => [ "mime" => "application/vnd.ms-excel", "type" => "spreadsheet", "conv" => true ], "xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], - "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true ], + "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true, "comment" => true ], "xlt" => [ "type" => "spreadsheet", "conv" => true ], "xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], "xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ] From 2fcb908f00e5544d696762befbbf3420936147c1 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 10 Apr 2019 14:54:10 +0300 Subject: [PATCH 06/23] download is incompatible with edit permission (owncloud/core#35001) --- js/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/main.js b/js/main.js index 2a28418c..fb590636 100644 --- a/js/main.js +++ b/js/main.js @@ -269,6 +269,7 @@ "key": "download", "default": true, "label": t(OCA.Onlyoffice.AppName, "download"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE] }); } From 2c66296d0ff729537bab1d00cdc3deda1e981abf Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 11 Apr 2019 16:56:11 +0300 Subject: [PATCH 07/23] fix getting domain for desktop --- js/desktop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/desktop.js b/js/desktop.js index 1590f3ad..f4e978c6 100644 --- a/js/desktop.js +++ b/js/desktop.js @@ -37,7 +37,7 @@ OCA.Onlyoffice.Desktop = true; $("html").addClass("AscDesktopEditor"); - var domain = location.href.split(OC.generateUrl(""))[0]; + var domain = new RegExp("^http(s)?:\/\/[^\/]+").exec(location)[0]; var data = { displayName: oc_user.displayName, From 4852c2193d0dbf7ecec77a18fbb3b887e6703a50 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 11 Apr 2019 16:57:04 +0300 Subject: [PATCH 08/23] fix domain for virtual path --- js/desktop.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/desktop.js b/js/desktop.js index f4e978c6..534a6db9 100644 --- a/js/desktop.js +++ b/js/desktop.js @@ -38,6 +38,7 @@ $("html").addClass("AscDesktopEditor"); var domain = new RegExp("^http(s)?:\/\/[^\/]+").exec(location)[0]; + domain += OC.getRootPath(); var data = { displayName: oc_user.displayName, From 4b0008f043dacaa038017ddc10fd6b1e354e9c6c Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 16 Apr 2019 10:44:38 +0300 Subject: [PATCH 09/23] retrieve file by owner --- controller/callbackcontroller.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index dccb139d..58908cab 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -373,26 +373,30 @@ public function track($doc, $users, $key, $status, $url, $token) { } try { + $ownerId = $hashData->ownerId; + $token = isset($hashData->token) ? $hashData->token : NULL; + if (empty($ownerId) && empty($token)) { + $this->logger->error("Track without owner: " . $fileId . " status " . $trackerStatus, array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("File owner is empty")], Http::STATUS_BAD_REQUEST); + } + $userId = $users[0]; $user = $this->userManager->get($userId); if (!empty($user)) { - \OC_Util::tearDownFS(); - \OC_Util::setupFS($userId); - $this->userSession->setUser($user); } else { - $ownerId = $hashData->ownerId; + $this->logger->debug("Track by anonymous " . $userId, array("app" => $this->appName)); + } - \OC_Util::tearDownFS(); - if (!empty($ownerId)) { - \OC_Util::setupFS($ownerId); - } + \OC_Util::tearDownFS(); + if (!empty($ownerId)) { + \OC_Util::setupFS($ownerId); } - $token = isset($hashData->token) ? $hashData->token : NULL; - list ($file, $error) = empty($token) ? $this->getFile($userId, $fileId) : $this->getFileByToken($fileId, $token); + list ($file, $error) = empty($token) ? $this->getFile($ownerId, $fileId) : $this->getFileByToken($fileId, $token); if (isset($error)) { + $this->logger->error("track error" . $fileId ." " . $error, array("app" => $this->appName)); return $error; } @@ -430,6 +434,8 @@ public function track($doc, $users, $key, $status, $url, $token) { } $newData = $documentService->Request($url); + + $this->logger->debug("Track put content " . $file->getPath(), array("app" => $this->appName)); $file->putContent($newData); $error = 0; } catch (\Exception $e) { From 233166089e315c7e0594e40dca6623c646c24680 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 15 Apr 2019 12:39:34 +0300 Subject: [PATCH 10/23] new permissions scheme --- controller/editorcontroller.php | 12 ++++++++---- js/main.js | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 6694634d..3c701120 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -495,6 +495,7 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals ] ]; + $restrictedEditing = false; $fileStorage = $file->getStorage(); if (empty($token) && $fileStorage->instanceOfStorage("\OCA\Files_Sharing\SharedStorage")) { $share = $fileStorage->getShare(); @@ -505,24 +506,27 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals } if (isset($format["review"]) && $format["review"]) { - $permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "reviewOnly"); + $permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "review"); if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) { + $restrictedEditing = true; $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["review"] = true; } } if (isset($format["fillForms"]) && $format["fillForms"]) { - $permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillFormsOnly"); + $permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillForms"); if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) { + $restrictedEditing = true; $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["fillForms"] = true; } } if (isset($format["comment"]) && $format["comment"]) { - $permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "commentOnly"); + $permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "comment"); if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) { + $restrictedEditing = true; $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["comment"] = true; } @@ -537,7 +541,7 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $canEdit = isset($format["edit"]) && $format["edit"]; $editable = $file->isUpdateable() && (empty($token) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE); - if ($editable && $canEdit) { + if (($editable || $restrictedEditing) && $canEdit) { $ownerId = NULL; $owner = $file->getOwner(); if (!empty($owner)) { diff --git a/js/main.js b/js/main.js index fb590636..4799d6fb 100644 --- a/js/main.js +++ b/js/main.js @@ -276,24 +276,24 @@ if (config.review) { model.registerShareAttribute({ "scope": OCA.Onlyoffice.AppName, - "key": "reviewOnly", + "key": "review", "default": false, - "label": t(OCA.Onlyoffice.AppName, "review only"), - "requiredPermissions": [OC.PERMISSION_UPDATE], + "label": t(OCA.Onlyoffice.AppName, "review"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], }); } if (config.fillForms) { model.registerShareAttribute({ "scope": OCA.Onlyoffice.AppName, - "key": "fillFormsOnly", + "key": "fillForms", "default": false, - "label": t(OCA.Onlyoffice.AppName, "filling forms only"), - "requiredPermissions": [OC.PERMISSION_UPDATE], + "label": t(OCA.Onlyoffice.AppName, "form filling"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], "incompatibleAttributes": [ { "scope": OCA.Onlyoffice.AppName, - "key": "reviewOnly", + "key": "review", "enabled": true } ] @@ -303,19 +303,19 @@ if (config.comment) { model.registerShareAttribute({ "scope": OCA.Onlyoffice.AppName, - "key": "commentOnly", + "key": "comment", "default": false, - "label": t(OCA.Onlyoffice.AppName, "comment only"), - "requiredPermissions": [OC.PERMISSION_UPDATE], + "label": t(OCA.Onlyoffice.AppName, "comment"), + "incompatiblePermissions": [OC.PERMISSION_UPDATE], "incompatibleAttributes": [ { "scope": OCA.Onlyoffice.AppName, - "key": "reviewOnly", + "key": "review", "enabled": true }, { "scope": OCA.Onlyoffice.AppName, - "key": "fillFormsOnly", + "key": "fillForms", "enabled": true } ] From 78f2a2945db5c1f5351df2eb13c90e068057c146 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 16 Apr 2019 12:15:53 +0300 Subject: [PATCH 11/23] edit permission --- controller/editorcontroller.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 3c701120..68b9c517 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -509,7 +509,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "review"); if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) { $restrictedEditing = true; - $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["review"] = true; } } @@ -518,7 +517,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillForms"); if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) { $restrictedEditing = true; - $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["fillForms"] = true; } } @@ -527,7 +525,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "comment"); if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) { $restrictedEditing = true; - $params["document"]["permissions"]["edit"] = false; $params["document"]["permissions"]["comment"] = true; } } @@ -541,6 +538,7 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $canEdit = isset($format["edit"]) && $format["edit"]; $editable = $file->isUpdateable() && (empty($token) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE); + $params["document"]["permissions"]["edit"] = $editable; if (($editable || $restrictedEditing) && $canEdit) { $ownerId = NULL; $owner = $file->getOwner(); From 184ea571612fcc770bffb1124d92014676179ca5 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 10 Apr 2019 11:51:43 +0300 Subject: [PATCH 12/23] modifyFilter permissions --- controller/editorcontroller.php | 7 +++++++ js/main.js | 17 +++++++++++++++++ lib/appconfig.php | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 68b9c517..c1ca184e 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -528,6 +528,13 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals $params["document"]["permissions"]["comment"] = true; } } + + if (isset($format["modifyFilter"]) && $format["modifyFilter"]) { + $permissionsModifyFilter = $share->getAttributes()->getAttribute($this->appName, "modifyFilter"); + if ($permissionsModifyFilter !== null) { + $params["document"]["permissions"]["modifyFilter"] = $permissionsModifyFilter === true; + } + } } $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); diff --git a/js/main.js b/js/main.js index 4799d6fb..01001191 100644 --- a/js/main.js +++ b/js/main.js @@ -321,6 +321,23 @@ ] }); } + + if (config.modifyFilter) { + model.registerShareAttribute({ + "scope": OCA.Onlyoffice.AppName, + "key": "modifyFilter", + "default": true, + "label": t(OCA.Onlyoffice.AppName, "modify filter"), + "requiredPermissions": [OC.PERMISSION_UPDATE], + "incompatibleAttributes": [ + { + "scope": OCA.Onlyoffice.AppName, + "key": "commentOnly", + "enabled": true + } + ] + }); + } } }; diff --git a/lib/appconfig.php b/lib/appconfig.php index a0596981..d92d7195 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -599,7 +599,7 @@ public function FormatsSetting() { "txt" => [ "mime" => "text/plain", "type" => "text", "edit" => true, "editable" => true ], "xls" => [ "mime" => "application/vnd.ms-excel", "type" => "spreadsheet", "conv" => true ], "xlsm" => [ "mime" => "application/vnd.ms-excel.sheet.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], - "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true, "comment" => true ], + "xlsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "spreadsheet", "edit" => true, "def" => true, "comment" => true, "modifyFilter" => true ], "xlt" => [ "type" => "spreadsheet", "conv" => true ], "xltm" => [ "mime" => "application/vnd.ms-excel.template.macroEnabled.12", "type" => "spreadsheet", "conv" => true ], "xltx" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "type" => "spreadsheet", "conv" => true ] From 413f18089cbb5de52cb9a917d16389c4d2dfa73b Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 16 Apr 2019 12:32:22 +0300 Subject: [PATCH 13/23] Revert old scheme "permissions modifyFilter" This reverts commit 327d3a8c37abbd28f8057e549536d7903d5c5466. --- controller/editorcontroller.php | 5 ----- lib/appconfig.php | 7 ------- 2 files changed, 12 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index c1ca184e..768372b7 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -537,11 +537,6 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals } } - $permissions_modifyFilter = $this->config->getSystemValue($this->config->_permissions_modifyFilter); - if (isset($permissions_modifyFilter)) { - $params["document"]["permissions"]["modifyFilter"] = $permissions_modifyFilter; - } - $canEdit = isset($format["edit"]) && $format["edit"]; $editable = $file->isUpdateable() && (empty($token) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE); diff --git a/lib/appconfig.php b/lib/appconfig.php index d92d7195..50f525db 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -144,13 +144,6 @@ class AppConfig { */ private $_settingsError = "settings_error"; - /** - * The config key for the modifyFilter - * - * @var string - */ - public $_permissions_modifyFilter = "permissions_modifyFilter"; - /** * The config key for the customer * From 283c8e15b038e17df9a32fef212f172b4ee55779 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 18 Apr 2019 19:07:33 +0300 Subject: [PATCH 14/23] change title in the convertation request --- lib/documentservice.php | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/documentservice.php b/lib/documentservice.php index afe94dc3..8fe75cf9 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -118,36 +118,32 @@ function GetConvertedUri($document_uri, $from_extension, $to_extension, $documen * @return array */ function SendRequestToConvertService($document_uri, $from_extension, $to_extension, $document_revision_id, $is_async) { - if (empty($from_extension)) { - $path_parts = pathinfo($document_uri); - $from_extension = $path_parts["extension"]; - } + $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false); - $title = basename($document_uri); - if (empty($title)) { - $title = $document_revision_id . $from_extension; + if (empty($documentServerUrl)) { + throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin")); } + $urlToConverter = $documentServerUrl . "ConvertService.ashx"; + if (empty($document_revision_id)) { $document_revision_id = $document_uri; } $document_revision_id = self::GenerateRevisionId($document_revision_id); - $documentServerUrl = $this->config->GetDocumentServerInternalUrl(false); - - if (empty($documentServerUrl)) { - throw new \Exception($this->trans->t("ONLYOFFICE app is not configured. Please contact admin")); + if (empty($from_extension)) { + $from_extension = pathinfo($document_uri)["extension"]; + } else { + $from_extension = trim($from_extension, "."); } - $urlToConverter = $documentServerUrl . "ConvertService.ashx"; - $data = [ "async" => $is_async, "url" => $document_uri, "outputtype" => trim($to_extension, "."), - "filetype" => trim($from_extension, "."), - "title" => $title, + "filetype" => $from_extension, + "title" => $document_revision_id . "." . $from_extension, "key" => $document_revision_id ]; From ecada9bd9086bd1132120772928e2745bba61108 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 22 Apr 2019 14:50:25 +0300 Subject: [PATCH 15/23] save after deleting pulbic link --- controller/callbackcontroller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index 58908cab..a6feba30 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -393,7 +393,7 @@ public function track($doc, $users, $key, $status, $url, $token) { \OC_Util::setupFS($ownerId); } - list ($file, $error) = empty($token) ? $this->getFile($ownerId, $fileId) : $this->getFileByToken($fileId, $token); + list ($file, $error) = !empty($ownerId) ? $this->getFile($ownerId, $fileId) : $this->getFileByToken($fileId, $token); if (isset($error)) { $this->logger->error("track error" . $fileId ." " . $error, array("app" => $this->appName)); From e68ae8c0e3cc70aed70cef17c19f3390eab2b0fb Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 22 Apr 2019 17:10:39 +0300 Subject: [PATCH 16/23] error type only if error --- js/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/settings.js b/js/settings.js index a8b48cb1..11af5f1d 100644 --- a/js/settings.js +++ b/js/settings.js @@ -117,7 +117,7 @@ ? (t(OCA.Onlyoffice.AppName, "Error when trying to connect") + " (" + response.error + ")") : t(OCA.Onlyoffice.AppName, "Settings have been successfully updated"); OC.Notification.show(message, { - type: "error", + type: response.error ? "error" : null, timeout: 3 }); } From fe41df3794defba49caf0c2275981f337d0fc82f Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 14 May 2019 17:35:10 +0300 Subject: [PATCH 17/23] fix https://github.com/owncloud/core/pull/35016/commits/4e165962939504cba98be64ed72e4ab328d00a75 --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 4799d6fb..38d56834 100644 --- a/js/main.js +++ b/js/main.js @@ -261,7 +261,7 @@ return; } - var addDownload = model.getRegisteredShareAttributeLabel("permissions", "download") === null; + var addDownload = model.getRegisteredShareAttribute("permissions", "download") === null; if (addDownload) { model.registerShareAttribute({ From 617100f0942aedaff4f408155609227559ead018 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 15 May 2019 17:51:16 +0300 Subject: [PATCH 18/23] Add info about DocumentServer editions --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index 200fbd35..ecc73651 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,69 @@ Or you can use Document Server behind a proxy, please refer to [this article](ht The easiest way to start an instance of ONLYOFFICE Document Server is to use [Docker](https://github.com/ONLYOFFICE/Docker-DocumentServer). +## ONLYOFFICE Document Server editions + +ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers. + +ONLYOFFICE Document Server: +* Community Edition (`onlyoffice-documentserver` package) + +* Integration Edition (`onlyoffice-documentserver-ie` package) + +The table below will help you to make the right choice. + +| Pricing and licensing | Community Edition | Integration Edition | +| ------------- | ------------- | ------------- | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/integration-edition-prices.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| Simultaneous connections | up to 20 maximum | As in chosen pricing plan | +| Number of users | up to 20 recommended | As in chosen pricing plan | +| License | GNU AGPL v.3 | Proprietary | +| **Support** | **Community Edition** | **Integration Edition** | +| Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) | +| Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included | +| Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| **Interface** | **Community Edition** | **Integration Edition** | +| Tabbed interface | - | + | +| White Label | - | - | +| Integrated test example (node.js)* | - | + | +| **Plugins & Macros** | **Community Edition** | **Integration Edition** | +| Plugins | + | + | +| Macros | + | + | +| **Collaborative capabilities** | **Community Edition** | **Integration Edition** | +| Two co-editing modes | + | + | +| Comments | + | + | +| Built-in chat | + | + | +| Review and tracking changes | + | + | +| Display modes of tracking changes | - | + | +| Version history | + | + | +| **Document Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Content control | - | + | +| Layout tools | + | + | +| Table of contents | + | + | +| Navigation panel | - | + | +| Mail Merge | + | + | +| **Spreadsheet Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Functions, formulas, equations | + | + | +| Table templates | + | + | +| Pivot tables | - | +** | +| **Presentation Editor features** | **Community Edition** | **Integration Edition** | +| Font and paragraph formatting | + | + | +| Object insertion | + | + | +| Animations | + | + | +| Presenter mode | - | + | +| Notes | + | + | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | + +\* Note that by default DocumentServer Community Edition does not contain any document management system. +Integration Edition and Developer Edition versions include integrated test examples (simplest DMS to test the editors). +For Community version, please use the [ONLYOFFICE Community Server](https://github.com/ONLYOFFICE/CommunityServer/) or [check out integration](https://www.onlyoffice.com/connectors.aspx) with 3rd party platforms, e.g. ownCloud/Nextcloud + +\** Changing style and deleting (Full support coming soon) ## Installing ownCloud ONLYOFFICE integration app From d590bbbc21b7428385000137ab2425b3d72bf496 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 15 May 2019 17:53:49 +0300 Subject: [PATCH 19/23] Add Table of Content to readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index ecc73651..3f0bc3bb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +* [ownCloud-ONLYOFFICE integration app](#-owncloud-onlyoffice-integration-app) +* [Installing ONLYOFFICE Document Server](#installing-onlyoffice-document-server) +* [ONLYOFFICE Document Server editions](#onlyoffice-document-server-editions) +* [Installing ownCloud ONLYOFFICE integration app](#installing-owncloud-onlyoffice-integration-app) +* [Configuring ownCloud-ONLYOFFICE integration app](#configuring-owncloud-onlyoffice-integration-app) +* [How it works](#how-it-works) +* [Known issues](#known-issues) + # ![](screenshots/icon.png) ownCloud ONLYOFFICE integration app This app enables users to edit office documents from [ownCloud](https://owncloud.com) using ONLYOFFICE Document Server. From f4335009f8659c70182c7114dea8703342f725a2 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 15 May 2019 18:03:13 +0300 Subject: [PATCH 20/23] Fix some markdown lint issues --- README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3f0bc3bb..2bf127f5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ * [How it works](#how-it-works) * [Known issues](#known-issues) -# ![](screenshots/icon.png) ownCloud ONLYOFFICE integration app +# ![onlyoffice icon](screenshots/icon.png) ownCloud ONLYOFFICE integration app This app enables users to edit office documents from [ownCloud](https://owncloud.com) using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: csv, docx, pptx, txt, xlsx. @@ -19,7 +19,6 @@ This allows multiple users to collaborate in real time and to save back those ch You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud)** to get installed and configured Document Server and ownCloud installation with a couple of commands. - ## Installing ONLYOFFICE Document Server You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from ownCloud and any end clients (version 4.2.7 and later are supported for use with the app). @@ -36,6 +35,7 @@ The easiest way to start an instance of ONLYOFFICE Document Server is to use [Do ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers. ONLYOFFICE Document Server: + * Community Edition (`onlyoffice-documentserver` package) * Integration Edition (`onlyoffice-documentserver-ie` package) @@ -49,7 +49,7 @@ The table below will help you to make the right choice. | Simultaneous connections | up to 20 maximum | As in chosen pricing plan | | Number of users | up to 20 recommended | As in chosen pricing plan | | License | GNU AGPL v.3 | Proprietary | -| **Support** | **Community Edition** | **Integration Edition** | +| **Support** | **Community Edition** | **Integration Edition** | | Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) | | Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included | | Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | @@ -105,7 +105,8 @@ If the server with the ownCloud installed does not have an Internet access, or i To start using ONLYOFFICE Document Server with ownCloud, the following steps must be performed: 1. Go to the ownCloud server _apps/_ directory (or some other directory [used](https://doc.owncloud.org/server/administration_manual/installation/apps_management_installation.html#using-custom-app-directories)): - ``` + + ```bash cd apps/ ``` @@ -116,27 +117,28 @@ There are several ways to do that: b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases) on GitHub. - c. Or you can clone the application source code and compile it yourself: - ``` + c. Or you can clone the application source code and compile it yourself: + + ```bash git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice ``` > ownCloud does not work with unsigned applications giving an alert, so you will need to use either option **a** or **b** to get the application. -2. Change the owner to update the application right from ownCloud web interface: - ``` +3. Change the owner to update the application right from ownCloud web interface: + + ```bash chown -R www-data:www-data onlyoffice ``` -3. In ownCloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. - +4. In ownCloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. ## Configuring ownCloud ONLYOFFICE integration app In ownCloud open the `~/index.php/settings/admin#onlyoffice` page with administrative settings for **ONLYOFFICE** section. Enter the following address to connect ONLYOFFICE Document Server: -``` +```bash https:/// ``` @@ -157,10 +159,9 @@ 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. - ## How it works -The ONLYOFFICE integration follows the API documented here https://api.onlyoffice.com/editors/basic: +The ONLYOFFICE integration follows the API documented [here](https://api.onlyoffice.com/editors/basic): * When creating a new file, the user navigates to a document folder within ownCloud and clicks the **Document**, **Spreadsheet** or **Presentation** item in the _new_ (+) menu. @@ -195,7 +196,6 @@ This method adds the copy of the file from the assets folder to the folder the u * ownCloud downloads the new version of the document, replacing the old one. - ## Known issues * If the document is shared using the **Federated Cloud Sharing** app, the co-editing among the servers will not be avaialble. @@ -213,9 +213,11 @@ However if you set the encryption with the _master key_, ONLYOFFICE application The instruction on enabling _master key_ based encryption is available in the official documentation on [ownCloud](https://doc.owncloud.org/server/administration_manual/configuration/files/encryption_configuration.html#enabling-encryption-from-the-command-line) websites. * If you are using a self-signed certificate for your **Document Server**, ownCloud will not validate such a certificate and will not allow connection to/from **Document Server**. This issue can be solved the following way: locate the ownCloud config file (_/owncloud/config/config.php_) and open it. Insert the following section to it: - ``` + + ```php 'onlyoffice' => array ( 'verify_peer_off' => true ) ``` + This will disable the certificate verification and allow ownCloud to establish connection with **Document Server**, but you must remember that this is a temporary insecure solution and we strongly recommend that you replace the certificate with the one issued by some CA. Once you do that, do not forget to remove the above section from ownCloud config file. From 820f3064a1629e5a95b8dbace73be159c7231686 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Thu, 16 May 2019 11:36:25 +0300 Subject: [PATCH 21/23] Port https://github.com/ONLYOFFICE/DocumentServer/pull/568 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2bf127f5..4b505e2e 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ The table below will help you to make the right choice. | Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) | | Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included | | Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubOwncloud) | +| **Services** | **Community Edition** | **Integration Edition** | +| Conversion Service | + | + | +| Document Builder Service | - | + | | **Interface** | **Community Edition** | **Integration Edition** | | Tabbed interface | - | + | | White Label | - | - | From a2559c0193d63e7695b6c0bd5a9fd55eea379f3d Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 14 May 2019 17:43:39 +0300 Subject: [PATCH 22/23] l10n --- l10n/bg_BG.js | 6 +++++- l10n/bg_BG.json | 6 +++++- l10n/de.js | 6 +++++- l10n/de.json | 6 +++++- l10n/de_DE.js | 6 +++++- l10n/de_DE.json | 6 +++++- l10n/es.js | 6 +++++- l10n/es.json | 6 +++++- l10n/fr.js | 6 +++++- l10n/fr.json | 6 +++++- l10n/pt_BR.js | 5 ++++- l10n/pt_BR.json | 5 ++++- l10n/ru.js | 7 ++++++- l10n/ru.json | 7 ++++++- l10n/sv.js | 5 ++++- l10n/sv.json | 5 ++++- 16 files changed, 78 insertions(+), 16 deletions(-) diff --git a/l10n/bg_BG.js b/l10n/bg_BG.js index ce01ee08..b53e6474 100644 --- a/l10n/bg_BG.js +++ b/l10n/bg_BG.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Виж детайли", "Save" : "Запази", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.", - "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи" + "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи", + "review" : "преглед", + "form filling" : "попълване на формуляр", + "comment" : "коментар", + "download" : "изтегли" }, "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/bg_BG.json b/l10n/bg_BG.json index 6da128ff..00fe1dc2 100644 --- a/l10n/bg_BG.json +++ b/l10n/bg_BG.json @@ -43,6 +43,10 @@ "View details" : "Виж детайли", "Save" : "Запази", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смесеното активно съдържание е недопустимо. За услугата за редактиране на документи е необходимо използването на HTTPS-адрес.", - "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи" + "Restrict access to editors to following groups" : "Разреши достъп до редакторите само за тези групи", + "review" : "преглед", + "form filling" : "попълване на формуляр", + "comment" : "коментар", + "download" : "изтегли" },"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);" } \ No newline at end of file diff --git a/l10n/de.js b/l10n/de.js index b578c2c8..1bd3681f 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index e29b9cef..567da631 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -43,6 +43,10 @@ "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/de_DE.js b/l10n/de_DE.js index 05c90da6..0423d9bc 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index 6cf04f71..94e9a6c7 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -43,6 +43,10 @@ "View details" : "Details anzeigen", "Save" : "Speichern", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich.", - "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren" + "Restrict access to editors to following groups" : "Den Zugriff auf Editoren auf folgende Gruppen gewähren", + "review" : "Review", + "form filling" : "ausfüllen von Formularen", + "comment" : "Kommentarе", + "download" : "herunterladen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/es.js b/l10n/es.js index e22b794c..8cc315aa 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Ver detalles", "Save" : "Guardar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.", - "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos" + "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos", + "review" : "revista", + "form filling" : "relleno de formulario", + "comment" : "comentarios", + "download" : "descargar" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/es.json b/l10n/es.json index 9c0922a4..4af2c218 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -43,6 +43,10 @@ "View details" : "Ver detalles", "Save" : "Guardar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para Servidor de Documentos.", - "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos" + "Restrict access to editors to following groups" : "Restringir el acceso a editores a siguientes grupos", + "review" : "revista", + "form filling" : "relleno de formulario", + "comment" : "comentarios", + "download" : "descargar" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index 6adddb8b..4f861d06 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -45,6 +45,10 @@ OC.L10N.register( "View details" : "Voir les détails", "Save" : "Enregistrer", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise", - "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants" + "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants", + "review" : "révision", + "form filling" : "remplissage de formulaire", + "comment" : "commentaire", + "download" : "télécharger" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/fr.json b/l10n/fr.json index b129788e..d75e3bc9 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -43,6 +43,10 @@ "View details" : "Voir les détails", "Save" : "Enregistrer", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le serveur de document est requise", - "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants" + "Restrict access to editors to following groups" : "Restreindre l'accès aux éditeurs pour les groupes suivants", + "review" : "révision", + "form filling" : "remplissage de formulaire", + "comment" : "commentaire", + "download" : "télécharger" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js index 40f74b98..28d36898 100644 --- a/l10n/pt_BR.js +++ b/l10n/pt_BR.js @@ -45,6 +45,9 @@ OC.L10N.register( "View details" : "Ver detalhes", "Save" : "Salvar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o Servidor de Documentos.", - "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos" + "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos", + "review" : "revisar", + "comment" : "comente", + "download" : "baixar" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json index d8164b02..a5f8b32b 100644 --- a/l10n/pt_BR.json +++ b/l10n/pt_BR.json @@ -43,6 +43,9 @@ "View details" : "Ver detalhes", "Save" : "Salvar", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o Servidor de Documentos.", - "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos" + "Restrict access to editors to following groups" : "Acesso apenas para os seguintes grupos", + "review" : "revisar", + "comment" : "comente", + "download" : "baixar" },"pluralForm" :"nplurals=2; plural=(n != 1);" } diff --git a/l10n/ru.js b/l10n/ru.js index b6ddd3e9..fc2b128a 100644 --- a/l10n/ru.js +++ b/l10n/ru.js @@ -45,6 +45,11 @@ OC.L10N.register( "View details" : "Подробнее", "Save" : "Сохранить", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.", - "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам" + "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам", + "review" : "рецензирование", + "form filling" : "заполнение форм", + "comment" : "комментирование", + "modify filter" : "изменять фильтр", + "download" : "скачивание" }, "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/ru.json b/l10n/ru.json index 58a53d24..71252887 100644 --- a/l10n/ru.json +++ b/l10n/ru.json @@ -43,6 +43,11 @@ "View details" : "Подробнее", "Save" : "Сохранить", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес.", - "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам" + "Restrict access to editors to following groups" : "Дать доступ к редакторам только следующим группам", + "review" : "рецензирование", + "form filling" : "заполнение форм", + "comment" : "комментирование", + "modify filter" : "изменять фильтр", + "download" : "скачивание" },"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);" } \ No newline at end of file diff --git a/l10n/sv.js b/l10n/sv.js index a0fbe381..8c5542e9 100644 --- a/l10n/sv.js +++ b/l10n/sv.js @@ -45,6 +45,9 @@ OC.L10N.register( "View details" : "Visa detaljer", "Save" : "Spara", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Blandat aktivt innehåll är inte tillåtet. HTTPS-adress till dokumentserver krävs.", - "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper" + "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper", + "review" : "granska", + "comment" : "kommentar", + "download" : "ladda ner" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/sv.json b/l10n/sv.json index 378eaea9..9e28e695 100644 --- a/l10n/sv.json +++ b/l10n/sv.json @@ -43,6 +43,9 @@ "View details" : "Visa detaljer", "Save" : "Spara", "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "Blandat aktivt innehåll är inte tillåtet. HTTPS-adress till dokumentserver krävs.", - "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper" + "Restrict access to editors to following groups" : "Begränsa åtkomst till följande grupper", + "review" : "granska", + "comment" : "kommentar", + "download" : "ladda ner" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file From fa182b82f03c0d29563d36011eda691d14934a92 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 27 May 2019 12:14:22 +0300 Subject: [PATCH 23/23] 2.2.1 --- CHANGELOG.md | 12 ++++++++++++ appinfo/info.xml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3529e00c..4b2616c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 2.2.1 +## Added +- download permission +- review permission +- filling forms permission +- comment permission +- modify filter permission + +## Changed +- fix getting domain for desktop +- title in the convertation request + ## 2.1.7 ## Added - file creation in public folder diff --git a/appinfo/info.xml b/appinfo/info.xml index 034a273c..abf79961 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -7,7 +7,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 - 2.1.7 + 2.2.1 Onlyoffice