From 8569c3161f5e88d5a91b2c3294690a7a071c3e34 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Sat, 13 May 2017 10:20:28 +0300 Subject: [PATCH 01/16] Adding a slash to the configuration saved in version 1.0.3 (Issue #63) --- README.md | 4 ++-- lib/appconfig.php | 1 + templates/settings.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 58ef6b7e..9a2132ee 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The easiest way to start an instance of ONLYOFFICE Document Server is to use [Do To start using ONLYOFFICE Document Server with ownCloud/Nextcloud, the following steps must be performed: -1. Place ownCloud/Nextcloud ONLYOFFICE integration app to your ownCloud/Nextcloud server into the _/apps_ (or some other) directory, [used](https://doc.owncloud.org/server/9.0/admin_manual/installation/apps_management_installation.html#using-custom-app-directories) to connect applications: +1. Place ownCloud/Nextcloud ONLYOFFICE integration app to your ownCloud/Nextcloud server into the _apps/_ (or some other) directory, [used](https://doc.owncloud.org/server/9.0/admin_manual/installation/apps_management_installation.html#using-custom-app-directories) to connect applications: ``` cd apps/ git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice @@ -33,7 +33,7 @@ git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice In ownCloud/Nextcloud open the `~/index.php/settings/admin#onlyoffice` page with administrative settings for **ONLYOFFICE** section. Enter the following address to connect ONLYOFFICE Document Server: ``` -https:// +https:/// ``` Where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed. The address must be accessible for the user browser and from the ownCloud/Nextcloud server. The ownCloud/Nextcloud server address must also be accessible from ONLYOFFICE Document Server for correct work. diff --git a/lib/appconfig.php b/lib/appconfig.php index 1dfae92f..0f2199dc 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -175,6 +175,7 @@ public function GetDocumentServerUrl() { if (empty($url)) { $url = $this->predefDocumentServerUrl; } + $url = rtrim($url, "/") . "/"; return $url; } diff --git a/templates/settings.php b/templates/settings.php index 1a0e1417..5943d4db 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -34,12 +34,12 @@

t("ONLYOFFICE Document Service Location specifies the address of the server with the document services installed. Please change the '' for the server address in the below line.")) ?>

t("Document Editing Service address")) ?>

- " placeholder="https://" type="text"> + " placeholder="https:///" type="text"> t("Advanced server settings")) ?>

t("Document Editing Service address for internal requests from the server")) ?>

- " placeholder="https://" type="text"> + " placeholder="https:///" type="text">

t("Server address for internal requests from the Document Editing Service")) ?>

