diff --git a/3rd-Party.license b/3rd-Party.license
new file mode 100644
index 00000000..e284833d
--- /dev/null
+++ b/3rd-Party.license
@@ -0,0 +1,5 @@
+Nextcloud ONLYOFFICE integration app uses code from the following 3rd party projects:
+
+JWT - JSON Web Token implementation (https://github.com/firebase/php-jwt/blob/master/LICENSE)
+License: BSD
+License File: 3rdparty/jwt/LICENSE
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6b3f750..c06efc8a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,245 +1,257 @@
-# Change Log
-
-## 4.3.0
-## Added
-- integration to viewer app
-- show the version of the Document Service on the settings page
-
-## Changed
-- Nextcloud v16 is no longer supported
-- notification with toastify
-- proper header bar for public share links
-
-## 4.2.0
-## Added
-- review display settings
-
-## Changed
-- compatible with Nextcloud 19
-
-## 4.1.4
-## Changed
-- fix file opening in Nextcloud Android mobile application
-
-## 4.1.2
-## Changed
-- fix file opening with a sidebar
-- fix file opening in Nextcloud Android mobile application
-- fix file opening the federated file when watermark is enabled
-
-## 4.1.1
-## Changed
-- compatible with Nextcloud 16-17
-
-## 4.1.0
-## Added
-- inline editor if using the same tab, opening the sidebar, sharing from the editor
-- creating, editing and co-authoring files in Nextcloud Android mobile application
-- setting zoom and autosave
-- selection of a file for comparison (DocumentServer 5.5 required)
-
-## Changed
-- compatible with Nextcloud 18
-- Nextcloud v15 is no longer supported
-
-## 4.0.0
-## Added
-- Polish translation
-- British (en_GB) file templates
-
-## Changed
-- co-editing for federated share
-- Nextcloud v14 is no longer supported
-
-## 3.0.2
-## Changed
-- federated share saving fixed
-
-## 3.0.0
-## Added
-- "save as" to the folder
-- inserting images from the folder
-- Mail Merge
-- connection to the demo server
-- embedding a watermark
-
-## Changed
-- updated files for compatibility with MS Office v2016
-
-## 2.4.0
-## Added
-- compatibility with encryption
-
-## 2.3.0
-## Added
-- editor customization
-
-## Changed
-- the settings page is splitted into two sections
-- support master key encryption
-- fix getting domain for desktop
-- title in the convertation request
-
-## 2.1.10
-## Changed
-- compatible with Nextcloud 16
-
-## 2.1.6
-## Added
-- file creation in public folder
-- file convertion in public folder
-- Bulgarian translation
-- file templates in Dutch
-
-## Changed
-- fix editor size on mobile
-- fix php warning
-
-## 2.1.2
-## Added
-- restricting access for groups
-- goback from editor to shared folder by link
-
-## Changed
-- using notification methods
-- compatible with Nextcloud 15
-
-## 2.1.0
-## Added
-- Swedish translation
-- support token in the body
-- desktop mode
-
-## Changed
-- fix opening shared file by registered user
-- fix translations
-
-## 2.0.4
-## Added
-- opening for editing not OOXML
-
-## Changed
-- different keys for a file from different instances
-- replace hash generator to JWT
-
-## 2.0.2
-## Changed
-- deleted unsupported methods
-
-## 1.4.0
-## Added
-- transition from the editor to the list of files in the same tab
-- default action for all supported formats
-- redirect to the login page if are not logged in
-- a separate action to call the file conversion
-
-## Changed
-- improved checks when saving connection settings
-- expanded the list of formats
-- fixed exceptions when opening file shared by link
-
-## 1.3.0
-## Added
-- add macro-enabled and template formats
-- support shared link for document
-- customization editor
-
-## Changed
-- update template empty files
-- fix collaboration editing
-- view without converting
-
-## 1.2.0
-## Added
-- disabling for incorrect settings
-- Brazilian Poruguese translation
-- detecting mobile
-
-## Changed
-- initialization script
-- case sensitivity in extension
-- сreating files with an existing name
-
-## 1.1.6
-## Changed
-- update description
-
-## 1.1.5
-## Added
-- the ability to change the header key
-
-## Changed
-- fix opening file from external storage
-- fix opening federated shared file
-
-## 1.1.4
-## Added
-- extended list of languages for new files
-- work with self-signed certificates
-
-## Changed
-- files of new presentations
-- fix German l10n
-- changed verification of settings
-
-## 1.1.3
-## Added
-- fixing bug
-
-## 1.1.2
-## Added
-- translation
-- file name into page title
-
-## 1.1.1
-## Added
-- translation
-- signed code
-
-## 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
-- opening file editor in a same tab
-
-### Changed
-- setting default aplication for editable formats
-- new file on user language
-- compatible with Nextcloud 12
-
-## 1.0.3
-- compatible with ownCloud 10
-
-## 1.0.2
-### Added
-- logging
-- checking Document Server address on save
-- checking version of onlyoffice
-- set language of editor
-
-### Changed
-- replace own Response class to OCP\AppFramework\Http class from core
-
-### Security
-- jwt signature for request to Document Server
-
-## 1.0.1
-- fix exception when versions app is disabled
-- adding protocol to document server url
-- onlyofficeOpen is default action
-- Nextcloud 11 compatibility
-
-## 1.0.0
+# Change Log
+
+## 5.0.0
+## Added
+- support for OpenDocument Templates
+- Japanese translation
- certificate verification setting
+- version history
+
+## Changed
+- apache license
+- fix styles for desktop
+- loader page when creating a file
+- fix share tab opening
+
+## 4.3.0
+## Added
+- integration to viewer app
+- show the version of the Document Service on the settings page
+
+## Changed
+- Nextcloud v16 is no longer supported
+- notification with toastify
+- proper header bar for public share links
+
+## 4.2.0
+## Added
+- review display settings
+
+## Changed
+- compatible with Nextcloud 19
+
+## 4.1.4
+## Changed
+- fix file opening in Nextcloud Android mobile application
+
+## 4.1.2
+## Changed
+- fix file opening with a sidebar
+- fix file opening in Nextcloud Android mobile application
+- fix file opening the federated file when watermark is enabled
+
+## 4.1.1
+## Changed
+- compatible with Nextcloud 16-17
+
+## 4.1.0
+## Added
+- inline editor if using the same tab, opening the sidebar, sharing from the editor
+- creating, editing and co-authoring files in Nextcloud Android mobile application
+- setting zoom and autosave
+- selection of a file for comparison (DocumentServer 5.5 required)
+
+## Changed
+- compatible with Nextcloud 18
+- Nextcloud v15 is no longer supported
+
+## 4.0.0
+## Added
+- Polish translation
+- British (en_GB) file templates
+
+## Changed
+- co-editing for federated share
+- Nextcloud v14 is no longer supported
+
+## 3.0.2
+## Changed
+- federated share saving fixed
+
+## 3.0.0
+## Added
+- "save as" to the folder
+- inserting images from the folder
+- Mail Merge
+- connection to the demo server
+- embedding a watermark
+
+## Changed
+- updated files for compatibility with MS Office v2016
+
+## 2.4.0
+## Added
+- compatibility with encryption
+
+## 2.3.0
+## Added
+- editor customization
+
+## Changed
+- the settings page is splitted into two sections
+- support master key encryption
+- fix getting domain for desktop
+- title in the convertation request
+
+## 2.1.10
+## Changed
+- compatible with Nextcloud 16
+
+## 2.1.6
+## Added
+- file creation in public folder
+- file convertion in public folder
+- Bulgarian translation
+- file templates in Dutch
+
+## Changed
+- fix editor size on mobile
+- fix php warning
+
+## 2.1.2
+## Added
+- restricting access for groups
+- goback from editor to shared folder by link
+
+## Changed
+- using notification methods
+- compatible with Nextcloud 15
+
+## 2.1.0
+## Added
+- Swedish translation
+- support token in the body
+- desktop mode
+
+## Changed
+- fix opening shared file by registered user
+- fix translations
+
+## 2.0.4
+## Added
+- opening for editing not OOXML
+
+## Changed
+- different keys for a file from different instances
+- replace hash generator to JWT
+
+## 2.0.2
+## Changed
+- deleted unsupported methods
+
+## 1.4.0
+## Added
+- transition from the editor to the list of files in the same tab
+- default action for all supported formats
+- redirect to the login page if are not logged in
+- a separate action to call the file conversion
+
+## Changed
+- improved checks when saving connection settings
+- expanded the list of formats
+- fixed exceptions when opening file shared by link
+
+## 1.3.0
+## Added
+- add macro-enabled and template formats
+- support shared link for document
+- customization editor
+
+## Changed
+- update template empty files
+- fix collaboration editing
+- view without converting
+
+## 1.2.0
+## Added
+- disabling for incorrect settings
+- Brazilian Poruguese translation
+- detecting mobile
+
+## Changed
+- initialization script
+- case sensitivity in extension
+- сreating files with an existing name
+
+## 1.1.6
+## Changed
+- update description
+
+## 1.1.5
+## Added
+- the ability to change the header key
+
+## Changed
+- fix opening file from external storage
+- fix opening federated shared file
+
+## 1.1.4
+## Added
+- extended list of languages for new files
+- work with self-signed certificates
+
+## Changed
+- files of new presentations
+- fix German l10n
+- changed verification of settings
+
+## 1.1.3
+## Added
+- fixing bug
+
+## 1.1.2
+## Added
+- translation
+- file name into page title
+
+## 1.1.1
+## Added
+- translation
+- signed code
+
+## 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
+- opening file editor in a same tab
+
+### Changed
+- setting default aplication for editable formats
+- new file on user language
+- compatible with Nextcloud 12
+
+## 1.0.3
+- compatible with ownCloud 10
+
+## 1.0.2
+### Added
+- logging
+- checking Document Server address on save
+- checking version of onlyoffice
+- set language of editor
+
+### Changed
+- replace own Response class to OCP\AppFramework\Http class from core
+
+### Security
+- jwt signature for request to Document Server
+
+## 1.0.1
+- fix exception when versions app is disabled
+- adding protocol to document server url
+- onlyofficeOpen is default action
+- Nextcloud 11 compatibility
+
+## 1.0.0
- Initial release
\ No newline at end of file
diff --git a/README.md b/README.md
index 99f82ded..d5adf3e1 100644
--- a/README.md
+++ b/README.md
@@ -65,11 +65,11 @@ There are several ways to do that:
```
chown -R www-data:www-data onlyoffice
```
-3. In Nextcloud open the `~/index.php/settings/apps/disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application.
+3. In Nextcloud open the `~/settings/apps/disabled` page with _Not enabled_ apps by administrator and click _Enable_ for the **ONLYOFFICE** application.
## Configuring Nextcloud ONLYOFFICE integration app
-In Nextcloud open the `~/index.php/settings/admin/onlyoffice` page with administrative settings for **ONLYOFFICE** section.
+In Nextcloud open the `~/settings/admin/onlyoffice` page with administrative settings for **ONLYOFFICE** section.
Enter the following address to connect ONLYOFFICE Document Server:
```
diff --git a/appinfo/app.php b/appinfo/app.php
index caef6e5f..9d8621f8 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/appinfo/application.php b/appinfo/application.php
index ebe7595e..3cd25c41 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -32,6 +22,7 @@
use OCP\AppFramework\App;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\DirectEditing\RegisterDirectEditorEvent;
+use OCP\Files\IMimeTypeDetector;
use OCP\Util;
use OCA\Viewer\Event\LoadViewer;
@@ -42,6 +33,7 @@
use OCA\Onlyoffice\Controller\SettingsController;
use OCA\Onlyoffice\Crypt;
use OCA\Onlyoffice\DirectEditor;
+use OCA\Onlyoffice\Hooks;
class Application extends App {
@@ -70,7 +62,7 @@ public function __construct(array $urlParams = []) {
// Default script and style if configured
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener("OCA\Files::loadAdditionalScripts",
- function() {
+ function () {
if (!empty($this->appConfig->GetDocumentServerUrl())
&& $this->appConfig->SettingsAreSuccessful()
&& $this->appConfig->isUserAllowedToUse()) {
@@ -87,7 +79,7 @@ function() {
if (class_exists(LoadViewer::class)) {
$eventDispatcher->addListener(LoadViewer::class,
- function() {
+ function () {
if (!empty($this->appConfig->GetDocumentServerUrl())
&& $this->appConfig->SettingsAreSuccessful()
&& $this->appConfig->isUserAllowedToUse()) {
@@ -105,7 +97,7 @@ function() {
}
$eventDispatcher->addListener("OCA\Files_Sharing::loadAdditionalScripts",
- function() {
+ function () {
if (!empty($this->appConfig->GetDocumentServerUrl())
&& $this->appConfig->SettingsAreSuccessful()) {
Util::addScript("onlyoffice", "main");
@@ -125,32 +117,40 @@ function() {
$container = $this->getContainer();
- $container->registerService("L10N", function($c) {
+ //todo: remove in v20
+ $detector = $container->query(IMimeTypeDetector::class);
+ $detector->getAllMappings();
+ $detector->registerType("ott","application/vnd.oasis.opendocument.text-template");
+ $detector->registerType("ots", "application/vnd.oasis.opendocument.spreadsheet-template");
+ $detector->registerType("otp", "application/vnd.oasis.opendocument.presentation-template");
+
+
+ $container->registerService("L10N", function ($c) {
return $c->query("ServerContainer")->getL10N($c->query("AppName"));
});
- $container->registerService("RootStorage", function($c) {
+ $container->registerService("RootStorage", function ($c) {
return $c->query("ServerContainer")->getRootFolder();
});
- $container->registerService("UserSession", function($c) {
+ $container->registerService("UserSession", function ($c) {
return $c->query("ServerContainer")->getUserSession();
});
- $container->registerService("UserManager", function($c) {
+ $container->registerService("UserManager", function ($c) {
return $c->query("ServerContainer")->getUserManager();
});
- $container->registerService("Logger", function($c) {
+ $container->registerService("Logger", function ($c) {
return $c->query("ServerContainer")->getLogger();
});
- $container->registerService("URLGenerator", function($c) {
+ $container->registerService("URLGenerator", function ($c) {
return $c->query("ServerContainer")->getURLGenerator();
});
if (class_exists("OCP\DirectEditing\RegisterDirectEditorEvent")) {
- $container->registerService("DirectEditor", function($c) {
+ $container->registerService("DirectEditor", function ($c) {
return new DirectEditor(
$c->query("AppName"),
$c->query("URLGenerator"),
@@ -173,7 +173,7 @@ function (RegisterDirectEditorEvent $event) use ($container) {
// Controllers
- $container->registerService("SettingsController", function($c) {
+ $container->registerService("SettingsController", function ($c) {
return new SettingsController(
$c->query("AppName"),
$c->query("Request"),
@@ -185,7 +185,7 @@ function (RegisterDirectEditorEvent $event) use ($container) {
);
});
- $container->registerService("EditorController", function($c) {
+ $container->registerService("EditorController", function ($c) {
return new EditorController(
$c->query("AppName"),
$c->query("Request"),
@@ -198,12 +198,11 @@ function (RegisterDirectEditorEvent $event) use ($container) {
$this->appConfig,
$this->crypt,
$c->query("IManager"),
- $c->query("Session"),
- $c->query("ClientService")
+ $c->query("Session")
);
});
- $container->registerService("CallbackController", function($c) {
+ $container->registerService("CallbackController", function ($c) {
return new CallbackController(
$c->query("AppName"),
$c->query("Request"),
@@ -217,5 +216,8 @@ function (RegisterDirectEditorEvent $event) use ($container) {
$c->query("IManager")
);
});
+
+
+ Hooks::connectHooks();
}
}
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 892e02e8..8f3f885f 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -4,9 +4,9 @@
ONLYOFFICEONLYOFFICE connectorONLYOFFICE 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
+ apacheAscensio System SIA
- 4.3.0
+ 5.0.0Onlyoffice
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 89c80423..1a71352d 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -32,6 +22,7 @@
["name" => "callback#download", "url" => "/download", "verb" => "GET"],
["name" => "callback#emptyfile", "url" => "/empty", "verb" => "GET"],
["name" => "callback#track", "url" => "/track", "verb" => "POST"],
+ ["name" => "editor#loader", "url" => "/loader", "verb" => "GET"],
["name" => "editor#index", "url" => "/{fileId}", "verb" => "GET"],
["name" => "editor#public_page", "url" => "/s/{shareToken}", "verb" => "GET"],
["name" => "editor#config", "url" => "/ajax/config/{fileId}", "verb" => "GET"],
@@ -39,6 +30,8 @@
["name" => "editor#convert", "url" => "/ajax/convert", "verb" => "POST"],
["name" => "editor#save", "url" => "/ajax/save", "verb" => "POST"],
["name" => "editor#url", "url" => "/ajax/url", "verb" => "GET"],
+ ["name" => "editor#history", "url" => "/ajax/history", "verb" => "GET"],
+ ["name" => "editor#version", "url" => "/ajax/version", "verb" => "GET"],
["name" => "settings#save_address", "url" => "/ajax/settings/address", "verb" => "PUT"],
["name" => "settings#save_common", "url" => "/ajax/settings/common", "verb" => "PUT"],
["name" => "settings#save_watermark", "url" => "/ajax/settings/watermark", "verb" => "PUT"],
diff --git a/assets/ja/new.docx b/assets/ja/new.docx
new file mode 100644
index 00000000..6047d13c
Binary files /dev/null and b/assets/ja/new.docx differ
diff --git a/assets/ja/new.pptx b/assets/ja/new.pptx
new file mode 100644
index 00000000..d1ff1475
Binary files /dev/null and b/assets/ja/new.pptx differ
diff --git a/assets/ja/new.xlsx b/assets/ja/new.xlsx
new file mode 100644
index 00000000..d4a6c026
Binary files /dev/null and b/assets/ja/new.xlsx differ
diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php
index 555cfab1..8742ce6e 100644
--- a/controller/callbackcontroller.php
+++ b/controller/callbackcontroller.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -47,9 +37,12 @@
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
+use OCA\Files_Versions\Versions\IVersionManager;
+
use OCA\Onlyoffice\AppConfig;
use OCA\Onlyoffice\Crypt;
use OCA\Onlyoffice\DocumentService;
+use OCA\Onlyoffice\FileVersions;
/**
* Callback handler for the document server.
@@ -114,6 +107,13 @@ class CallbackController extends Controller {
*/
private $shareManager;
+ /**
+ * File version manager
+ *
+ * @var IVersionManager
+ */
+ private $versionManager;
+
/**
* Status of the document
*
@@ -160,6 +160,14 @@ public function __construct($AppName,
$this->config = $config;
$this->crypt = $crypt;
$this->shareManager = $shareManager;
+
+ if (\OC::$server->getAppManager()->isInstalled("files_versions")) {
+ try {
+ $this->versionManager = \OC::$server->query(IVersionManager::class);
+ } catch (QueryException $e) {
+ $this->logger->logException($e, ["message" => "VersionManager init error", "app" => $this->appName]);
+ }
+ }
}
@@ -188,9 +196,12 @@ public function download($doc) {
}
$fileId = $hashData->fileId;
- $this->logger->debug("Download: $fileId", ["app" => $this->appName]);
+ $version = isset($hashData->version) ? $hashData->version : null;
+ $changes = isset($hashData->changes) ? $hashData->changes : false;
+ $this->logger->debug("Download: $fileId ($version)" . ($changes ? " changes" : ""), ["app" => $this->appName]);
- if (!$this->userSession->isLoggedIn()) {
+ if (!$this->userSession->isLoggedIn()
+ && !$changes) {
if (!empty($this->config->GetDocumentServerSecret())) {
$header = \OC::$server->getRequest()->getHeader($this->config->JwtHeader());
if (empty($header)) {
@@ -209,22 +220,25 @@ public function download($doc) {
}
}
+ $userId = null;
if ($this->userSession->isLoggedIn()) {
$userId = $this->userSession->getUser()->getUID();
} else {
\OC_Util::tearDownFS();
- $userId = $hashData->userId;
- \OC_User::setUserId($userId);
+ if (isset($hashData->userId)) {
+ $userId = $hashData->userId;
+ \OC_User::setUserId($userId);
- $user = $this->userManager->get($userId);
- if (!empty($user)) {
- \OC_Util::setupFS($userId);
+ $user = $this->userManager->get($userId);
+ if (!empty($user)) {
+ \OC_Util::setupFS($userId);
+ }
}
}
$shareToken = isset($hashData->shareToken) ? $hashData->shareToken : null;
- list ($file, $error) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->getFileByToken($fileId, $shareToken);
+ list ($file, $error) = empty($shareToken) ? $this->getFile($userId, $fileId, null, $changes ? null : $version) : $this->getFileByToken($fileId, $shareToken, $changes ? null : $version);
if (isset($error)) {
return $error;
@@ -235,10 +249,42 @@ public function download($doc) {
return new JSONResponse(["message" => $this->trans->t("Access denied")], Http::STATUS_FORBIDDEN);
}
+ if ($changes) {
+ if ($this->versionManager === null) {
+ $this->logger->error("Download changes: versionManager is null", ["app" => $this->appName]);
+ return new JSONResponse(["message" => $this->trans->t("Invalid request")], Http::STATUS_BAD_REQUEST);
+ }
+
+ $owner = $file->getFileInfo()->getOwner();
+ if ($owner === null) {
+ $this->logger->error("Download: changes owner of $fileId was not found", ["app" => $this->appName]);
+ return new JSONResponse(["message" => $this->trans->t("Files not found")], Http::STATUS_NOT_FOUND);
+ }
+
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+
+ $versionId = null;
+ if ($version > count($versions)) {
+ $versionId = $file->getFileInfo()->getMtime();
+ } else {
+ $fileVersion = array_values($versions)[$version - 1];
+
+ $versionId = $fileVersion->getRevisionId();
+ }
+
+ $changesFile = FileVersions::getChangesFile($owner->getUID(), $fileId, $versionId);
+ if ($changesFile === null) {
+ $this->logger->error("Download: changes $fileId ($version) was not found", ["app" => $this->appName]);
+ return new JSONResponse(["message" => $this->trans->t("Files not found")], Http::STATUS_NOT_FOUND);
+ }
+
+ $file = $changesFile;
+ }
+
try {
return new DataDownloadResponse($file->getContent(), $file->getName(), $file->getMimeType());
} catch (NotPermittedException $e) {
- $this->logger->logException($e, ["message" => "Download Not permitted: $fileId", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Download Not permitted: $fileId ($version)", "app" => $this->appName]);
return new JSONResponse(["message" => $this->trans->t("Not permitted")], Http::STATUS_FORBIDDEN);
}
return new JSONResponse(["message" => $this->trans->t("Download failed")], Http::STATUS_INTERNAL_SERVER_ERROR);
@@ -312,6 +358,8 @@ public function emptyfile($doc) {
* @param integer $status - the edited status
* @param string $url - the link to the edited document to be saved
* @param string $token - request signature
+ * @param array $history - file history
+ * @param string $changesurl - link to file changes
*
* @return array
*
@@ -320,7 +368,7 @@ public function emptyfile($doc) {
* @PublicPage
* @CORS
*/
- public function track($doc, $users, $key, $status, $url, $token) {
+ public function track($doc, $users, $key, $status, $url, $token, $history, $changesurl) {
list ($hashData, $error) = $this->crypt->ReadHash($doc);
if ($hashData === null) {
@@ -424,6 +472,7 @@ public function track($doc, $users, $key, $status, $url, $token) {
$url = $this->config->ReplaceDocumentServerUrlToInternal($url);
+ $prevVersion = $file->getFileInfo()->getMtime();
$fileName = $file->getName();
$curExt = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
$downloadExt = strtolower(pathinfo($url, PATHINFO_EXTENSION));
@@ -444,13 +493,22 @@ public function track($doc, $users, $key, $status, $url, $token) {
$newData = $documentService->Request($url);
$this->logger->debug("Track put content " . $file->getPath(), ["app" => $this->appName]);
- $this->retryOperation(function () use ($file, $newData){
+ $this->retryOperation(function () use ($file, $newData) {
return $file->putContent($newData);
});
+ if ($this->versionManager !== null) {
+ $changes = null;
+ if (!empty($changesurl)) {
+ $changesurl = $this->config->ReplaceDocumentServerUrlToInternal($changesurl);
+ $changes = $documentService->Request($changesurl);
+ }
+ FileVersions::saveHistory($file->getFileInfo(), $history, $changes, $prevVersion);
+ }
+
$result = 0;
} catch (\Exception $e) {
- $this->logger->logException($e, ["message" => "Track $trackerStatus error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Track: $fileId status $trackerStatus error", "app" => $this->appName]);
}
break;
@@ -472,10 +530,11 @@ public function track($doc, $users, $key, $status, $url, $token) {
* @param string $userId - user identifier
* @param integer $fileId - file identifier
* @param string $filePath - file path
+ * @param integer $version - file version
*
* @return array
*/
- private function getFile($userId, $fileId, $filePath = null) {
+ private function getFile($userId, $fileId, $filePath = null, $version = 0) {
if (empty($fileId)) {
return [null, new JSONResponse(["message" => $this->trans->t("FileId is empty")], Http::STATUS_BAD_REQUEST)];
}
@@ -509,6 +568,27 @@ private function getFile($userId, $fileId, $filePath = null) {
return [null, new JSONResponse(["message" => $this->trans->t("File not found")], Http::STATUS_NOT_FOUND)];
}
+ if ($version > 0 && $this->versionManager !== null) {
+ $owner = $file->getFileInfo()->getOwner();
+
+ if ($owner !== null) {
+ if ($owner->getUID() !== $userId) {
+ list ($file, $error) = $this->getFile($owner->getUID(), $file->getId());
+
+ if (isset($error)) {
+ return [null, $error];
+ }
+ }
+
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+
+ if ($version <= count($versions)) {
+ $fileVersion = array_values($versions)[$version - 1];
+ $file = $this->versionManager->getVersionFile($owner, $file->getFileInfo(), $fileVersion->getRevisionId());
+ }
+ }
+ }
+
return [$file, null];
}
@@ -517,10 +597,11 @@ private function getFile($userId, $fileId, $filePath = null) {
*
* @param integer $fileId - file identifier
* @param string $shareToken - access token
+ * @param integer $version - file version
*
* @return array
*/
- private function getFileByToken($fileId, $shareToken) {
+ private function getFileByToken($fileId, $shareToken, $version = 0) {
list ($share, $error) = $this->getShare($shareToken);
if (isset($error)) {
@@ -550,6 +631,19 @@ private function getFileByToken($fileId, $shareToken) {
$file = $node;
}
+ if ($version > 0 && $this->versionManager !== null) {
+ $owner = $file->getFileInfo()->getOwner();
+
+ if ($owner !== null) {
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+
+ if ($version <= count($versions)) {
+ $fileVersion = array_values($versions)[$version - 1];
+ $file = $this->versionManager->getVersionFile($owner, $file->getFileInfo(), $fileVersion->getRevisionId());
+ }
+ }
+ }
+
return [$file, null];
}
@@ -587,9 +681,14 @@ private function getShare($shareToken) {
*
* @return string
*/
- private function parseUserId($uniqueUserId) {
+ private function parseUserId($userId) {
$instanceId = $this->config->GetSystemValue("instanceid", true);
- $userId = ltrim($uniqueUserId, $instanceId . "_");
+ $instanceId = $instanceId . "_";
+
+ if (substr($userId, 0, strlen($instanceId)) === $instanceId) {
+ return substr($userId, strlen($instanceId));
+ }
+
return $userId;
}
diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php
index 865a534f..1de77d05 100644
--- a/controller/editorcontroller.php
+++ b/controller/editorcontroller.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -43,17 +33,20 @@
use OCP\IRequest;
use OCP\ISession;
use OCP\IURLGenerator;
+use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Share\IManager;
use OCA\Files\Helper;
+use OCA\Files_Versions\Versions\IVersionManager;
use OCA\Onlyoffice\AppConfig;
use OCA\Onlyoffice\Crypt;
use OCA\Onlyoffice\DocumentService;
use OCA\Onlyoffice\FileUtility;
use OCA\Onlyoffice\TemplateManager;
+use OCA\Onlyoffice\FileVersions;
/**
* Controller with the main functions
@@ -123,6 +116,13 @@ class EditorController extends Controller {
*/
private $fileUtility;
+ /**
+ * File version manager
+ *
+ * @var IVersionManager
+ */
+ private $versionManager;
+
/**
* Mobile regex from https://github.com/ONLYOFFICE/CommunityServer/blob/v9.1.1/web/studio/ASC.Web.Studio/web.appsettings.config#L35
*/
@@ -140,7 +140,7 @@ class EditorController extends Controller {
* @param AppConfig $config - application configuration
* @param Crypt $crypt - hash generator
* @param IManager $shareManager - Share manager
- * @param IManager $ISession - Session
+ * @param ISession $ISession - Session
*/
public function __construct($AppName,
IRequest $request,
@@ -166,6 +166,14 @@ public function __construct($AppName,
$this->config = $config;
$this->crypt = $crypt;
+ if (\OC::$server->getAppManager()->isInstalled("files_versions")) {
+ try {
+ $this->versionManager = \OC::$server->query(IVersionManager::class);
+ } catch (QueryException $e) {
+ $this->logger->logException($e, ["message" => "VersionManager init error", "app" => $this->appName]);
+ }
+ }
+
$this->fileUtility = new FileUtility($AppName, $trans, $logger, $config, $shareManager, $session);
}
@@ -313,7 +321,7 @@ public function convert($fileId, $shareToken = null) {
try {
$newFileUri = $documentService->GetConvertedUri($fileUrl, $ext, $internalExtension, $key);
} catch (\Exception $e) {
- $this->logger->logException($e, ["GetConvertedUri: " . $file->getId(), "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "GetConvertedUri: " . $file->getId(), "app" => $this->appName]);
return ["error" => $e->getMessage()];
}
@@ -325,7 +333,7 @@ public function convert($fileId, $shareToken = null) {
try {
$newData = $documentService->Request($newFileUri);
} catch (\Exception $e) {
- $this->logger->logException($e, ["Failed to download converted file", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Failed to download converted file", "app" => $this->appName]);
return ["error" => $this->trans->t("Failed to download converted file")];
}
@@ -337,7 +345,7 @@ public function convert($fileId, $shareToken = null) {
$file->putContent($newData);
} catch (NotPermittedException $e) {
- $this->logger->logException($e, ["Can't create file: $newFileName", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Can't create file: $newFileName", "app" => $this->appName]);
return ["error" => $this->trans->t("Can't create file")];
}
@@ -385,7 +393,7 @@ public function save($name, $dir, $url) {
$documentService = new DocumentService($this->trans, $this->config);
$newData = $documentService->Request($url);
} catch (\Exception $e) {
- $this->logger->logException($e, ["Failed to download file for saving: $url", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Failed to download file for saving: $url", "app" => $this->appName]);
return ["error" => $this->trans->t("Download failed")];
}
@@ -396,7 +404,7 @@ public function save($name, $dir, $url) {
$file->putContent($newData);
} catch (NotPermittedException $e) {
- $this->logger->logException($e, ["Can't save file: $name", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Can't save file: $name", "app" => $this->appName]);
return ["error" => $this->trans->t("Can't create file")];
}
@@ -406,6 +414,204 @@ public function save($name, $dir, $url) {
return $result;
}
+ /**
+ * Get versions history for file
+ *
+ * @param integer $fileId - file identifier
+ * @param string $shareToken - access token
+ *
+ * @return array
+ *
+ * @NoAdminRequired
+ * @PublicPage
+ */
+ public function history($fileId, $shareToken = null) {
+ $this->logger->debug("Request history for: $fileId", ["app" => $this->appName]);
+
+ $history = [];
+
+ $user = $this->userSession->getUser();
+ $userId = null;
+ if (!empty($user)) {
+ $userId = $user->getUID();
+ }
+
+ list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->fileUtility->getFileByToken($fileId, $shareToken);
+
+ if (isset($error)) {
+ $this->logger->error("History: $fileId $error", ["app" => $this->appName]);
+ return ["error" => $error];
+ }
+
+ if ($fileId === 0) {
+ $fileId = $file->getId();
+ }
+
+ $owner = null;
+ $ownerId = null;
+ $versions = array();
+ if ($this->versionManager !== null) {
+ $owner = $file->getFileInfo()->getOwner();
+ if ($owner !== null) {
+ $ownerId = $owner->getUID();
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+ }
+ }
+
+ $prevVersion = "";
+ $versionNum = 0;
+ foreach ($versions as $version) {
+ $versionNum = $versionNum + 1;
+
+ $key = $this->fileUtility->getVersionKey($version);
+ $key = DocumentService::GenerateRevisionId($key);
+
+ $historyItem = [
+ "created" => $this->trans->l("datetime", $version->getTimestamp(), ["width" => "short"]),
+ "key" => $key,
+ "user" => [
+ "id" => $this->buildUserId($ownerId),
+ "name" => $owner->getDisplayName()
+ ],
+ "version" => $versionNum
+ ];
+
+ $versionId = $version->getRevisionId();
+ $historyData = FileVersions::getHistoryData($ownerId, $fileId, $versionId, $prevVersion);
+ if ($historyData !== null) {
+ $historyItem["changes"] = $historyData["changes"];
+ $historyItem["serverVersion"] = $historyData["serverVersion"];
+ }
+
+ $prevVersion = $versionId;
+
+ array_push($history, $historyItem);
+ }
+
+ $key = $this->fileUtility->getKey($file, true);
+ $key = DocumentService::GenerateRevisionId($key);
+
+ $historyItem = [
+ "created" => $this->trans->l("datetime", $file->getMTime(), ["width" => "short"]),
+ "key" => $key,
+ "version" => $versionNum + 1
+ ];
+
+ if ($owner !== null) {
+ $historyItem["user"] = [
+ "id" => $this->buildUserId($owner->getUID()),
+ "name" => $owner->getDisplayName()
+ ];
+ }
+
+ $versionId = $file->getFileInfo()->getMtime();
+ $historyData = FileVersions::getHistoryData($ownerId, $fileId, $versionId, $prevVersion);
+ if ($historyData !== null) {
+ $historyItem["changes"] = $historyData["changes"];
+ $historyItem["serverVersion"] = $historyData["serverVersion"];
+ }
+
+ array_push($history, $historyItem);
+
+ return $history;
+ }
+
+ /**
+ * Get file attributes of specific version
+ *
+ * @param integer $fileId - file identifier
+ * @param integer $version - file version
+ * @param string $shareToken - access token
+ *
+ * @return array
+ *
+ * @NoAdminRequired
+ * @PublicPage
+ */
+ public function version($fileId, $version, $shareToken = null) {
+ $this->logger->debug("Request version for: $fileId ($version)", ["app" => $this->appName]);
+
+ $version = empty($version) ? null : $version;
+
+ $user = $this->userSession->getUser();
+ $userId = null;
+ if (!empty($user)) {
+ $userId = $user->getUID();
+ }
+
+ list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId) : $this->fileUtility->getFileByToken($fileId, $shareToken);
+
+ if (isset($error)) {
+ $this->logger->error("History: $fileId $error", ["app" => $this->appName]);
+ return ["error" => $error];
+ }
+
+ if ($fileId === 0) {
+ $fileId = $file->getId();
+ }
+
+ $owner = null;
+ $ownerId = null;
+ $versions = array();
+ if ($this->versionManager !== null) {
+ $owner = $file->getFileInfo()->getOwner();
+ if ($owner !== null) {
+ $ownerId = $owner->getUID();
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+ }
+ }
+
+ $key = null;
+ $fileUrl = null;
+ $versionId = null;
+ if ($version > count($versions)) {
+ $key = $this->fileUtility->getKey($file, true);
+ $versionId = $file->getFileInfo()->getMtime();
+
+ $fileUrl = $this->getUrl($file, $user, $shareToken);
+ } else {
+ $fileVersion = array_values($versions)[$version - 1];
+
+ $key = $this->fileUtility->getVersionKey($fileVersion);
+ $versionId = $fileVersion->getRevisionId();
+
+ $fileUrl = $this->getUrl($file, $user, $shareToken, $version);
+ }
+ $key = DocumentService::GenerateRevisionId($key);
+
+ $result = [
+ "url" => $fileUrl,
+ "version" => $version,
+ "key" => $key
+ ];
+
+ if ($version > 1
+ && count($versions) >= $version - 1
+ && FileVersions::hasChanges($ownerId, $fileId, $versionId)) {
+
+ $changesUrl = $this->getUrl($file, $user, $shareToken, $version, true);
+ $result["changesUrl"] = $changesUrl;
+
+ $prevVersion = array_values($versions)[$version - 2];
+ $prevVersionKey = $this->fileUtility->getVersionKey($prevVersion);
+ $prevVersionKey = DocumentService::GenerateRevisionId($prevVersionKey);
+
+ $prevVersionUrl = $this->getUrl($file, $user, $shareToken, $version - 1);
+
+ $result["previous"] = [
+ "key" => $prevVersionKey,
+ "url" => $prevVersionUrl
+ ];
+ }
+
+ if (!empty($this->config->GetDocumentServerSecret())) {
+ $token = \Firebase\JWT\JWT::encode($result, $this->config->GetDocumentServerSecret());
+ $result["token"] = $token;
+ }
+
+ return $result;
+ }
+
/**
* Get presigned url to file
*
@@ -460,6 +666,7 @@ public function url($filePath) {
* @param integer $fileId - file identifier
* @param string $filePath - file path
* @param string $shareToken - access token
+ * @param integer $version - file version
* @param bool $inframe - open in frame
*
* @return TemplateResponse|RedirectResponse
@@ -467,8 +674,8 @@ public function url($filePath) {
* @NoAdminRequired
* @NoCSRFRequired
*/
- public function index($fileId, $filePath = null, $shareToken = null, $inframe = false) {
- $this->logger->debug("Open: $fileId $filePath", ["app" => $this->appName]);
+ public function index($fileId, $filePath = null, $shareToken = null, $version = 0, $inframe = false) {
+ $this->logger->debug("Open: $fileId ($version) $filePath ", ["app" => $this->appName]);
$isLoggedIn = $this->userSession->isLoggedIn();
if (empty($shareToken) && !$isLoggedIn) {
@@ -495,6 +702,7 @@ public function index($fileId, $filePath = null, $shareToken = null, $inframe =
"filePath" => $filePath,
"shareToken" => $shareToken,
"directToken" => null,
+ "version" => $version,
"inframe" => false
];
@@ -534,6 +742,7 @@ public function index($fileId, $filePath = null, $shareToken = null, $inframe =
*
* @param integer $fileId - file identifier
* @param string $shareToken - access token
+ * @param integer $version - file version
* @param bool $inframe - open in frame
*
* @return TemplateResponse
@@ -542,8 +751,21 @@ public function index($fileId, $filePath = null, $shareToken = null, $inframe =
* @NoCSRFRequired
* @PublicPage
*/
- public function PublicPage($fileId, $shareToken, $inframe = false) {
- return $this->index($fileId, null, $shareToken, $inframe);
+ public function PublicPage($fileId, $shareToken, $version = 0, $inframe = false) {
+ return $this->index($fileId, null, $shareToken, $version, $inframe);
+ }
+
+ /**
+ * Get template loader Onlyoffice
+ *
+ * @return TemplateResponse
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ * @PublicPage
+ */
+ public function loader() {
+ return new TemplateResponse($this->appName, "loader", [], "plain");
}
/**
@@ -553,6 +775,7 @@ public function PublicPage($fileId, $shareToken, $inframe = false) {
* @param string $filePath - file path
* @param string $shareToken - access token
* @param string $directToken - direct token
+ * @param integer $version - file version
* @param integer $inframe - open in frame. 0 - no, 1 - yes, 2 - without goback for old editor (5.4)
* @param bool $desktop - desktop label
*
@@ -561,7 +784,7 @@ public function PublicPage($fileId, $shareToken, $inframe = false) {
* @NoAdminRequired
* @PublicPage
*/
- public function config($fileId, $filePath = null, $shareToken = null, $directToken = null, $inframe = 0, $desktop = false) {
+ public function config($fileId, $filePath = null, $shareToken = null, $directToken = null, $version = 0, $inframe = 0, $desktop = false) {
if (!empty($directToken)) {
list ($directData, $error) = $this->crypt->ReadHash($directToken);
@@ -614,8 +837,25 @@ public function config($fileId, $filePath = null, $shareToken = null, $directTok
return ["error" => $this->trans->t("Format is not supported")];
}
- $fileUrl = $this->getUrl($file, $user, $shareToken);
- $key = $this->fileUtility->getKey($file, true);
+ $fileUrl = $this->getUrl($file, $user, $shareToken, $version);
+
+ $key = null;
+ if ($version > 0
+ && $this->versionManager !== null) {
+ $owner = $file->getFileInfo()->getOwner();
+ if ($owner !== null) {
+ $versions = array_reverse($this->versionManager->getVersionsForFile($owner, $file->getFileInfo()));
+
+ if ($version <= count($versions)) {
+ $fileVersion = array_values($versions)[$version - 1];
+
+ $key = $this->fileUtility->getVersionKey($fileVersion);
+ }
+ }
+ }
+ if ($key === null) {
+ $key = $this->fileUtility->getKey($file, true);
+ }
$key = DocumentService::GenerateRevisionId($key);
$params = [
@@ -639,7 +879,8 @@ public function config($fileId, $filePath = null, $shareToken = null, $directTok
}
$canEdit = isset($format["edit"]) && $format["edit"];
- $editable = $file->isUpdateable()
+ $editable = $version < 1
+ && $file->isUpdateable()
&& (empty($shareToken) || ($share->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE);
$params["document"]["permissions"]["edit"] = $editable;
if ($editable && $canEdit) {
@@ -732,7 +973,7 @@ public function config($fileId, $filePath = null, $shareToken = null, $directTok
$params["token"] = $token;
}
- $this->logger->debug("Config is generated for: $fileId with key $key", ["app" => $this->appName]);
+ $this->logger->debug("Config is generated for: $fileId ($version) with key $key", ["app" => $this->appName]);
return $params;
}
@@ -754,7 +995,7 @@ private function getFile($userId, $fileId, $filePath = null) {
try {
$files = $this->root->getUserFolder($userId)->getById($fileId);
} catch (\Exception $e) {
- $this->logger->logException($e, ["getFile: $fileId", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "getFile: $fileId", "app" => $this->appName]);
return [null, $this->trans->t("Invalid request"), null];
}
@@ -785,23 +1026,42 @@ private function getFile($userId, $fileId, $filePath = null) {
/**
* Generate secure link to download document
*
- * @param integer $file - file
+ * @param File $file - file
* @param IUser $user - user with access
* @param string $shareToken - access token
+ * @param integer $version - file version
+ * @param bool $changes - is required url to file changes
*
* @return string
*/
- private function getUrl($file, $user = null, $shareToken = null) {
+ private function getUrl($file, $user = null, $shareToken = null, $version = 0, $changes = false) {
+
+ $data = [
+ "action" => "download",
+ "fileId" => $file->getId()
+ ];
+
$userId = null;
if (!empty($user)) {
$userId = $user->getUID();
+ $data["userId"] = $userId;
+ }
+ if (!empty($shareToken)) {
+ $data["shareToken"] = $shareToken;
+ }
+ if ($version > 0) {
+ $data["version"] = $version;
+ }
+ if ($changes) {
+ $data["changes"] = true;
}
- $hashUrl = $this->crypt->GetHash(["fileId" => $file->getId(), "userId" => $userId, "shareToken" => $shareToken, "action" => "download"]);
+ $hashUrl = $this->crypt->GetHash($data);
$fileUrl = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.download", ["doc" => $hashUrl]);
- if (!empty($this->config->GetStorageUrl())) {
+ if (!empty($this->config->GetStorageUrl())
+ && !$changes) {
$fileUrl = str_replace($this->urlGenerator->getAbsoluteURL("/"), $this->config->GetStorageUrl(), $fileUrl);
}
@@ -922,7 +1182,7 @@ private function setWatermark($params, $isPublic, $userId, $file) {
"date" => (new \DateTime())->format("Y-m-d H:i:s"),
"themingName" => \OC::$server->getThemingDefaults()->getName()
];
- $watermarkTemplate = preg_replace_callback("/{(.+?)}/", function($matches) use ($replacements)
+ $watermarkTemplate = preg_replace_callback("/{(.+?)}/", function ($matches) use ($replacements)
{
return $replacements[$matches[1]];
}, $watermarkTemplate);
diff --git a/controller/federationcontroller.php b/controller/federationcontroller.php
index 07aae6c3..b3eea626 100644
--- a/controller/federationcontroller.php
+++ b/controller/federationcontroller.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php
index f1eb9b29..0fc88e17 100644
--- a/controller/settingscontroller.php
+++ b/controller/settingscontroller.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -117,6 +107,7 @@ public function index() {
"documentserver" => $this->config->GetDocumentServerUrl(true),
"documentserverInternal" => $this->config->GetDocumentServerInternalUrl(true),
"storageUrl" => $this->config->GetStorageUrl(),
+ "verifyPeerOff" => $this->config->GetVerifyPeerOff(),
"secret" => $this->config->GetDocumentServerSecret(true),
"demo" => $this->config->GetDemoData(),
"currentServer" => $this->urlGenerator->getAbsoluteURL("/"),
@@ -142,6 +133,7 @@ public function index() {
* @param string $documentserver - document service address
* @param string $documentserverInternal - document service address available from Nextcloud
* @param string $storageUrl - Nextcloud address available from document server
+ * @param bool $verifyPeerOff - parameter verification setting
* @param string $secret - secret key for signature
* @param bool $demo - use demo server
*
@@ -150,6 +142,7 @@ public function index() {
public function SaveAddress($documentserver,
$documentserverInternal,
$storageUrl,
+ $verifyPeerOff,
$secret,
$demo
) {
@@ -159,6 +152,7 @@ public function SaveAddress($documentserver,
}
if ($demo !== true) {
$this->config->SetDocumentServerUrl($documentserver);
+ $this->config->SetVerifyPeerOff($verifyPeerOff);
$this->config->SetDocumentServerInternalUrl($documentserverInternal);
$this->config->SetDocumentServerSecret($secret);
}
@@ -175,6 +169,7 @@ public function SaveAddress($documentserver,
return [
"documentserver" => $this->config->GetDocumentServerUrl(true),
+ "verifyPeerOff" => $this->config->GetVerifyPeerOff(),
"documentserverInternal" => $this->config->GetDocumentServerInternalUrl(true),
"storageUrl" => $this->config->GetStorageUrl(),
"secret" => $this->config->GetDocumentServerSecret(true),
@@ -281,7 +276,7 @@ private function checkDocServiceUrl() {
}
} catch (\Exception $e) {
- $this->logger->logException($e, ["Protocol on check error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Protocol on check error", "app" => $this->appName]);
return [$e->getMessage(), $version];
}
@@ -295,7 +290,7 @@ private function checkDocServiceUrl() {
}
} catch (\Exception $e) {
- $this->logger->logException($e, ["HealthcheckRequest on check error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "HealthcheckRequest on check error", "app" => $this->appName]);
return [$e->getMessage(), $version];
}
@@ -317,7 +312,7 @@ private function checkDocServiceUrl() {
}
} catch (\Exception $e) {
- $this->logger->logException($e, ["CommandRequest on check error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "CommandRequest on check error", "app" => $this->appName]);
return [$e->getMessage(), $version];
}
@@ -333,14 +328,14 @@ private function checkDocServiceUrl() {
$convertedFileUri = $documentService->GetConvertedUri($fileUrl, "docx", "docx", "check_" . rand());
} catch (\Exception $e) {
- $this->logger->logException($e, ["GetConvertedUri on check error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "GetConvertedUri on check error", "app" => $this->appName]);
return [$e->getMessage(), $version];
}
try {
$documentService->Request($convertedFileUri);
} catch (\Exception $e) {
- $this->logger->logException($e, ["Request converted file on check error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Request converted file on check error", "app" => $this->appName]);
return [$e->getMessage(), $version];
}
diff --git a/css/editor.css b/css/editor.css
index 4a41ce36..6214ab2e 100644
--- a/css/editor.css
+++ b/css/editor.css
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/css/main.css b/css/main.css
index dd06eebc..4dad33f7 100644
--- a/css/main.css
+++ b/css/main.css
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -91,7 +81,8 @@ body.onlyoffice-inline #content #app-content {
.AscDesktopEditor #body-user #app-sidebar {
height: 100vh;
}
-.AscDesktopEditor #body-user table.multiselect thead {
+.AscDesktopEditor #body-user table.multiselect thead,
+.AscDesktopEditor #app-content-files thead {
top: 44px;
}
.AscDesktopEditor #body-user #gallery-button {
diff --git a/css/settings.css b/css/settings.css
index 4732f22b..c28ac611 100644
--- a/css/settings.css
+++ b/css/settings.css
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/css/viewer.css b/css/viewer.css
index 48f97e33..a2850684 100644
--- a/css/viewer.css
+++ b/css/viewer.css
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/js/desktop.js b/js/desktop.js
index 5452422a..d4e1e12a 100644
--- a/js/desktop.js
+++ b/js/desktop.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/js/directeditor.js b/js/directeditor.js
index 9aa95dfd..09f163ff 100644
--- a/js/directeditor.js
+++ b/js/directeditor.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -65,10 +55,10 @@
}
OCA.Onlyoffice.directEditor = {
- close: function() {
+ close: function () {
callMobileMessage("close");
},
- loaded: function() {
+ loaded: function () {
callMobileMessage("loaded");
}
};
diff --git a/js/editor.js b/js/editor.js
index 2b6bf7b7..50325aa7 100644
--- a/js/editor.js
+++ b/js/editor.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -30,7 +20,10 @@
OCA.Onlyoffice = _.extend({
AppName: "onlyoffice",
- inframe: false
+ inframe: false,
+ fileId: null,
+ shareToken: null,
+ insertImageType: null
}, OCA.Onlyoffice);
OCA.Onlyoffice.InitEditor = function () {
@@ -40,11 +33,12 @@
});
};
- var fileId = $("#iframeEditor").data("id");
- var shareToken = $("#iframeEditor").data("sharetoken");
+ OCA.Onlyoffice.fileId = $("#iframeEditor").data("id");
+ OCA.Onlyoffice.shareToken = $("#iframeEditor").data("sharetoken");
+ OCA.Onlyoffice.version = $("#iframeEditor").data("version");
var directToken = $("#iframeEditor").data("directtoken");
OCA.Onlyoffice.inframe = !!$("#iframeEditor").data("inframe");
- if (!fileId && !shareToken && !directToken) {
+ if (!OCA.Onlyoffice.fileId && !OCA.Onlyoffice.shareToken && !directToken) {
displayError(t(OCA.Onlyoffice.AppName, "FileId is empty"));
return;
}
@@ -56,7 +50,7 @@
var configUrl = OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/config/{fileId}",
{
- fileId: fileId || 0
+ fileId: OCA.Onlyoffice.fileId || 0
});
var params = [];
@@ -64,19 +58,23 @@
if (filePath) {
params.push("filePath=" + encodeURIComponent(filePath));
}
- if (shareToken) {
- params.push("shareToken=" + encodeURIComponent(shareToken));
+ if (OCA.Onlyoffice.shareToken) {
+ params.push("shareToken=" + encodeURIComponent(OCA.Onlyoffice.shareToken));
}
if (directToken) {
$("html").addClass("onlyoffice-full-page");
params.push("directToken=" + encodeURIComponent(directToken));
}
+ if (OCA.Onlyoffice.version > 0) {
+ params.push("version=" + OCA.Onlyoffice.version);
+ }
if (OCA.Onlyoffice.inframe || directToken) {
var dsVersion = DocsAPI.DocEditor.version();
var versionArray = dsVersion.split(".");
if (versionArray[0] < 5 || versionArray[0] == 5 && versionArray[1] < 5) {
- if (OCA.Onlyoffice.inframe) {
+ if (OCA.Onlyoffice.inframe
+ && window.parent.OCA.Onlyoffice.ShowHeaderButton) {
window.parent.postMessage({
method: "editorShowHeaderButton"
},
@@ -112,7 +110,7 @@
var docIsChanged = null;
var docIsChangedTimeout = null;
- var setPageTitle = function(event) {
+ var setPageTitle = function (event) {
clearTimeout(docIsChangedTimeout);
if (docIsChanged !== event.data) {
@@ -130,17 +128,26 @@
};
setPageTitle(false);
+ OCA.Onlyoffice.documentType = config.documentType;
+
config.events = {
"onDocumentStateChange": setPageTitle,
+ "onRequestHistory": OCA.Onlyoffice.onRequestHistory,
+ "onRequestHistoryData": OCA.Onlyoffice.onRequestHistoryData,
+ "onDocumentReady": OCA.Onlyoffice.onDocumentReady,
};
+ if (!OCA.Onlyoffice.version) {
+ config.events.onRequestHistoryClose = OCA.Onlyoffice.onRequestHistoryClose;
+ }
+
if (config.editorConfig.tenant) {
- config.events.onAppReady = function() {
+ config.events.onAppReady = function () {
OCA.Onlyoffice.docEditor.showMessage(t(OCA.Onlyoffice.AppName, "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data."));
};
}
- if (OCA.Onlyoffice.inframe && !shareToken
+ if (OCA.Onlyoffice.inframe && !OCA.Onlyoffice.shareToken
|| OC.currentUser) {
config.events.onRequestSaveAs = OCA.Onlyoffice.onRequestSaveAs;
config.events.onRequestInsertImage = OCA.Onlyoffice.onRequestInsertImage;
@@ -153,7 +160,7 @@
}
if (OCA.Onlyoffice.inframe
- && config._files_sharing && !shareToken
+ && config._files_sharing && !OCA.Onlyoffice.shareToken
&& window.parent.OCA.Onlyoffice.context) {
config.events.onRequestSharingSettings = OCA.Onlyoffice.onRequestSharingSettings;
}
@@ -173,6 +180,74 @@
});
};
+ OCA.Onlyoffice.onRequestHistory = function (version) {
+ $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/history?fileId={fileId}&shareToken={shareToken}",
+ {
+ fileId: OCA.Onlyoffice.fileId || 0,
+ shareToken: OCA.Onlyoffice.shareToken || "",
+ }),
+ function onSuccess(response) {
+ if (response.error) {
+ var data = {error: response.error};
+ } else {
+ var currentVersion = 0;
+ $.each(response, function (i, fileVersion) {
+ if (fileVersion.version >= currentVersion) {
+ currentVersion = fileVersion.version;
+ }
+ });
+
+ if (version) {
+ currentVersion = Math.min(currentVersion, version);
+ }
+
+ data = {
+ currentVersion: currentVersion,
+ history: response,
+ };
+ }
+ OCA.Onlyoffice.docEditor.refreshHistory(data);
+ });
+ };
+
+ OCA.Onlyoffice.onRequestHistoryData = function (event) {
+ var version = event.data;
+
+ $.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/version?fileId={fileId}&version={version}&shareToken={shareToken}",
+ {
+ fileId: OCA.Onlyoffice.fileId || 0,
+ version: version,
+ shareToken: OCA.Onlyoffice.shareToken || "",
+ }),
+ function onSuccess(response) {
+ if (response.error) {
+ response = {
+ error: response.error,
+ version: version,
+ };
+ }
+ OCA.Onlyoffice.docEditor.setHistoryData(response);
+ });
+ };
+
+ OCA.Onlyoffice.onRequestHistoryClose = function () {
+ location.reload(true);
+ };
+
+ OCA.Onlyoffice.onDocumentReady = function() {
+ if (OCA.Onlyoffice.inframe) {
+ window.parent.postMessage({
+ method: "onDocumentReady",
+ param: OCA.Onlyoffice.documentType
+ },
+ "*");
+ }
+
+ if (OCA.Onlyoffice.version > 0) {
+ OCA.Onlyoffice.onRequestHistory(OCA.Onlyoffice.version);
+ }
+ };
+
OCA.Onlyoffice.onRequestSaveAs = function (event) {
var saveData = {
name: event.data.title,
@@ -209,7 +284,7 @@
});
};
- OCA.Onlyoffice.onRequestInsertImage = function () {
+ OCA.Onlyoffice.onRequestInsertImage = function (event) {
var imageMimes = [
"image/bmp", "image/x-bmp", "image/x-bitmap", "application/bmp",
"image/gif",
@@ -217,6 +292,8 @@
"image/png", "image/x-png", "application/png", "application/x-png"
];
+ OCA.Onlyoffice.insertImageType = event.data.c;
+
if (OCA.Onlyoffice.inframe) {
window.parent.postMessage({
method: "editorRequestInsertImage",
@@ -239,6 +316,10 @@
return;
}
+ if (OCA.Onlyoffice.insertImageType) {
+ response.c = OCA.Onlyoffice.insertImageType;
+ }
+
OCA.Onlyoffice.docEditor.insertImage(response);
});
};
@@ -286,14 +367,14 @@
"*");
};
- OCA.Onlyoffice.onRequestSharingSettings = function() {
+ OCA.Onlyoffice.onRequestSharingSettings = function () {
window.parent.postMessage({
method: "editorRequestSharingSettings"
},
"*");
};
- OCA.Onlyoffice.onRequestCompareFile = function() {
+ OCA.Onlyoffice.onRequestCompareFile = function () {
var revisedMimes = [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
];
@@ -309,7 +390,7 @@
}
};
- OCA.Onlyoffice.editorSetRevised = function(filePath) {
+ OCA.Onlyoffice.editorSetRevised = function (filePath) {
$.get(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/url?filePath={filePath}",
{
filePath: filePath
diff --git a/js/listener.js b/js/listener.js
index 3f8a4d89..e56318cd 100644
--- a/js/listener.js
+++ b/js/listener.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -30,65 +20,20 @@
OCA.Onlyoffice = _.extend({
AppName: "onlyoffice",
- context: null,
- folderUrl: null,
frameSelector: null,
- canExpandHeader: true,
}, OCA.Onlyoffice);
- OCA.Onlyoffice.ShowHeaderButton = function () {
- if (!OCA.Onlyoffice.canExpandHeader) {
- return;
- }
-
- var wrapper = $("")
-
- var btnClose = $("");
- btnClose.on("click", function() {
- OCA.Onlyoffice.CloseEditor();
- });
- wrapper.prepend(btnClose);
-
- if (!$("#isPublic").val()) {
- var btnShare = $("");
- btnShare.on("click", function () {
- OCA.Onlyoffice.OpenShareDialog();
- })
- wrapper.prepend(btnShare);
- }
-
- if (!$("#header .header-right").length) {
- $("#header").append("");
- }
- wrapper.prependTo(".header-right");
- };
-
- OCA.Onlyoffice.CloseEditor = function () {
- $("body").removeClass("onlyoffice-inline");
+ OCA.Onlyoffice.onRequestClose = function () {
$(OCA.Onlyoffice.frameSelector).remove();
- $("#onlyofficeHeader").remove();
+ OCA.Onlyoffice.frameSelector = null;
+
if (OCA.Viewer && OCA.Viewer.close) {
OCA.Viewer.close();
}
- OCA.Onlyoffice.context = null;
-
- var url = OCA.Onlyoffice.folderUrl;
- if (!!url) {
- window.history.pushState(null, null, url);
- OCA.Onlyoffice.folderUrl = null;
- }
- };
-
- OCA.Onlyoffice.OpenShareDialog = function () {
- if (OCA.Onlyoffice.context) {
- if (!$("#app-sidebar").is(":visible")) {
- OCA.Onlyoffice.context.fileList.showDetailsView(OCA.Onlyoffice.context.fileName, "shareTabView");
- OC.Apps.showAppSidebar();
- } else {
- OC.Apps.hideAppSidebar();
- }
+ if (OCA.Onlyoffice.CloseEditor) {
+ OCA.Onlyoffice.CloseEditor();
}
};
@@ -123,20 +68,34 @@
revisedMimes);
};
- window.addEventListener("message", function(event) {
+ OCA.Onlyoffice.onDocumentReady = function (documentType) {
+ if (documentType === "text") {
+ if (OCA.Onlyoffice.bindVersionClick) {
+ OCA.Onlyoffice.bindVersionClick();
+ }
+ } else if (OCA.Onlyoffice.unbindVersionClick) {
+ OCA.Onlyoffice.unbindVersionClick();
+ }
+ };
+
+ window.addEventListener("message", function (event) {
if ($(OCA.Onlyoffice.frameSelector)[0].contentWindow !== event.source
|| !event.data["method"]) {
return;
}
switch (event.data.method) {
case "editorShowHeaderButton":
- OCA.Onlyoffice.ShowHeaderButton();
+ if (OCA.Onlyoffice.ShowHeaderButton) {
+ OCA.Onlyoffice.ShowHeaderButton();
+ }
break;
case "editorRequestClose":
- OCA.Onlyoffice.CloseEditor();
+ OCA.Onlyoffice.onRequestClose();
break;
case "editorRequestSharingSettings":
- OCA.Onlyoffice.OpenShareDialog();
+ if (OCA.Onlyoffice.OpenShareDialog) {
+ OCA.Onlyoffice.OpenShareDialog();
+ }
break;
case "editorRequestSaveAs":
OCA.Onlyoffice.onRequestSaveAs(event.data.param);
@@ -150,6 +109,9 @@
case "editorRequestCompareFile":
OCA.Onlyoffice.onRequestCompareFile(event.data.param);
break;
+ case "onDocumentReady":
+ OCA.Onlyoffice.onDocumentReady(event.data.param);
+ break;
}
}, false);
diff --git a/js/main.js b/js/main.js
index df358c78..8c33d79e 100644
--- a/js/main.js
+++ b/js/main.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -41,11 +31,8 @@
var dir = fileList.getCurrentDirectory();
if (!OCA.Onlyoffice.setting.sameTab || OCA.Onlyoffice.Desktop) {
- var winEditor = window.open("");
- if (winEditor) {
- winEditor.document.write(t(OCA.Onlyoffice.AppName, "Loading, please wait."));
- winEditor.document.close();
- }
+ $loaderUrl = OCA.Onlyoffice.Desktop ? "" : OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/loader");
+ var winEditor = window.open($loaderUrl);
}
var createData = {
@@ -69,7 +56,7 @@
}
fileList.add(response, { animate: true });
- OCA.Onlyoffice.OpenEditor(response.id, dir, response.name, winEditor);
+ OCA.Onlyoffice.OpenEditor(response.id, dir, response.name, 0, winEditor);
OCA.Onlyoffice.context = { fileList: fileList };
OCA.Onlyoffice.context.fileName = response.name;
@@ -79,8 +66,11 @@
);
};
- OCA.Onlyoffice.OpenEditor = function (fileId, fileDir, fileName, winEditor) {
- var filePath = fileDir.replace(new RegExp("\/$"), "") + "/" + fileName;
+ OCA.Onlyoffice.OpenEditor = function (fileId, fileDir, fileName, version, winEditor) {
+ var filePath = "";
+ if (fileName) {
+ filePath = fileDir.replace(new RegExp("\/$"), "") + "/" + fileName;
+ }
var url = OC.generateUrl("/apps/" + OCA.Onlyoffice.AppName + "/{fileId}?filePath={filePath}",
{
fileId: fileId,
@@ -95,6 +85,10 @@
});
}
+ if (version > 0) {
+ url += "&version=" + version;
+ }
+
if (winEditor && winEditor.location) {
winEditor.location.href = url;
} else if (!OCA.Onlyoffice.setting.sameTab || OCA.Onlyoffice.Desktop) {
@@ -107,7 +101,14 @@
$("#app-content").append($iframe);
$("body").addClass("onlyoffice-inline");
- OC.Apps.hideAppSidebar();
+
+ if (OCA.Files.Sidebar) {
+ OCA.Files.Sidebar.close();
+ return;
+ } else {
+ //todo: remove. only for v17
+ OC.Apps.hideAppSidebar();
+ }
$("html, body").scrollTop(0);
@@ -116,13 +117,58 @@
}
};
+ OCA.Onlyoffice.ShowHeaderButton = function () {
+ var wrapper = $("")
+
+ var btnClose = $("");
+ btnClose.on("click", function() {
+ OCA.Onlyoffice.CloseEditor();
+ });
+ wrapper.prepend(btnClose);
+
+ if (!$("#isPublic").val()) {
+ var btnShare = $("");
+ btnShare.on("click", function () {
+ OCA.Onlyoffice.OpenShareDialog();
+ })
+ wrapper.prepend(btnShare);
+ }
+
+ if (!$("#header .header-right").length) {
+ $("#header").append("");
+ }
+ wrapper.prependTo(".header-right");
+ };
+
+ OCA.Onlyoffice.CloseEditor = function () {
+ $("body").removeClass("onlyoffice-inline");
+ $("#onlyofficeHeader").remove();
+
+ OCA.Onlyoffice.context = null;
+
+ var url = OCA.Onlyoffice.folderUrl;
+ if (!!url) {
+ window.history.pushState(null, null, url);
+ OCA.Onlyoffice.folderUrl = null;
+ }
+
+ if (OCA.Versions) {
+ OCA.Onlyoffice.bindVersionClick();
+ }
+ };
+
OCA.Onlyoffice.OpenShareDialog = function () {
if (OCA.Onlyoffice.context) {
if (!$("#app-sidebar").is(":visible")) {
- OCA.Onlyoffice.context.fileList.showDetailsView(OCA.Onlyoffice.context.fileName, "shareTabView");
+ OCA.Onlyoffice.context.fileList.showDetailsView(OCA.Onlyoffice.context.fileName, "sharing");
OC.Apps.showAppSidebar();
} else {
- OC.Apps.hideAppSidebar();
+ if (OCA.Files.Sidebar) {
+ OCA.Files.Sidebar.close();
+ } else {
+ //todo: remove. only for v17
+ OC.Apps.hideAppSidebar();
+ }
}
}
};
@@ -187,7 +233,7 @@
return;
}
- var register = function() {
+ var register = function () {
var formats = OCA.Onlyoffice.setting.formats;
$.each(formats, function (ext, config) {
@@ -272,12 +318,49 @@
return extension;
}
+ OCA.Onlyoffice.openVersion = function (fileId, version) {
+ if (OCA.Onlyoffice.frameSelector) {
+ $(OCA.Onlyoffice.frameSelector)[0].contentWindow.OCA.Onlyoffice.onRequestHistory(version);
+ return;
+ }
+
+ OCA.Onlyoffice.OpenEditor(fileId, "", "", version)
+ };
+
+ OCA.Onlyoffice.bindVersionClick = function () {
+ OCA.Onlyoffice.unbindVersionClick();
+ $(document).on("click.onlyoffice-version", "#versionsTabView .downloadVersion", function() {
+ var versionNodes = $("#versionsTabView ul.versions>li");
+ var versionNode = $(this).closest("#versionsTabView ul.versions>li")[0];
+
+ var href = $(this).attr("href");
+ var search = new RegExp("\/versions\/(\\d+)\/\\d+$");
+ var result = search.exec(href);
+ if (result && result.length > 1) {
+ var fileId = result[1];
+ }
+ if (!fileId) {
+ return true;
+ }
+
+ var versionNum = versionNodes.length - $.inArray(versionNode, versionNodes);
+
+ OCA.Onlyoffice.openVersion(fileId, versionNum);
+
+ return false;
+ });
+ };
+
+ OCA.Onlyoffice.unbindVersionClick = function() {
+ $(document).off("click.onlyoffice-version", "#versionsTabView .downloadVersion");
+ }
+
var initPage = function () {
if ($("#isPublic").val() === "1" && !$("#filestable").length) {
var fileName = $("#filename").val();
var extension = getFileExtension(fileName);
- var initSharedButton = function() {
+ var initSharedButton = function () {
var formats = OCA.Onlyoffice.setting.formats;
var config = formats[extension];
@@ -301,6 +384,10 @@
} else {
OC.Plugins.register("OCA.Files.FileList", OCA.Onlyoffice.FileList);
OC.Plugins.register("OCA.Files.NewFileMenu", OCA.Onlyoffice.NewFileMenu);
+
+ if (OCA.Versions) {
+ OCA.Onlyoffice.bindVersionClick();
+ }
}
};
diff --git a/js/settings.js b/js/settings.js
index adaf52fc..1ac8d610 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -61,7 +51,7 @@
$("#onlyofficeGroups").click(groupListToggle);
groupListToggle();
- var demoToggle = function() {
+ var demoToggle = function () {
$("#onlyofficeAddrSettings input:not(#onlyofficeStorageUrl)").prop("disabled", $("#onlyofficeDemo").prop("checked"));
};
@@ -87,14 +77,14 @@
"allTags",
"linkTags",
];
- $.each(watermarkLists, function(i, watermarkList) {
- var watermarkListToggle = function() {
+ $.each(watermarkLists, function (i, watermarkList) {
+ var watermarkListToggle = function () {
if ($("#onlyofficeWatermark_" + watermarkList).prop("checked")) {
if (watermarkList.indexOf("Group") >= 0) {
OC.Settings.setupGroupsSelect($("#onlyofficeWatermark_" + watermarkList + "List"));
} else {
OC.SystemTags.collection.fetch({
- success: function() {
+ success: function () {
$("#onlyofficeWatermark_" + watermarkList + "List").select2({
allowClear: true,
closeOnSelect: false,
@@ -102,13 +92,13 @@
separator: "|",
toggleSelect: true,
placeholder: t(OCA.Onlyoffice.AppName, "Select tag"),
- query: _.debounce(function(query) {
+ query: _.debounce(function (query) {
query.callback({
results: OC.SystemTags.collection.filterByName(query.term)
});
}, 100, true),
- initSelection: function(element, callback) {
- var selection = ($(element).val() || []).split("|").map(function(tagId){
+ initSelection: function (element, callback) {
+ var selection = ($(element).val() || []).split("|").map(function (tagId) {
return OC.SystemTags.collection.get(tagId);
});
callback(selection);
@@ -119,8 +109,8 @@
formatSelection: function (tag) {
return tag.get("name");
},
- sortResults: function(results) {
- results.sort(function(a, b) {
+ sortResults: function (results) {
+ results.sort(function (a, b) {
return OC.Util.naturalSortCompare(a.get("name"), b.get("name"));
});
return results;
@@ -149,6 +139,7 @@
var onlyofficeInternalUrl = ($("#onlyofficeInternalUrl:visible").val() || "").trim();
var onlyofficeStorageUrl = ($("#onlyofficeStorageUrl:visible").val() || "").trim();
+ var onlyofficeVerifyPeerOff = $("#onlyofficeVerifyPeerOff").prop("checked");
var onlyofficeSecret = ($("#onlyofficeSecret:visible").val() || "").trim();
var demo = $("#onlyofficeDemo").prop("checked");
@@ -159,6 +150,7 @@
documentserver: onlyofficeUrl,
documentserverInternal: onlyofficeInternalUrl,
storageUrl: onlyofficeStorageUrl,
+ verifyPeerOff: onlyofficeVerifyPeerOff,
secret: onlyofficeSecret,
demo: demo
},
@@ -188,12 +180,12 @@
$(".section-onlyoffice").addClass("icon-loading");
var defFormats = {};
- $("input[id^=\"onlyofficeDefFormat\"]").each(function() {
+ $("input[id^=\"onlyofficeDefFormat\"]").each(function () {
defFormats[this.name] = this.checked;
});
var editFormats = {};
- $("input[id^=\"onlyofficeEditFormat\"]").each(function() {
+ $("input[id^=\"onlyofficeEditFormat\"]").each(function () {
editFormats[this.name] = this.checked;
});
diff --git a/js/viewer.js b/js/viewer.js
index 183a8e3d..e31a6ce3 100644
--- a/js/viewer.js
+++ b/js/viewer.js
@@ -2,27 +2,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -67,7 +57,7 @@
src: self.url + "&inframe=true",
},
on: {
- load: function() {
+ load: function () {
self.doneLoading();
},
},
@@ -96,13 +86,11 @@
var initPage = function () {
if (OCA.Viewer) {
- OCA.Onlyoffice.canExpandHeader = false;
-
OCA.Onlyoffice.frameSelector = "#onlyofficeViewerFrame";
- OCA.Onlyoffice.GetSettings(function(){
+ OCA.Onlyoffice.GetSettings(function () {
- var mimes = $.map(OCA.Onlyoffice.setting.formats, function(format) {
+ var mimes = $.map(OCA.Onlyoffice.setting.formats, function (format) {
return format.mime;
});
diff --git a/l10n/de.js b/l10n/de.js
index b0e6c9a9..fa9afa7a 100644
--- a/l10n/de.js
+++ b/l10n/de.js
@@ -82,6 +82,7 @@ OC.L10N.register(
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Zertifikatsüberprüfung deaktivieren (unsicher)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/de.json b/l10n/de.json
index e1765ef5..791b3e01 100644
--- a/l10n/de.json
+++ b/l10n/de.json
@@ -80,6 +80,7 @@
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Zertifikatsüberprüfung deaktivieren (unsicher)"
},"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 bd466ce4..01622119 100644
--- a/l10n/de_DE.js
+++ b/l10n/de_DE.js
@@ -82,6 +82,7 @@ OC.L10N.register(
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Zertifikatsüberprüfung deaktivieren (unsicher)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/de_DE.json b/l10n/de_DE.json
index 317a4400..39a832b7 100644
--- a/l10n/de_DE.json
+++ b/l10n/de_DE.json
@@ -80,6 +80,7 @@
"Markup": "Markup",
"Final": "Endgültig",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Zertifikatsüberprüfung deaktivieren (unsicher)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
\ No newline at end of file
diff --git a/l10n/es.js b/l10n/es.js
index 03636c02..77e47d6d 100644
--- a/l10n/es.js
+++ b/l10n/es.js
@@ -65,6 +65,7 @@ OC.L10N.register(
"Markup": "Cambios",
"Final": "Final",
"Original": "Original",
- "version": "versión"
+ "version": "versión",
+ "Disable certificate verification (insecure)": "Desactivar la verificación de certificados (inseguro)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/es.json b/l10n/es.json
index 0a5d8a7c..1fc44bd5 100644
--- a/l10n/es.json
+++ b/l10n/es.json
@@ -63,6 +63,7 @@
"Markup": "Cambios",
"Final": "Final",
"Original": "Original",
- "version": "versión"
+ "version": "versión",
+ "Disable certificate verification (insecure)": "Desactivar la verificación de certificados (inseguro)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
\ No newline at end of file
diff --git a/l10n/fr.js b/l10n/fr.js
index 8aa88178..a40289bb 100644
--- a/l10n/fr.js
+++ b/l10n/fr.js
@@ -63,6 +63,7 @@ OC.L10N.register(
"Markup": "Balisage",
"Final": "Finale",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Désactiver la vérification du certificat (non sur)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/fr.json b/l10n/fr.json
index eaea67d3..0d417f0f 100644
--- a/l10n/fr.json
+++ b/l10n/fr.json
@@ -61,6 +61,7 @@
"Markup": "Balisage",
"Final": "Finale",
"Original": "Original",
- "version": "version"
+ "version": "version",
+ "Disable certificate verification (insecure)": "Désactiver la vérification du certificat (non sur)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
diff --git a/l10n/ja.js b/l10n/ja.js
new file mode 100644
index 00000000..c66d3021
--- /dev/null
+++ b/l10n/ja.js
@@ -0,0 +1,87 @@
+OC.L10N.register(
+ "onlyoffice",
+ {
+ "Access denied" : "アクセス拒否されました",
+ "Invalid request" : "リクエストが不正です",
+ "Files not found" : "ファイルが見つかりません",
+ "File not found" : "ファイルが見つかりません",
+ "Not permitted" : "権限がありません",
+ "Download failed" : "ダウンロードできませんでした",
+ "The required folder was not found" : "開こうとしたフォルダーがありません",
+ "You don't have enough permission to create" : "充分な作成権限がありません",
+ "Template not found" : "テンプレートが見つかりません",
+ "Can't create file" : "ファイルを作成できません",
+ "Format is not supported" : "このフォーマットはサポートされていません",
+ "Conversion is not required" : "変換する必要はありません",
+ "Failed to download converted file" : "コンバート済みファイルをダウンロードできませんでした",
+ "ONLYOFFICE app is not configured. Please contact admin" : "ONLYOFFICEアプリが設定されていません。管理者に相談してください",
+ "FileId is empty" : "ファイルIDが空です",
+ "You do not have enough permissions to view the file" : "ファイルを閲覧する権限が足りません",
+ "Error occurred in the document service" : "ドキュメントサービスでエラーが発生しました",
+ "Not supported version" : "未サポートバージョン",
+ "ONLYOFFICE cannot be reached. Please contact admin" : "ONLYOFFICEに接続できません。管理者に相談してください",
+ "Loading, please wait." : "読み込み中です...。しばらくお待ちください。",
+ "File created" : "ファイル作成されました",
+ "Open in ONLYOFFICE" : "ONLYOFFICEで開く",
+ "Convert with ONLYOFFICE" : "ONLYOFFICEで変換",
+ "Document" : "ドキュメント",
+ "Spreadsheet" : "スプレッドシート",
+ "Presentation" : "プレゼンテーション",
+ "Error when trying to connect" : "接続時にエラーが発生しました",
+ "Settings have been successfully updated" : "設定が更新されました",
+ "Server can't read xml" : "サーバーでxmlを読み込ませんでした",
+ "Bad Response. Errors: " : "不正なレスポンス エラー: ",
+ "Documentation" : "ドキュメンテーション",
+ "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.": "ONLYOFFICE ドキュメントサービスの位置は、ドキュメントサービスがインストールされているサーバーのアドレスを指定します。以下の行の''をサーバーアドレスに変更してください。",
+ "Document Editing Service address" : "ドキュメント編集サービスサーバーアドレス",
+ "Advanced server settings" : "詳細サーバー設定",
+ "Document Editing Service address for internal requests from the server": "内部利用向けドキュメント編集サービスアドレス",
+ "Server address for internal requests from the Document Editing Service": "内部利用向けドキュメント編集サービスアドレス",
+ "Secret key (leave blank to disable)" : "シークレットキー (ブランクで無効)",
+ "Open file in the same tab" : "ファイルを同じタブで開く",
+ "The default application for opening the format": "以下のファイルフォーマットをデフォルトで開く",
+ "Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)" : "編集できるファイルフォーマット (フォーマットの制限により、以下のフォーマットを保存する時にデータが失われる可能性があります)",
+ "View details" : "詳細表示",
+ "Save" : "保存",
+ "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "アクティブコンテンツの混在は許可されていません。ドキュメントサーバーにはHTTPSアドレスが必要です",
+ "Restrict access to editors to following groups" : "アクセス編集できる人を以下のグループに制限する",
+ "Server settings" : "サーバー設定",
+ "Common settings" : "共通設定",
+ "Editor customization settings" : "エディターカスタム設定",
+ "The customization section allows personalizing the editor interface": "カスタマイズセクションでは、エディターインターフェイスをパーソナライズできます",
+ "Display Chat menu button" : "チャットメニューホタンを表示",
+ "Display the header more compact" : "ヘッダーをよりコンパクトに表示",
+ "Display Feedback & Support menu button" : "フィードバックとサポートメニューホタンを表示",
+ "Display Help menu button" : "ヘルプメニューホタンを表示",
+ "Display toolbar tabs" : "ツールバータブを表示",
+ "Save as" : "別名で保存",
+ "File saved" : "ファイルが保存されました",
+ "Insert image" : "画像を挿入",
+ "Select recipients" : "受取者を選択",
+ "Connect to demo ONLYOFFICE Document Server" : "ONLYOFFICEドキュメントのデモサーバーに接続する",
+ "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period.": "これはパブリックテストサーバーです。プライベートな機密データには使用しないでください。サーバーを30日間、利用できます。",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "30日間のテスト期間が終了したら、ONLYOFFICEドキュメントデモサーバーには繋がらなくなります。",
+ "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "パブリックONLYOFFICEドキュメントサーバーを使っているので、プライベートな機密データを利用しないようにしてください。",
+ "Secure view settings" : "セキュアビュー設定",
+ "Secure view enables you to secure documents by embedding a watermark" : "セキュアビューでドキュメント透かしを埋め込んでドキュメントを保護します",
+ "Enable watermarking" : "透かしを有効",
+ "Watermark text" : "透かしテキスト",
+ "DO NOT SHARE THIS" : "これを共有しない",
+ "Show watermark on tagged files" : "タグがついているファイルに透かしを入れる",
+ "Show watermark for users of groups" : "透かしをいれるユーザーのグループ",
+ "Supported placeholders" : "対応しているプレースフォルダー",
+ "Show watermark for all shares" : "共有全てに透かしを入れる",
+ "Show watermark for read only shares" : "読込専用ファイルには透かしを入れる",
+ "Link shares" : "リンク共有",
+ "Show watermark for all link shares" : "リンク共有時には全て透かしを入れる",
+ "Show watermark for download hidden shares" : "ダウンロード不可共有時には透かしを入れる",
+ "Show watermark for read only link shares" : "読込専用共有時にのみ透かしを入れる",
+ "Show watermark on link shares with specific system tags" : "特定のシステムタグが付いていてリンク共有されたものに透かしを入れる",
+ "Select tag" : "タグを選択",
+ "Select file to compare" : "比較するファイルを選択",
+ "Markup": "マークアップ",
+ "Final": "最終版",
+ "Original": "オリジナル",
+ "version": "バージョン"
+},
+"nplurals=2; plural=(n != 1);");
diff --git a/l10n/ja.json b/l10n/ja.json
new file mode 100644
index 00000000..889ccbad
--- /dev/null
+++ b/l10n/ja.json
@@ -0,0 +1,85 @@
+{ "translations": {
+ "Access denied" : "アクセス拒否されました",
+ "Invalid request" : "リクエストが不正です",
+ "Files not found" : "ファイルが見つかりません",
+ "File not found" : "ファイルが見つかりません",
+ "Not permitted" : "権限がありません",
+ "Download failed" : "ダウンロードできませんでした",
+ "The required folder was not found" : "開こうとしたフォルダーがありません",
+ "You don't have enough permission to create" : "充分な作成権限がありません",
+ "Template not found" : "テンプレートが見つかりません",
+ "Can't create file" : "ファイルを作成できません",
+ "Format is not supported" : "このフォーマットはサポートされていません",
+ "Conversion is not required" : "変換する必要はありません",
+ "Failed to download converted file" : "コンバート済みファイルをダウンロードできませんでした",
+ "ONLYOFFICE app is not configured. Please contact admin" : "ONLYOFFICEアプリが設定されていません。管理者に相談してください",
+ "FileId is empty" : "ファイルIDが空です",
+ "You do not have enough permissions to view the file" : "ファイルを閲覧する権限が足りません",
+ "Error occurred in the document service" : "ドキュメントサービスでエラーが発生しました",
+ "Not supported version" : "未サポートバージョン",
+ "ONLYOFFICE cannot be reached. Please contact admin" : "ONLYOFFICEに接続できません。管理者に相談してください",
+ "Loading, please wait." : "読み込み中です...。しばらくお待ちください。",
+ "File created" : "ファイル作成されました",
+ "Open in ONLYOFFICE" : "ONLYOFFICEで開く",
+ "Convert with ONLYOFFICE" : "ONLYOFFICEで変換",
+ "Document" : "ドキュメント",
+ "Spreadsheet" : "スプレッドシート",
+ "Presentation" : "プレゼンテーション",
+ "Error when trying to connect" : "接続時にエラーが発生しました",
+ "Settings have been successfully updated" : "設定が更新されました",
+ "Server can't read xml" : "サーバーでxmlを読み込ませんでした",
+ "Bad Response. Errors: " : "不正なレスポンス エラー: ",
+ "Documentation" : "ドキュメンテーション",
+ "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.": "ONLYOFFICE ドキュメントサービスの位置は、ドキュメントサービスがインストールされているサーバーのアドレスを指定します。以下の行の''をサーバーアドレスに変更してください。",
+ "Document Editing Service address" : "ドキュメント編集サービスサーバーアドレス",
+ "Advanced server settings" : "詳細サーバー設定",
+ "Document Editing Service address for internal requests from the server": "内部利用向けドキュメント編集サービスアドレス",
+ "Server address for internal requests from the Document Editing Service": "内部利用向けドキュメント編集サービスアドレス",
+ "Secret key (leave blank to disable)" : "シークレットキー (ブランクで無効)",
+ "Open file in the same tab" : "ファイルを同じタブで開く",
+ "The default application for opening the format": "以下のファイルフォーマットをデフォルトで開く",
+ "Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)" : "編集できるファイルフォーマット (フォーマットの制限により、以下のフォーマットを保存する時にデータが失われる可能性があります)",
+ "View details" : "詳細表示",
+ "Save" : "保存",
+ "Mixed Active Content is not allowed. HTTPS address for Document Server is required." : "アクティブコンテンツの混在は許可されていません。ドキュメントサーバーにはHTTPSアドレスが必要です",
+ "Restrict access to editors to following groups" : "アクセス編集できる人を以下のグループに制限する",
+ "Server settings" : "サーバー設定",
+ "Common settings" : "共通設定",
+ "Editor customization settings" : "エディターカスタム設定",
+ "The customization section allows personalizing the editor interface": "カスタマイズセクションでは、エディターインターフェイスをパーソナライズできます",
+ "Display Chat menu button" : "チャットメニューホタンを表示",
+ "Display the header more compact" : "ヘッダーをよりコンパクトに表示",
+ "Display Feedback & Support menu button" : "フィードバックとサポートメニューホタンを表示",
+ "Display Help menu button" : "ヘルプメニューホタンを表示",
+ "Display toolbar tabs" : "ツールバータブを表示",
+ "Save as" : "別名で保存",
+ "File saved" : "ファイルが保存されました",
+ "Insert image" : "画像を挿入",
+ "Select recipients" : "受取者を選択",
+ "Connect to demo ONLYOFFICE Document Server" : "ONLYOFFICEドキュメントのデモサーバーに接続する",
+ "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period.": "これはパブリックテストサーバーです。プライベートな機密データには使用しないでください。サーバーを30日間、利用できます。",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." : "30日間のテスト期間が終了したら、ONLYOFFICEドキュメントデモサーバーには繋がらなくなります。",
+ "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." : "パブリックONLYOFFICEドキュメントサーバーを使っているので、プライベートな機密データを利用しないようにしてください。",
+ "Secure view settings" : "セキュアビュー設定",
+ "Secure view enables you to secure documents by embedding a watermark" : "セキュアビューでドキュメント透かしを埋め込んでドキュメントを保護します",
+ "Enable watermarking" : "透かしを有効",
+ "Watermark text" : "透かしテキスト",
+ "DO NOT SHARE THIS" : "これを共有しない",
+ "Show watermark on tagged files" : "タグがついているファイルに透かしを入れる",
+ "Show watermark for users of groups" : "透かしをいれるユーザーのグループ",
+ "Supported placeholders" : "対応しているプレースフォルダー",
+ "Show watermark for all shares" : "共有全てに透かしを入れる",
+ "Show watermark for read only shares" : "読込専用ファイルには透かしを入れる",
+ "Link shares" : "リンク共有",
+ "Show watermark for all link shares" : "リンク共有時には全て透かしを入れる",
+ "Show watermark for download hidden shares" : "ダウンロード不可共有時には透かしを入れる",
+ "Show watermark for read only link shares" : "読込専用共有時にのみ透かしを入れる",
+ "Show watermark on link shares with specific system tags" : "特定のシステムタグが付いていてリンク共有されたものに透かしを入れる",
+ "Select tag" : "タグを選択",
+ "Select file to compare" : "比較するファイルを選択",
+ "Markup": "マークアップ",
+ "Final": "最終版",
+ "Original": "オリジナル",
+ "version": "バージョン"
+},"pluralForm" :"nplurals=2; plural=(n != 1);"
+}
\ No newline at end of file
diff --git a/l10n/pl.js b/l10n/pl.js
index e7491b68..20678f53 100644
--- a/l10n/pl.js
+++ b/l10n/pl.js
@@ -78,6 +78,7 @@ OC.L10N.register(
"Show watermark for read only link shares" : "Pokaż znak wodny dla udostępnień linków tylko do odczytu",
"Show watermark on link shares with specific system tags" : "Pokaż znak wodny dla udostępnień linków z wybranymi tagami",
"Select tag" : "Wybierz tag",
- "version": "wersja"
+ "version": "wersja",
+ "Disable certificate verification (insecure)": "Wyłącz weryfikację certyfikatu (niebezpieczne)"
},
"nplurals=2; plural=(n != 1);");
\ No newline at end of file
diff --git a/l10n/pl.json b/l10n/pl.json
index 4159082d..987b190b 100644
--- a/l10n/pl.json
+++ b/l10n/pl.json
@@ -76,6 +76,7 @@
"Show watermark for read only link shares" : "Pokaż znak wodny dla udostępnień linków tylko do odczytu",
"Show watermark on link shares with specific system tags" : "Pokaż znak wodny dla udostępnień linków z wybranymi tagami",
"Select tag" : "Wybierz tag",
- "version": "wersja"
+ "version": "wersja",
+ "Disable certificate verification (insecure)": "Wyłącz weryfikację certyfikatu (niebezpieczne)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
\ No newline at end of file
diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js
index 5ab9687d..f2a38e30 100644
--- a/l10n/pt_BR.js
+++ b/l10n/pt_BR.js
@@ -62,6 +62,7 @@ OC.L10N.register(
"Supported placeholders" : "Espaços reservados suportados",
"Select tag" : "Selecionar etiqueta",
"Select file to compare" : "Selecionar arquivo para comparar",
- "version": "versão"
+ "version": "versão",
+ "Disable certificate verification (insecure)": "Desativar a verificação do certificado (inseguro)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json
index badf9de8..afe5904f 100644
--- a/l10n/pt_BR.json
+++ b/l10n/pt_BR.json
@@ -60,6 +60,7 @@
"Supported placeholders" : "Espaços reservados suportados",
"Select tag" : "Selecionar etiqueta",
"Select file to compare" : "Selecionar arquivo para comparar",
- "version": "versão"
+ "version": "versão",
+ "Disable certificate verification (insecure)": "Desativar a verificação do certificado (inseguro)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
diff --git a/l10n/ru.js b/l10n/ru.js
index f7aa20b3..065322c9 100644
--- a/l10n/ru.js
+++ b/l10n/ru.js
@@ -83,6 +83,7 @@ OC.L10N.register(
"Markup": "Изменения",
"Final": "Изменённый документ",
"Original": "Исходный документ",
- "version": "версия"
+ "version": "версия",
+ "Disable certificate verification (insecure)": "Отключить проверку сертификата (небезопасно)"
},
"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 884f244e..e8dbd836 100644
--- a/l10n/ru.json
+++ b/l10n/ru.json
@@ -81,6 +81,7 @@
"Markup": "Изменения",
"Final": "Изменённый документ",
"Original": "Исходный документ",
- "version": "версия"
+ "version": "версия",
+ "Disable certificate verification (insecure)": "Отключить проверку сертификата (небезопасно)"
},"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 91122fb7..a7ce66ad 100644
--- a/l10n/sv.js
+++ b/l10n/sv.js
@@ -78,6 +78,7 @@ OC.L10N.register(
"Show watermark for read only link shares" : "Visa vattenmärke för skrivskyddade länkdelningar",
"Show watermark on link shares with specific system tags" : "Visa vattenmärke för länkdelningar med specifika systemtaggar",
"Select tag" : "Välj tagg",
- "version": "verzia"
+ "version": "verzia",
+ "Disable certificate verification (insecure)": "Använd inte certifikatsverifiering (osäkert)"
},
"nplurals=2; plural=(n != 1);");
diff --git a/l10n/sv.json b/l10n/sv.json
index 22985dc4..eb07c467 100644
--- a/l10n/sv.json
+++ b/l10n/sv.json
@@ -76,6 +76,7 @@
"Show watermark for read only link shares" : "Visa vattenmärke för skrivskyddade länkdelningar",
"Show watermark on link shares with specific system tags" : "Visa vattenmärke för länkdelningar med specifika systemtaggar",
"Select tag" : "Välj tagg",
- "version": "verzia"
+ "version": "verzia",
+ "Disable certificate verification (insecure)": "Använd inte certifikatsverifiering (osäkert)"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
\ No newline at end of file
diff --git a/lib/adminsection.php b/lib/adminsection.php
index 04cb230e..c1ceae03 100644
--- a/lib/adminsection.php
+++ b/lib/adminsection.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/lib/adminsettings.php b/lib/adminsettings.php
index 7d6155ba..56764b64 100644
--- a/lib/adminsettings.php
+++ b/lib/adminsettings.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/lib/appconfig.php b/lib/appconfig.php
index c4194286..98a89693 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -900,13 +890,29 @@ public function isUserAllowedToUse() {
}
/**
- * Get the turn off verification setting
+ * Save the document service verification setting to the application configuration
+ *
+ * @param bool $verifyPeerOff - parameter verification setting
+ */
+ public function SetVerifyPeerOff($verifyPeerOff) {
+ $this->logger->info("SetVerifyPeerOff " . json_encode($verifyPeerOff), ["app" => $this->appName]);
+
+ $this->config->setAppValue($this->appName, $this->_verification, json_encode($verifyPeerOff));
+ }
+
+ /**
+ * Get the document service verification setting to the application configuration
*
* @return bool
*/
- public function TurnOffVerification() {
- $turnOff = $this->GetSystemValue($this->_verification);
- return $turnOff === true;
+ public function GetVerifyPeerOff() {
+ $turnOff = $this->config->getAppValue($this->appName, $this->_verification, "");
+
+ if (!empty($turnOff)) {
+ return $turnOff === "true";
+ }
+
+ return $this->GetSystemValue($this->_verification);
}
/**
@@ -990,6 +996,9 @@ public function FormatsSetting() {
"odp" => [ "mime" => "application/vnd.oasis.opendocument.presentation", "type" => "presentation", "conv" => true, "editable" => true ],
"ods" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet", "type" => "spreadsheet", "conv" => true, "editable" => true ],
"odt" => [ "mime" => "application/vnd.oasis.opendocument.text", "type" => "text", "conv" => true, "editable" => true ],
+ "otp" => [ "mime" => "application/vnd.oasis.opendocument.presentation-template", "type" => "presentation", "conv" => true ],
+ "ots" => [ "mime" => "application/vnd.oasis.opendocument.spreadsheet-template", "type" => "spreadsheet", "conv" => true ],
+ "ott" => [ "mime" => "application/vnd.oasis.opendocument.text-template", "type" => "text", "conv" => true ],
"pdf" => [ "mime" => "application/pdf", "type" => "text" ],
"pot" => [ "type" => "presentation", "conv" => true ],
"potm" => [ "mime" => "application/vnd.ms-powerpoint.template.macroEnabled.12", "type" => "presentation", "conv" => true ],
diff --git a/lib/crypt.php b/lib/crypt.php
index 7a5e4eaf..2b68d9a1 100644
--- a/lib/crypt.php
+++ b/lib/crypt.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/lib/directeditor.php b/lib/directeditor.php
index 33cea559..dd156e5f 100644
--- a/lib/directeditor.php
+++ b/lib/directeditor.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -244,6 +234,7 @@ public function open(IToken $token): Response {
"filePath" => $filePath,
"shareToken" => null,
"directToken" => $directToken,
+ "version" => 0,
"inframe" => false
];
@@ -262,7 +253,7 @@ public function open(IToken $token): Response {
return $response;
} catch (\Exception $e) {
- $this->logger->logException($e, ["DirectEditor open", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "DirectEditor open", "app" => $this->appName]);
return $this->renderError($e->getMessage());
}
}
diff --git a/lib/documentservice.php b/lib/documentservice.php
index a084d59f..7a4fda9c 100644
--- a/lib/documentservice.php
+++ b/lib/documentservice.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -214,7 +204,7 @@ function ProcessConvServResponceError($errorCode) {
$errorMessage = $errorMessageTemplate . ": Error while accessing the conversion result database";
break;
case -5:
- $errorMessage = $errorMessageTemplate . ": Error unexpected guid";
+ $errorMessage = $errorMessageTemplate . ": Incorrect password";
break;
case -4:
$errorMessage = $errorMessageTemplate . ": Error while downloading the document file to be converted.";
@@ -354,7 +344,7 @@ public function Request($url, $method = "get", $opts = null) {
if (null === $opts) {
$opts = array();
}
- if (substr($url, 0, strlen("https")) === "https" && $this->config->TurnOffVerification()) {
+ if (substr($url, 0, strlen("https")) === "https" && $this->config->GetVerifyPeerOff()) {
$opts["verify"] = false;
}
if (!array_key_exists("timeout", $opts)) {
diff --git a/lib/filecreator.php b/lib/filecreator.php
index 8cf2d211..620f17e2 100644
--- a/lib/filecreator.php
+++ b/lib/filecreator.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -156,7 +146,7 @@ public function create(File $file, string $creatorId = null, string $templateId
try {
$file->putContent($template);
} catch (NotPermittedException $e) {
- $this->logger->logException($e, ["FileCreator: Can't create file: $fileName", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "FileCreator: Can't create file: $fileName", "app" => $this->appName]);
}
}
}
diff --git a/lib/fileutility.php b/lib/fileutility.php
index ada72a4f..5dc46905 100644
--- a/lib/fileutility.php
+++ b/lib/fileutility.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -129,11 +119,11 @@ public function getFileByToken($fileId, $shareToken, $path = null) {
}
if ($node instanceof Folder) {
- if ($fileId !== null) {
+ if ($fileId !== null && $fileId !== 0) {
try {
$files = $node->getById($fileId);
} catch (\Exception $e) {
- $this->logger->logException($e, ["getFileByToken: $fileId", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "getFileByToken: $fileId", "app" => $this->appName]);
return [null, $this->trans->t("Invalid request"), null];
}
@@ -146,7 +136,7 @@ public function getFileByToken($fileId, $shareToken, $path = null) {
try {
$file = $node->get($path);
} catch (\Exception $e) {
- $this->logger->logException($e, ["getFileByToken for path: $path", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "getFileByToken for path: $path", "app" => $this->appName]);
return [null, $this->trans->t("Invalid request"), null];
}
}
@@ -178,7 +168,7 @@ public function getNodeByToken($shareToken) {
try {
$node = $share->getNode();
} catch (NotFoundException $e) {
- $this->logger->logException($e, ["getNodeByToken error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "getNodeByToken error", "app" => $this->appName]);
return [null, $this->trans->t("File not found"), null];
}
@@ -201,7 +191,7 @@ private function getShare($shareToken) {
try {
$share = $this->shareManager->getShareByToken($shareToken);
} catch (ShareNotFound $e) {
- $this->logger->logException($e, ["getShare error", "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "getShare error", "app" => $this->appName]);
$share = null;
}
@@ -237,7 +227,7 @@ public function getKey($file, $origin = false) {
return $key;
}
} catch (\Exception $e) {
- $this->logger->logException($e, ["Failed to request federated key " . $file->getId(), "app" => $this->appName]);
+ $this->logger->logException($e, ["message" => "Failed to request federated key " . $file->getId(), "app" => $this->appName]);
}
}
@@ -282,4 +272,19 @@ private function getFederatedKey($file) {
return $key;
}
+
+ /**
+ * Generate unique file version key
+ *
+ * @param OCA\Files_Versions\Versions\IVersion $version - file version
+ *
+ * @return string
+ */
+ public function getVersionKey($version) {
+ $instanceId = $this->config->GetSystemValue("instanceid", true);
+
+ $key = $instanceId . "_" . $version->getSourceFile()->getEtag() . "_" . $version->getRevisionId();
+
+ return $key;
+ }
}
diff --git a/lib/fileversions.php b/lib/fileversions.php
new file mode 100644
index 00000000..e9ad3bab
--- /dev/null
+++ b/lib/fileversions.php
@@ -0,0 +1,328 @@
+is_dir($path)) {
+ return true;
+ }
+ if (!$createIfNotExist) {
+ return false;
+ }
+ $view->mkdir($path);
+ return true;
+ }
+
+ /**
+ * Get view and path for changes
+ *
+ * @param string $user - user id
+ * @param string $fileId - file id
+ * @param bool $createIfNotExist - create folder if not exist
+ *
+ * @return array
+ */
+ private static function getView($userId, $fileId, $createIfNotExist = false) {
+ $view = new View("/" . $userId);
+
+ $path = self::$appName;
+ if (!self::checkFolderExist($view, $path, $createIfNotExist)) {
+ return [null, null];
+ }
+
+ if ($fileId === null) {
+ return [$view, $path];
+ }
+
+ $path = $path . "/" . $fileId;
+ if (!self::checkFolderExist($view, $path, $createIfNotExist)) {
+ return [null, null];
+ }
+
+ return [$view, $path];
+ }
+
+ /**
+ * Get changes from stored to history object
+ *
+ * @param string $ownerId - file owner id
+ * @param string $fileId - file id
+ * @param string $versionId - file version
+ * @param string $prevVersion - previous version for check
+ *
+ * @return array
+ */
+ public static function getHistoryData($ownerId, $fileId, $versionId, $prevVersion) {
+ $logger = \OC::$server->getLogger();
+
+ if ($ownerId === null || $fileId === null) {
+ return null;
+ }
+
+ list ($view, $path) = self::getView($ownerId, $fileId);
+ if ($view === null) {
+ return null;
+ }
+
+ $historyPath = $path . "/" . $versionId . self::$historyExt;
+ if (!$view->file_exists($historyPath)) {
+ return null;
+ }
+
+ $historyDataString = $view->file_get_contents($historyPath);
+
+ try {
+ $historyData = json_decode($historyDataString, true);
+
+ if ($historyData["prev"] !== $prevVersion) {
+ $logger->debug("getHistoryData: previous $prevVersion != " . $historyData["prev"], ["app" => self::$appName]);
+
+ $view->unlink($historyPath);
+ $logger->debug("getHistoryData: delete $historyPath", ["app" => self::$appName]);
+
+ $changesPath = $path . "/" . $versionId . self::$changesExt;
+ if ($view->file_exists($changesPath)) {
+ $view->unlink($changesPath);
+ $logger->debug("getHistoryData: delete $changesPath", ["app" => self::$appName]);
+ }
+ return null;
+ }
+
+ return $historyData;
+ } catch (\Exception $e) {
+ $logger->logException($e, ["message" => "getHistoryData: $fileId $versionId", "app" => self::$appName]);
+ return null;
+ }
+ }
+
+ /**
+ * Check if changes is stored
+ *
+ * @param string $ownerId - file owner id
+ * @param string $fileId - file id
+ * @param string $versionId - file version
+ *
+ * @return bool
+ */
+ public static function hasChanges($ownerId, $fileId, $versionId) {
+ if ($ownerId === null || $fileId === null) {
+ return false;
+ }
+
+ list ($view, $path) = self::getView($ownerId, $fileId);
+ if ($view === null) {
+ return false;
+ }
+
+ $changesPath = $path . "/" . $versionId . self::$changesExt;
+ return $view->file_exists($changesPath);
+ }
+
+ /**
+ * Get changes file
+ *
+ * @param string $ownerId - file owner id
+ * @param string $fileId - file id
+ * @param string $versionId - file version
+ *
+ * @return File
+ */
+ public static function getChangesFile($ownerId, $fileId, $versionId) {
+ if ($ownerId === null || $fileId === null) {
+ return null;
+ }
+
+ list ($view, $path) = self::getView($ownerId, $fileId);
+ if ($view === null) {
+ return null;
+ }
+
+ $changesPath = $path . "/" . $versionId . self::$changesExt;
+ if (!$view->file_exists($changesPath)) {
+ return null;
+ }
+
+ $changesInfo = $view->getFileInfo($changesPath);
+ $changes = new File($view->getRoot(), $view, $changesPath, $changesInfo);
+
+ \OC::$server->getLogger()->debug("getChangesFile: $fileId for $ownerId get changes $changesPath", ["app" => self::$appName]);
+
+ return $changes;
+ }
+
+ /**
+ * Save history to storage
+ *
+ * @param OCP\Files\FileInfo $fileInfo - file info
+ * @param array $history - file history
+ * @param string $changes - file changes
+ * @param string $prevVersion - previous version for check
+ */
+ public static function saveHistory($fileInfo, $history, $changes, $prevVersion) {
+ $logger = \OC::$server->getLogger();
+
+ $owner = $fileInfo->getOwner();
+
+ if ($owner === null) {
+ return;
+ }
+ if (empty($history) || empty($changes)) {
+ return;
+ }
+
+ $ownerId = $owner->getUID();
+ $fileId = $fileInfo->getId();
+ $versionId = $fileInfo->getMtime();
+
+ list ($view, $path) = self::getView($ownerId, $fileId, true);
+
+ try {
+ $changesPath = $path . "/" . $versionId . self::$changesExt;
+ $view->touch($changesPath);
+ $view->file_put_contents($changesPath, $changes);
+
+ $history["prev"] = $prevVersion;
+ $historyPath = $path . "/" . $versionId . self::$historyExt;
+ $view->touch($historyPath);
+ $view->file_put_contents($historyPath, json_encode($history));
+
+ $logger->debug("saveHistory: $fileId for $ownerId stored changes $changesPath history $historyPath", ["app" => self::$appName]);
+ } catch (\Exception $e) {
+ $logger->logException($e, ["message" => "saveHistory: save $fileId history error", "app" => self::$appName]);
+ }
+ }
+
+ /**
+ * Delete all versions of file
+ *
+ * @param string $ownerId - file owner id
+ * @param string $fileId - file id
+ */
+ public static function deleteAllVersions($ownerId, $fileId = null) {
+ $logger = \OC::$server->getLogger();
+
+ $logger->debug("deleteAllVersions $ownerId $fileId", ["app" => self::$appName]);
+
+ if ($ownerId === null) {
+ return;
+ }
+
+ list ($view, $path) = self::getView($ownerId, $fileId);
+ if ($view === null) {
+ return;
+ }
+
+ $view->unlink($path);
+ }
+
+ /**
+ * Delete changes and history
+ *
+ * @param string $ownerId - file owner id
+ * @param string $fileId - file id
+ * @param string $versionId - file version
+ */
+ public static function deleteVersion($ownerId, $fileId, $versionId) {
+ $logger = \OC::$server->getLogger();
+
+ $logger->debug("deleteVersion $fileId ($versionId)", ["app" => self::$appName]);
+
+ if ($ownerId === null) {
+ return;
+ }
+ if ($fileId === null || empty($versionId)) {
+ return;
+ }
+
+ list ($view, $path) = self::getView($ownerId, $fileId);
+ if ($view === null) {
+ return null;
+ }
+
+ $historyPath = $path . "/" . $versionId . self::$historyExt;
+ if ($view->file_exists($historyPath)) {
+ $view->unlink($historyPath);
+ $logger->debug("deleteVersion $historyPath", ["app" => self::$appName]);
+ }
+
+ $changesPath = $path . "/" . $versionId . self::$changesExt;
+ if ($view->file_exists($changesPath)) {
+ $view->unlink($changesPath);
+ $logger->debug("deleteVersion $changesPath", ["app" => self::$appName]);
+ }
+ }
+}
diff --git a/lib/hooks.php b/lib/hooks.php
new file mode 100644
index 00000000..013c79c9
--- /dev/null
+++ b/lib/hooks.php
@@ -0,0 +1,142 @@
+getId();
+
+ FileVersions::deleteAllVersions($ownerId, $fileId);
+ } catch (\Exception $e) {
+ \OC::$server->getLogger()->logException($e, ["message" => "Hook: fileDelete " . json_encode($params), "app" => self::$appName]);
+ }
+ }
+
+ /**
+ * Erase versions of deleted version of file
+ *
+ * @param array $params - hook param
+ */
+ public static function fileVersionDelete($params) {
+ $pathVersion = $params["path"];
+ if (empty($pathVersion)) {
+ return;
+ }
+
+ try {
+ list ($filePath, $versionId) = FileVersions::splitPathVersion($pathVersion);
+ if (empty($filePath)) {
+ return;
+ }
+
+ $ownerId = Filesystem::getOwner($filePath);
+
+ $fileInfo = Filesystem::getFileInfo($filePath);
+ $fileId = $fileInfo->getId();
+
+ FileVersions::deleteVersion($ownerId, $fileId, $versionId);
+ } catch (\Exception $e) {
+ \OC::$server->getLogger()->logException($e, ["message" => "Hook: fileVersionDelete " . json_encode($params), "app" => self::$appName]);
+ }
+ }
+
+ /**
+ * Erase versions of restored version of file
+ *
+ * @param array $params - hook param
+ */
+ public static function fileVersionRestore($params) {
+ $filePath = $params["path"];
+ if (empty($filePath)) {
+ return;
+ }
+
+ $versionId = $params["revision"];
+
+ try {
+ $ownerId = Filesystem::getOwner($filePath);
+
+ $fileInfo = Filesystem::getFileInfo($filePath);
+ $fileId = $fileInfo->getId();
+
+ FileVersions::deleteVersion($ownerId, $fileId, $versionId);
+ } catch (\Exception $e) {
+ \OC::$server->getLogger()->logException($e, ["message" => "Hook: fileVersionRestore " . json_encode($params), "app" => self::$appName]);
+ }
+ }
+}
diff --git a/lib/templatemanager.php b/lib/templatemanager.php
index b9c0911a..779bb7a0 100644
--- a/lib/templatemanager.php
+++ b/lib/templatemanager.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
diff --git a/templates/editor.php b/templates/editor.php
index 381c316e..617c9ff1 100644
--- a/templates/editor.php
+++ b/templates/editor.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -42,6 +32,7 @@
data-path=""
data-sharetoken=""
data-directtoken=""
+ data-version=""
data-inframe="">
diff --git a/templates/loader.php b/templates/loader.php
new file mode 100644
index 00000000..0dcb3215
--- /dev/null
+++ b/templates/loader.php
@@ -0,0 +1,124 @@
+
+
+
+
diff --git a/templates/settings.php b/templates/settings.php
index 222fe3d5..2b4ab7f5 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -3,27 +3,17 @@
*
* (c) Copyright Ascensio System SIA 2020
*
- * This program is a free software product.
- * You can redistribute it and/or modify it under the terms of the GNU Affero General Public License
- * (AGPL) version 3 as published by the Free Software Foundation.
- * In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
- * that Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This program is distributed WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * For details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050.
- *
- * The interactive user interfaces in modified source and object code versions of the Program
- * must display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
- *
- * Pursuant to Section 7(b) of the License you must retain the original Product logo when distributing the program.
- * Pursuant to Section 7(e) we decline to grant you any rights under trademark law for use of our trademarks.
- *
- * All the Product's GUI elements, including illustrations and icon sets, as well as technical
- * writing content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International.
- * See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
@@ -54,6 +44,12 @@