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

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Linnik <sergey.linnik@onlyoffice.com>2022-11-03 10:46:39 +0300
committerSergey Linnik <sergey.linnik@onlyoffice.com>2022-11-03 10:46:39 +0300
commit934f008e0ef76299a4e1fdfa42539c32e41aeba0 (patch)
tree1cb613b9bbfbd945b539b0984c70e1f467da4d20
parenta7b5a324cc9fc6ac219136a7071da400fd277a7d (diff)
parentd131b6b812cd750f96c1e215c0e39d113df9a783 (diff)
Merge branch 'develop' into feature/nc-24feature/nc-24
# Conflicts: # CHANGELOG.md
-rw-r--r--CHANGELOG.md3
-rw-r--r--README.md6
-rw-r--r--controller/editorapicontroller.php4
-rw-r--r--controller/settingscontroller.php6
-rw-r--r--js/settings.js4
-rw-r--r--l10n/ru.js3
-rw-r--r--l10n/ru.json3
-rw-r--r--lib/appconfig.php27
-rw-r--r--templates/settings.php6
9 files changed, 55 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index acc7967..939b485 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Change Log
+## Added
+- disable plugins setting
+
## 7.5.8
## Changed
- fix download permission
diff --git a/README.md b/README.md
index 17def09..68eb2c2 100644
--- a/README.md
+++ b/README.md
@@ -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 c5d9049..a40fe43 100644
--- a/controller/editorapicontroller.php
+++ b/controller/editorapicontroller.php
@@ -750,6 +750,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 aa8ffe4..65484b4 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");
diff --git a/l10n/ru.js b/l10n/ru.js
index cb6fa25..3937f1a 100644
--- a/l10n/ru.js
+++ b/l10n/ru.js
@@ -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) { ?>