" placeholder="" type="text"> From fb2a9ddf4c6b922d5bcae1565da6555a05eced5e Mon Sep 17 00:00:00 2001 From: alexandervnuchkov Date: Mon, 15 May 2017 11:41:57 +0300 Subject: [PATCH 02/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a2132ee..e7761c67 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This app enables users to edit office documents from [ownCloud](https://owncloud The app will create an item in the `new` (+) menu to create **Document**, **Spreadsheet**, **Presentation**. It will also create a new **Open in ONLYOFFICE** menu option within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to ownCloud/Nextcloud. - +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 From 1fe2a7f785958d685c62e13ae23fe72979ad7d85 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 16 May 2017 17:09:51 +0300 Subject: [PATCH 03/16] readme: change owner (Issue #66) --- README.md | 7 ++++++- controller/editorcontroller.php | 2 +- lib/crypt.php | 6 +++--- lib/documentservice.php | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e7761c67..182c135e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,12 @@ cd apps/ git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice ``` -2. In ownCloud/Nextcloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. +2. Change the owner to update the application right from ownCloud/Nextcloud web interface: +``` +chown -R www-data:www-data onlyoffice +``` + +3. In ownCloud/Nextcloud open the `~/index.php/settings/apps?category=disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application. diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index 53be5383..e0b37c4b 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -290,7 +290,7 @@ public function convert($fileId) { * Print editor section * * @param integer $fileId - file identifier - * + * * @return TemplateResponse * * @NoAdminRequired diff --git a/lib/crypt.php b/lib/crypt.php index a83a723e..1743dced 100644 --- a/lib/crypt.php +++ b/lib/crypt.php @@ -51,7 +51,7 @@ public function __construct(AppConfig $appConfig) { /** * Generate base64 hash for the object - * + * * @param array $object - object to signature hash * * @return string @@ -64,7 +64,7 @@ public function GetHash($object) { /** * Create an object from the base64 hash - * + * * @param string $hash - base64 hash * * @return array @@ -94,7 +94,7 @@ public function ReadHash($hash) { /** * Generate base64 hash for the object - * + * * @param string $primary_key - string to the signature hash * * @return string diff --git a/lib/documentservice.php b/lib/documentservice.php index d289403e..e3ee8f2d 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -78,7 +78,7 @@ public static function GenerateRevisionId($expected_key) { /** * The method is to convert the file to the required format and return the percentage of completion - * + * * @param string $document_uri - Uri for the document to convert * @param string $from_extension - Document extension * @param string $to_extension - Extension to which to convert From f116eb2cc6edf887d076f9b2f374bb82b05709a4 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 17 May 2017 14:57:03 +0300 Subject: [PATCH 04/16] verify jwt on download --- appinfo/application.php | 3 +++ controller/callbackcontroller.php | 38 +++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index 8e8d6d0e..41b13aee 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -73,6 +73,9 @@ public function __construct(array $urlParams = []) { } } + require_once __DIR__ . "/../3rdparty/jwt/BeforeValidException.php"; + require_once __DIR__ . "/../3rdparty/jwt/ExpiredException.php"; + require_once __DIR__ . "/../3rdparty/jwt/SignatureInvalidException.php"; require_once __DIR__ . "/../3rdparty/jwt/JWT.php"; $container = $this->getContainer(); diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index 8a534f19..de59665f 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -168,6 +168,23 @@ public function download($doc) { return new JSONResponse(["message" => $this->trans->t("Invalid request")], Http::STATUS_BAD_REQUEST); } + if (!empty($this->config->GetDocumentServerSecret())) { + $header = \OC::$server->getRequest()->getHeader("Authorization"); + if (empty($header)) { + $this->logger->info("Download without jwt", array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + + $header = substr($header, strlen("Bearer ")); + + try { + $decodedHeader = \Firebase\JWT\JWT::decode($header, $this->config->GetDocumentServerSecret(), array("HS256")); + } catch (\UnexpectedValueException $e) { + $this->logger->info("Download with invalid jwt: " . $e->getMessage(), array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + } + $fileId = $hashData->fileId; $ownerId = $hashData->ownerId; @@ -185,7 +202,7 @@ public function download($doc) { try { return new DataDownloadResponse($file->getContent(), $file->getName(), $file->getMimeType()); - } catch(\OCP\Files\NotPermittedException $e) { + } catch (\OCP\Files\NotPermittedException $e) { $this->logger->info("Download Not permitted: " . $fileId . " " . $e->getMessage(), array("app" => $this->appName)); return new JSONResponse(["message" => $this->trans->t("Not permitted")], Http::STATUS_FORBIDDEN); } @@ -216,6 +233,23 @@ public function emptyfile($doc) { return new JSONResponse(["message" => $this->trans->t("Invalid request")], Http::STATUS_BAD_REQUEST); } + if (!empty($this->config->GetDocumentServerSecret())) { + $header = \OC::$server->getRequest()->getHeader("Authorization"); + if (empty($header)) { + $this->logger->info("Download empty without jwt", array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + + $header = substr($header, strlen("Bearer ")); + + try { + $decodedHeader = \Firebase\JWT\JWT::decode($header, $this->config->GetDocumentServerSecret(), array("HS256")); + } catch (\UnexpectedValueException $e) { + $this->logger->info("Download empty with invalid jwt: " . $e->getMessage(), array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + } + $templatePath = dirname(__DIR__) . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "en" . DIRECTORY_SEPARATOR . "new.docx"; $template = file_get_contents($templatePath); @@ -226,7 +260,7 @@ public function emptyfile($doc) { try { return new DataDownloadResponse($template, "new.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); - } catch(\OCP\Files\NotPermittedException $e) { + } catch (\OCP\Files\NotPermittedException $e) { $this->logger->info("Download Not permitted: " . $fileId . " " . $e->getMessage(), array("app" => $this->appName)); return new JSONResponse(["message" => $this->trans->t("Not permitted")], Http::STATUS_FORBIDDEN); } From e2fe1b50714c2d8d8d2cacd2db89a153bb1b91be Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 17 May 2017 15:28:00 +0300 Subject: [PATCH 05/16] verify jwt on track --- controller/callbackcontroller.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index de59665f..bdc4b022 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -294,6 +294,30 @@ public function track($doc, $users, $key, $status, $url) { return new JSONResponse(["message" => $this->trans->t("Invalid request")], Http::STATUS_BAD_REQUEST); } + if (!empty($this->config->GetDocumentServerSecret())) { + $header = \OC::$server->getRequest()->getHeader("Authorization"); + if (empty($header)) { + $this->logger->info("Track without jwt", array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + + $header = substr($header, strlen("Bearer ")); + + try { + $decodedHeader = \Firebase\JWT\JWT::decode($header, $this->config->GetDocumentServerSecret(), array("HS256")); + $this->logger->debug("Track HEADER : " . json_encode($decodedHeader), array("app" => $this->appName)); + + $payload = $decodedHeader->payload; + $users = isset($payload->users) ? $payload->users : NULL; + $key = $payload->key; + $status = $payload->status; + $url = isset($payload->url) ? $payload->url : NULL; + } catch (\UnexpectedValueException $e) { + $this->logger->info("Track with invalid jwt: " . $e->getMessage(), array("app" => $this->appName)); + return new JSONResponse(["message" => $this->trans->t("Access deny")], Http::STATUS_FORBIDDEN); + } + } + $trackerStatus = $this->_trackerStatus[$status]; $error = 1; @@ -342,7 +366,7 @@ public function track($doc, $users, $key, $status, $url) { $from = $parsedUrl["scheme"] . "://" . $parsedUrl["host"] . (array_key_exists("port", $parsedUrl) ? (":" . $parsedUrl["port"]) : "") . "/"; } - $this->logger->debug("Replace in track from " . $from . " to " . $this->config->GetDocumentServerInternalUrl(true)); + $this->logger->debug("Replace in track from " . $from . " to " . $this->config->GetDocumentServerInternalUrl(true), array("app" => $this->appName)); $url = str_replace($from, $this->config->GetDocumentServerInternalUrl(true), $url); } From 879703410b30cd1a7371e627f82b7ebb03bbdb2e Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 17 May 2017 16:08:39 +0300 Subject: [PATCH 06/16] change adding script --- appinfo/application.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index 41b13aee..52b815f9 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -60,18 +60,14 @@ public function __construct(array $urlParams = []) { $this->crypt = new Crypt($this->appConfig); // Default script and style if configured - if (!empty($this->appConfig->GetDocumentServerUrl()) - && array_key_exists("REQUEST_URI", \OC::$server->getRequest()->server)) - { - $url = \OC::$server->getRequest()->server["REQUEST_URI"]; - - if (isset($url)) { - if (preg_match("%/apps/files(/.*)?%", $url)) { - Util::addScript($appName, "main"); - Util::addStyle($appName, "main"); + $eventDispatcher = \OC::$server->getEventDispatcher(); + $eventDispatcher->addListener("OCA\Files::loadAdditionalScripts", + function() { + if (!empty($this->appConfig->GetDocumentServerUrl())) { + Util::addScript("onlyoffice", "main"); + Util::addStyle("onlyoffice", "main"); } - } - } + }); require_once __DIR__ . "/../3rdparty/jwt/BeforeValidException.php"; require_once __DIR__ . "/../3rdparty/jwt/ExpiredException.php"; From fb2de72511eb4fc99c686f01af74349c4f790439 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 17 May 2017 16:12:36 +0300 Subject: [PATCH 07/16] fix remove connection to document server --- lib/appconfig.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/appconfig.php b/lib/appconfig.php index 0f2199dc..04e1a2ad 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -175,7 +175,12 @@ public function GetDocumentServerUrl() { if (empty($url)) { $url = $this->predefDocumentServerUrl; } - $url = rtrim($url, "/") . "/"; + if ($url != "/") { + $url = rtrim($url, "/"); + if (strlen($url) > 0) { + $url = $url . "/"; + } + } return $url; } From 99c5b5016c239d49452e536b9660ac0dae0dab6a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 17 May 2017 16:33:02 +0300 Subject: [PATCH 08/16] default name for new file --- js/main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/main.js b/js/main.js index 6d438047..87853aa8 100644 --- a/js/main.js +++ b/js/main.js @@ -174,6 +174,7 @@ menu.addMenuEntry({ id: "onlyofficeDocx", displayName: t(OCA.Onlyoffice.AppName, "Document"), + templateName: t(OCA.Onlyoffice.AppName, "Document"), iconClass: "icon-onlyoffice-new-docx", fileType: "docx", actionHandler: function (name) { @@ -184,6 +185,7 @@ menu.addMenuEntry({ id: "onlyofficeXlsx", displayName: t(OCA.Onlyoffice.AppName, "Spreadsheet"), + templateName: t(OCA.Onlyoffice.AppName, "Spreadsheet"), iconClass: "icon-onlyoffice-new-xlsx", fileType: "xlsx", actionHandler: function (name) { @@ -194,6 +196,7 @@ menu.addMenuEntry({ id: "onlyofficePpts", displayName: t(OCA.Onlyoffice.AppName, "Presentation"), + templateName: t(OCA.Onlyoffice.AppName, "Presentation"), iconClass: "icon-onlyoffice-new-pptx", fileType: "pptx", actionHandler: function (name) { From 9c0d4c88cb076d5583f5bfd2c3bc31ac3379f8e3 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 31 May 2017 18:10:53 +0300 Subject: [PATCH 09/16] get default value from server config --- lib/appconfig.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/appconfig.php b/lib/appconfig.php index 04e1a2ad..df25719a 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -175,6 +175,9 @@ public function GetDocumentServerUrl() { if (empty($url)) { $url = $this->predefDocumentServerUrl; } + if (empty($url)) { + $url = $this->config->getSystemValue($this->appName)[$this->_documentserver]; + } if ($url != "/") { $url = rtrim($url, "/"); if (strlen($url) > 0) { @@ -213,6 +216,9 @@ public function GetDocumentServerInternalUrl($origin) { if (empty($url)) { $url = $this->predefDocumentServerInternalUrl; } + if (empty($url)) { + $url = $this->config->getSystemValue($this->appName)[$this->_documentserverInternal]; + } if (!$origin && empty($url)) { $url = $this->GetDocumentServerUrl(); } @@ -248,6 +254,9 @@ public function GetStorageUrl() { if (empty($url)) { $url = $this->predefStorageUrl; } + if (empty($url)) { + $url = $this->config->getSystemValue($this->appName)[$this->_storageUrl]; + } return $url; } @@ -276,6 +285,9 @@ public function GetDocumentServerSecret() { if (empty($secret)) { $secret = $this->predefDocumentServerSecret; } + if (empty($secret)) { + $secret = $this->config->getSystemValue($this->appName)[$this->_secret]; + } return $secret; } From aa5c17aeac7d1ae3bcb2a43f51cda167ce02208f Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 1 Jun 2017 17:24:06 +0300 Subject: [PATCH 10/16] check for a system config --- lib/appconfig.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/appconfig.php b/lib/appconfig.php index df25719a..a4e93bcd 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -175,7 +175,7 @@ public function GetDocumentServerUrl() { if (empty($url)) { $url = $this->predefDocumentServerUrl; } - if (empty($url)) { + if (empty($url) && !empty($this->config->getSystemValue($this->appName))) { $url = $this->config->getSystemValue($this->appName)[$this->_documentserver]; } if ($url != "/") { @@ -216,7 +216,7 @@ public function GetDocumentServerInternalUrl($origin) { if (empty($url)) { $url = $this->predefDocumentServerInternalUrl; } - if (empty($url)) { + if (empty($url) && !empty($this->config->getSystemValue($this->appName))) { $url = $this->config->getSystemValue($this->appName)[$this->_documentserverInternal]; } if (!$origin && empty($url)) { @@ -254,7 +254,7 @@ public function GetStorageUrl() { if (empty($url)) { $url = $this->predefStorageUrl; } - if (empty($url)) { + if (empty($url) && !empty($this->config->getSystemValue($this->appName))) { $url = $this->config->getSystemValue($this->appName)[$this->_storageUrl]; } return $url; @@ -285,7 +285,7 @@ public function GetDocumentServerSecret() { if (empty($secret)) { $secret = $this->predefDocumentServerSecret; } - if (empty($secret)) { + if (empty($secret) && !empty($this->config->getSystemValue($this->appName))) { $secret = $this->config->getSystemValue($this->appName)[$this->_secret]; } return $secret; From b2b15836b31bef40cd42158f18cdae25b9fd7ff7 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Fri, 2 Jun 2017 13:42:13 +0300 Subject: [PATCH 11/16] Encryption module does not supported (Issue #26) --- controller/settingscontroller.php | 28 +++++++++++++++++++++++++++- css/settings.css | 3 +++ templates/settings.php | 7 +++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 906918ae..901f1bd6 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -26,6 +26,7 @@ namespace OCA\Onlyoffice\Controller; +use OCP\App; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\IL10N; @@ -124,7 +125,8 @@ public function index() { "secret" => $this->config->GetDocumentServerSecret(), "currentServer" => $this->urlGenerator->getAbsoluteURL("/"), "defFormats" => $defFormats, - "sameTab" => $this->config->GetSameTab() + "sameTab" => $this->config->GetSameTab(), + "encryption" => $this->checkEncryptionModule() ]; return new TemplateResponse($this->appName, "settings", $data, "blank"); } @@ -162,6 +164,10 @@ public function SaveSettings($documentserver, $this->config->SetDefaultFormats($defFormats); $this->config->SetSameTab($sameTab); + if ($this->checkEncryptionModule()) { + $this->logger->info("SaveSettings when encryption is enabled", array("app" => $this->appName)); + } + return [ "documentserver" => $this->config->GetDocumentServerUrl(), "documentserverInternal" => $this->config->GetDocumentServerInternalUrl(true), @@ -251,4 +257,24 @@ private function checkDocServiceUrl() { return ""; } + + /** + * Checking encryption enabled + */ + private function checkEncryptionModule() { + if (!App::isEnabled("encryption")) { + return false; + } + if (!\OC::$server->getEncryptionManager()->isEnabled()) { + return false; + } + + $crypt = new \OCA\Encryption\Crypto\Crypt(\OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getL10N('encryption')); + $util = new \OCA\Encryption\Util(new \OC\Files\View(), $crypt, \OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getUserManager()); + if ($util->isMasterKeyEnabled()) { + return false; + } + + return true; + } } diff --git a/css/settings.css b/css/settings.css index 8f56b07d..41461f73 100644 --- a/css/settings.css +++ b/css/settings.css @@ -43,3 +43,6 @@ cursor: pointer; text-decoration: none; } +.onlyoffice-error { + color: red; +} diff --git a/templates/settings.php b/templates/settings.php index 5943d4db..842aa94a 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -33,6 +33,13 @@

t("ONLYOFFICE Document Service Location specifies the address of the server with the document services installed. Please change the '' for the server address in the below line.")) ?>

+ +

+ t("Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.")) ?> + +

