diff options
author | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2022-11-03 10:45:12 +0300 |
---|---|---|
committer | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2022-11-03 10:45:12 +0300 |
commit | bc74dbfdd2620c0ffda992f2ef9949b074ce93da (patch) | |
tree | e25ef6e4da119945ee7d983cb4c99d6a786b105f | |
parent | a3a7a8ea268368263ba1932b5ffdc54bc3f39732 (diff) | |
parent | d131b6b812cd750f96c1e215c0e39d113df9a783 (diff) |
Merge branch 'develop' into feature/nc-23feature/nc-23
# Conflicts:
# CHANGELOG.md
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | controller/editorapicontroller.php | 4 | ||||
-rw-r--r-- | controller/settingscontroller.php | 6 | ||||
-rw-r--r-- | js/settings.js | 4 | ||||
-rw-r--r-- | l10n/ru.js | 3 | ||||
-rw-r--r-- | l10n/ru.json | 3 | ||||
-rw-r--r-- | lib/appconfig.php | 27 | ||||
-rw-r--r-- | templates/settings.php | 6 |
9 files changed, 55 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e982da..c68bb78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## Added +- disable plugins setting + ## Changed - Nextcloud v22 is no longer supported @@ -86,9 +86,9 @@ Sometimes your network configuration might not allow the requests between instal The _Advanced server settings_ allows to set the ONLYOFFICE Document Server address for internal requests from Nextcloud server and the returning Nextcloud address for the internal requests from ONLYOFFICE Document Server. You need to enter them in the appropriate fields. -To restrict the access to ONLYOFFICE Document Server and for security reasons and data integrity the encrypted signature is used. -Specify the _Secret key_ in the Nextcloud administrative configuration. -In the ONLYOFFICE Document Server [config file](https://api.onlyoffice.com/editors/signature/) specify the same secret key and enable the validation. +Starting from version 7.2, JWT is enabled by default and the secret key is generated automatically to restrict the access to ONLYOFFICE Docs and for security reasons and data integrity. +Specify your own **Secret key** in the Nextcloud administrative configuration. +In the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/editors/signature/), specify the same secret key and enable the validation. Enable or disable the _Open file in the same tab_ setting. diff --git a/controller/editorapicontroller.php b/controller/editorapicontroller.php index b7d6819..9eb8af3 100644 --- a/controller/editorapicontroller.php +++ b/controller/editorapicontroller.php @@ -740,6 +740,10 @@ class EditorApiController extends OCSController { $params["editorConfig"]["customization"]["macros"] = false; } + //default is true + if($this->config->GetCustomizationPlugins() === false) { + $params["editorConfig"]["customization"]["plugins"] = false; + } /* from system config */ diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 60d4fe0..e5b6138 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -127,6 +127,7 @@ class SettingsController extends Controller { "successful" => $this->config->SettingsAreSuccessful(), "watermark" => $this->config->GetWatermarkSettings(), "macros" => $this->config->GetCustomizationMacros(), + "plugins" => $this->config->GetCustomizationPlugins(), "tagsEnabled" => \OC::$server->getAppManager()->isEnabledForUser("systemtags"), "reviewDisplay" => $this->config->GetCustomizationReviewDisplay(), "theme" => $this->config->GetCustomizationTheme(), @@ -204,6 +205,7 @@ class SettingsController extends Controller { * @param bool $help - display help * @param bool $toolbarNoTabs - display toolbar tab * @param string $reviewDisplay - review viewing mode + * @param bool $plugins - enable plugins * * @return array */ @@ -221,7 +223,8 @@ class SettingsController extends Controller { $help, $toolbarNoTabs, $reviewDisplay, - $theme + $theme, + $plugins ) { $this->config->SetDefaultFormats($defFormats); @@ -239,6 +242,7 @@ class SettingsController extends Controller { $this->config->SetCustomizationToolbarNoTabs($toolbarNoTabs); $this->config->SetCustomizationReviewDisplay($reviewDisplay); $this->config->SetCustomizationTheme($theme); + $this->config->SetCustomizationPlugins($plugins); return [ ]; diff --git a/js/settings.js b/js/settings.js index 87adadc..37b7ab2 100644 --- a/js/settings.js +++ b/js/settings.js @@ -205,6 +205,7 @@ var toolbarNoTabs = $("#onlyofficeToolbarNoTabs").is(":checked"); var reviewDisplay = $("input[type='radio'][name='reviewDisplay']:checked").attr("id").replace("onlyofficeReviewDisplay_", ""); var theme = $("input[type='radio'][name='theme']:checked").attr("id").replace("onlyofficeTheme_", ""); + var plugins = $("#onlyofficePlugins").is(":checked"); $.ajax({ method: "PUT", @@ -224,7 +225,8 @@ help: help, toolbarNoTabs: toolbarNoTabs, reviewDisplay: reviewDisplay, - theme: theme + theme: theme, + plugins: plugins }, success: function onSuccess(response) { $(".section-onlyoffice").removeClass("icon-loading"); @@ -130,6 +130,7 @@ OC.L10N.register( "Custom filter": "Пользовательский фильтр", "group": "группа", "Advanced": "Дополнительно", - "Provide advanced document permissions using ONLYOFFICE Docs": "Предоставление расширенных прав доступа к документам с помощью ONLYOFFICE Docs" + "Provide advanced document permissions using ONLYOFFICE Docs": "Предоставление расширенных прав доступа к документам с помощью ONLYOFFICE Docs", + "Enable plugins": "Включить работу с плагинами" }, "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"); diff --git a/l10n/ru.json b/l10n/ru.json index fe82be6..933e1d7 100644 --- a/l10n/ru.json +++ b/l10n/ru.json @@ -128,6 +128,7 @@ "Custom filter": "Пользовательский фильтр", "group": "группа", "Advanced": "Дополнительно", - "Provide advanced document permissions using ONLYOFFICE Docs": "Предоставление расширенных прав доступа к документам с помощью ONLYOFFICE Docs" + "Provide advanced document permissions using ONLYOFFICE Docs": "Предоставление расширенных прав доступа к документам с помощью ONLYOFFICE Docs", + "Enable plugins": "Включить работу с плагинами" },"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);" }
\ No newline at end of file diff --git a/lib/appconfig.php b/lib/appconfig.php index 47b20b6..1562a17 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -299,6 +299,13 @@ class AppConfig { public $_customizationMacros = "customization_macros"; /** + * The config key for the plugins + * + * @var string + */ + public $_customizationPlugins = "customization_plugins"; + + /** * @param string $AppName - application name */ public function __construct($AppName) { @@ -1179,6 +1186,26 @@ class AppConfig { } /** + * Save plugins setting + * + * @param bool $value - enable macros + */ + public function SetCustomizationPlugins($value) { + $this->logger->info("Set plugins enabled: " . json_encode($value), ["app" => $this->appName]); + + $this->config->setAppValue($this->appName, $this->_customizationPlugins, json_encode($value)); + } + + /** + * Get plugins setting + * + * @return bool + */ + public function GetCustomizationPlugins() { + return $this->config->getAppValue($this->appName, $this->_customizationPlugins, "true") === "true"; + } + + /** * Additional data about formats * * @var array diff --git a/templates/settings.php b/templates/settings.php index fd9d0d8..b7c22e4 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -126,6 +126,12 @@ <button id="onlyofficeClearVersionHistory" class="button"><?php p($l->t("Clear")) ?></button> </p> + <p> + <input type="checkbox" class="checkbox" id="onlyofficePlugins" + <?php if ($_["plugins"]) { ?>checked="checked"<?php } ?> /> + <label for="onlyofficePlugins"><?php p($l->t("Enable plugins")) ?></label> + </p> + <p class="onlyoffice-header"><?php p($l->t("The default application for opening the format")) ?></p> <div class="onlyoffice-exts"> <?php foreach ($_["formats"] as $format => $setting) { ?> |