+ +

t("Document Editing Service address")) ?>

" placeholder="https:///" type="text"> From 382b114a0fde96d03f6c1216549a39628051490a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Fri, 2 Jun 2017 14:53:12 +0300 Subject: [PATCH 12/16] fix convert xlsx to csv v4.2.7 --- README.md | 4 ++-- lib/appconfig.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 182c135e..e614723a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![](screenshots/icon.png) ownCloud/Nextcloud ONLYOFFICE integration app -This app enables users to edit office documents from [ownCloud](https://owncloud.com)/[Nextcloud](https://nextcloud.com) using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: DOCX, XLSX, PPTX, TXT. The above mentioned formats are also available for viewing together with PDF and CSV. The edited files of the corresponding type can be converted into the Office Open XML formats: ODT, ODS, ODP, DOC, XLS, PPT, PPS, EPUB, RTF, HTML, HTM. +This app enables users to edit office documents from [ownCloud](https://owncloud.com)/[Nextcloud](https://nextcloud.com) using ONLYOFFICE Document Server. Currently the following document formats can be edited with this app: DOCX, XLSX, PPTX, TXT, CSV. The above mentioned formats are also available for viewing together with PDF. The edited files of the corresponding type can be converted into the Office Open XML formats: ODT, ODS, ODP, DOC, XLS, PPT, PPS, EPUB, RTF, HTML, HTM. The app will create an item in the `new` (+) menu to create **Document**, **Spreadsheet**, **Presentation**. It will also create a new **Open in ONLYOFFICE** menu option within the document library for Office documents. This allows multiple users to collaborate in real time and to save back those changes to ownCloud/Nextcloud. @@ -8,7 +8,7 @@ You can also use our **[Docker installation](https://github.com/ONLYOFFICE/docke ## Installing ONLYOFFICE Document Server -You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from ownCloud/Nextcloud and any end clients (version 4.2 and later are supported for use with the app). If that is not the case, use the official ONLYOFFICE Document Server documetnations page: [Document Server for Linux](http://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx). ONLYOFFICE Document Server must also be able to POST to ownCloud/Nextcloud directly. +You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from ownCloud/Nextcloud and any end clients (version 4.2.7 and later are supported for use with the app). If that is not the case, use the official ONLYOFFICE Document Server documetnations page: [Document Server for Linux](http://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx). ONLYOFFICE Document Server must also be able to POST to ownCloud/Nextcloud directly. The easiest way to start an instance of ONLYOFFICE Document Server is to use [Docker](https://github.com/ONLYOFFICE/Docker-DocumentServer). diff --git a/lib/appconfig.php b/lib/appconfig.php index a4e93bcd..3420b66e 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -369,7 +369,7 @@ public function GetSameTab() { "pptx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "presentation", "edit" => true, "def" => true ], "ppsx" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "type" => "presentation", "edit" => true, "def" => true ], "txt" => [ "mime" => "text/plain", "type" => "text", "edit" => true ], - "csv" => [ "mime" => "text/csv", "type" => "spreadsheet"/*, "edit" => true*/ ], + "csv" => [ "mime" => "text/csv", "type" => "spreadsheet", "edit" => true ], "odt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true ], "ods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true ], "odp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true ], From e0859e464c493192ac33e92424be44e13f2026fc Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 7 Jun 2017 17:38:35 +0300 Subject: [PATCH 13/16] setting up the filesystem for file owner (Issue #27) --- controller/callbackcontroller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index bdc4b022..872d2b49 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -328,6 +328,9 @@ public function track($doc, $users, $key, $status, $url) { $fileId = $hashData->fileId; $ownerId = $hashData->ownerId; + \OC_Util::tearDownFS(); + \OC_Util::setupFS($ownerId); + $files = $this->root->getUserFolder($ownerId)->getById($fileId); if (empty($files)) { $this->logger->info("Files for track not found: " . $fileId, array("app" => $this->appName)); From f1318e5eb88a4cf78a2dcb22836fe5d4a818a904 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 8 Jun 2017 11:54:38 +0300 Subject: [PATCH 14/16] change class name substitution --- lib/adminsettings.php | 3 ++- settings.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/adminsettings.php b/lib/adminsettings.php index 7ab7a2ae..143a9ea0 100644 --- a/lib/adminsettings.php +++ b/lib/adminsettings.php @@ -29,6 +29,7 @@ use OCP\Settings\ISettings; use OCA\Onlyoffice\AppInfo\Application; +use OCA\Onlyoffice\Controller\SettingsController; /** * Settings controller for the administration page @@ -64,7 +65,7 @@ public function getSectionID() { public function getForm() { $app = new Application(); $container = $app->getContainer(); - $response = $container->query("\OCA\Onlyoffice\Controller\SettingsController")->index(); + $response = $container->query(SettingsController::class)->index(); return $response; } diff --git a/settings.php b/settings.php index 93e11b28..e41fe6b3 100644 --- a/settings.php +++ b/settings.php @@ -29,11 +29,12 @@ use OCP\User; use OCA\Onlyoffice\AppInfo\Application; +use OCA\Onlyoffice\Controller\SettingsController; User::checkAdminUser(); $app = new Application(); $container = $app->getContainer(); -$response = $container->query("\OCA\Onlyoffice\Controller\SettingsController")->index(); +$response = $container->query(SettingsController::class)->index(); return $response->render(); From 03496ce97a5b6e8571efe647e00406308a9c22fa Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 8 Jun 2017 13:35:53 +0300 Subject: [PATCH 15/16] code check --- lib/appconfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appconfig.php b/lib/appconfig.php index 3420b66e..1a20a4dc 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -178,7 +178,7 @@ public function GetDocumentServerUrl() { if (empty($url) && !empty($this->config->getSystemValue($this->appName))) { $url = $this->config->getSystemValue($this->appName)[$this->_documentserver]; } - if ($url != "/") { + if ($url !== "/") { $url = rtrim($url, "/"); if (strlen($url) > 0) { $url = $url . "/"; From f001377ac8b7525f8cf88fca1a8909064d8d6efa Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 8 Jun 2017 13:36:32 +0300 Subject: [PATCH 16/16] 1.0.5 --- CHANGELOG.md | 13 +++++++++++++ appinfo/info.xml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c996a0a5..9417cad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 1.0.5 +### Added +- default name for new file +- getting default value from server config +- checking the encryption module + +### Changed +- included editing for csv format +- fix track activities and versions + +### Security +- jwt signature for inbox request from Document Server + ## 1.0.4 ### Added - advanced server settings for specifying internal addresses diff --git a/appinfo/info.xml b/appinfo/info.xml index e3866927..a5528b46 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -7,7 +7,7 @@ ONLYOFFICE integration app enables users to edit Office documents within ONLYOFFICE from OwnCloud. 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 OwnCloud. AGPL Ascensio System SIA - 1.0.4 + 1.0.5 Onlyoffice