t("The default application for opening the format")) ?>
$setting) { ?>
From 7707d2ebe7273d09ae6da70735fb7d989b501f26 Mon Sep 17 00:00:00 2001
From: Antipkin-A
Date: Wed, 28 Sep 2022 11:51:56 +0300
Subject: [PATCH 02/27] disable plugins to changelog
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 422feb99..3b0f2c6e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## Added
- Chinese (Traditional, Taiwan), Basque (Spain), Armenian and Malay (Malaysia) empty file templates
+- disable plugins setting
## Changed
- fix edit of locked file
From ae23df1480936c8f14c0c961e792b04b44d1e4fe Mon Sep 17 00:00:00 2001
From: Sergey Linnik
Date: Fri, 20 Jan 2023 15:53:04 +0500
Subject: [PATCH 03/27] Copyright 2023
---
appinfo/app.php | 2 +-
appinfo/application.php | 2 +-
appinfo/routes.php | 2 +-
controller/callbackcontroller.php | 2 +-
controller/editorapicontroller.php | 2 +-
controller/editorcontroller.php | 2 +-
controller/federationcontroller.php | 2 +-
controller/settingsapicontroller.php | 2 +-
controller/settingscontroller.php | 2 +-
controller/templatecontroller.php | 2 +-
controller/webassetcontroller.php | 2 +-
css/editor.css | 2 +-
css/main.css | 2 +-
css/settings.css | 2 +-
css/template.css | 2 +-
js/desktop.js | 2 +-
js/editor.js | 2 +-
js/listener.js | 2 +-
js/main.js | 2 +-
js/settings.js | 2 +-
js/share.js | 2 +-
js/template.js | 2 +-
lib/adminsettings.php | 2 +-
lib/appconfig.php | 2 +-
lib/command/documentserver.php | 2 +-
lib/crypt.php | 2 +-
lib/documentservice.php | 2 +-
lib/fileutility.php | 2 +-
lib/fileversions.php | 2 +-
lib/hookhandler.php | 2 +-
lib/hooks.php | 2 +-
lib/keymanager.php | 2 +-
lib/notifier.php | 2 +-
lib/preview.php | 2 +-
lib/remoteinstance.php | 2 +-
lib/templatemanager.php | 2 +-
lib/version.php | 2 +-
lib/versionmanager.php | 2 +-
settings.php | 2 +-
templates/editor.php | 2 +-
templates/settings.php | 2 +-
41 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/appinfo/app.php b/appinfo/app.php
index c2e1e0ef..bb6cf568 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -1,7 +1,7 @@
Date: Tue, 7 Feb 2023 13:44:37 +0300
Subject: [PATCH 04/27] fix public folder
(ffffa62cf175db2ebec18291a8da2968649be242)
---
js/main.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/main.js b/js/main.js
index 0bbec536..e69bb93b 100644
--- a/js/main.js
+++ b/js/main.js
@@ -109,7 +109,7 @@
winEditor.location.href = url;
} else if (!OCA.Onlyoffice.setting.sameTab || OCA.Onlyoffice.mobile || OCA.Onlyoffice.Desktop) {
winEditor = window.open(url, "_blank");
- } else if ($("#isPublic").val() === "1" && !$("#filestable").length) {
+ } else if ($("#isPublic").val() === "1" && $("#mimetype").val() !== "httpd/unix-directory") {
location.href = url;
} else {
var $iframe = $("");
@@ -522,7 +522,7 @@
}
var initPage = function () {
- if ($("#isPublic").val() === "1" && !$("#filestable").length) {
+ if ($("#isPublic").val() === "1" && $("#mimetype").val() !== "httpd/unix-directory") {
var fileName = $("#filename").val();
var extension = OCA.Onlyoffice.GetFileExtension(fileName);
From ea9de23b7c0f52774e835a6b25c8c86b0b92b786 Mon Sep 17 00:00:00 2001
From: Natalia
Date: Wed, 8 Feb 2023 17:25:46 +0300
Subject: [PATCH 05/27] fixed readme
---
README.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index f4f97418..149e085f 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,6 @@ If the server with the ownCloud installed does not have an Internet access, or i
```
2. Get the ownCloud ONLYOFFICE integration app.
-
There are several ways to do that:
a. Download the latest signed version from the official store for [ownCloud](https://marketplace.owncloud.com/apps/onlyoffice).
@@ -59,14 +58,13 @@ There are several ways to do that:
b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases) on GitHub.
c. Or you can clone the application source code and compile it yourself:
-
```bash
git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice
cd onlyoffice
git submodule update --init --recursive
```
- > ownCloud does not work with unsigned applications giving an alert, so you will need to use either option **a** or **b** to get the application.
+ ownCloud does not work with unsigned applications giving an alert, so you will need to use either option **a** or **b** to get the application.
3. Change the owner to update the application right from ownCloud web interface:
From 516e14c1125f2a90f4f95462ad1f5d9508baa628 Mon Sep 17 00:00:00 2001
From: Maria-Sukhova
Date: Mon, 6 Mar 2023 15:42:30 +0300
Subject: [PATCH 06/27] added da
---
l10n/da.js | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++
l10n/da.json | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 233 insertions(+)
create mode 100644 l10n/da.js
create mode 100644 l10n/da.json
diff --git a/l10n/da.js b/l10n/da.js
new file mode 100644
index 00000000..77aaf9a4
--- /dev/null
+++ b/l10n/da.js
@@ -0,0 +1,117 @@
+OC.L10N.register(
+ "onlyoffice",
+ {
+ "Access denied" : "Adgang nægtet",
+ "Invalid request": "Ugyldig anmodning",
+ "Files not found": "Filer ikke fundet",
+ "File not found": "Fil ikke fundet",
+ "Not permitted": "Ikke tilladt",
+ "Download failed": "Download fejlede",
+ "The required folder was not found": "Den nødvendige mappe blev ikke fundet",
+ "You don't have enough permission to create": "Du har ikke tilladelse nok til at oprette",
+ "Template not found": "Skabelonen blev ikke fundet",
+ "Can't create file": "Filen kan ikke oprettes",
+ "Format is not supported": "Format er ikke understøttet",
+ "Conversion is not required": "Konvertering er ikke påkrævet",
+ "Failed to download converted file": "Kunne ikke downloade den konverterede fil",
+ "ONLYOFFICE app is not configured. Please contact admin": "ONLYOFFICE-appen er ikke konfigureret. Kontakt venligst administrator",
+ "FileId is empty": "Fil-ID er tom",
+ "You do not have enough permissions to view the file": "Du har ikke tilstrækkelige tilladelser til at se filen",
+ "Error occurred in the document service": "Der opstod en fejl i dokumenttjenesten",
+ "Not supported version": "Ikke understøttet version",
+ "ONLYOFFICE cannot be reached. Please contact admin": "ONLYOFFICE kan ikke nås. Kontakt venligst administrator",
+ "Loading, please wait.": "Indlæser... vent venligst.",
+ "File created": "Fil oprettet",
+ "Open in ONLYOFFICE": "Åben i ONLYOFFICE",
+ "Convert with ONLYOFFICE": "Konverter med ONLYOFFICE",
+ "Document": "Dokument",
+ "Spreadsheet": "Regneark",
+ "Presentation": "Præsentation",
+ "Error when trying to connect": "Fejl under forsøg på at oprette forbindelse",
+ "Settings have been successfully updated": "Indstillingerne er blevet opdateret",
+ "Server can't read xml": "Serveren kan ikke læse xml",
+ "Bad Response. Errors: ": "Ingen respons. Fejl:",
+ "Documentation": "Dokumentation",
+ "ONLYOFFICE Docs Location specifies the address of the server with the document services installed. Please change the '' for the server address in the below line.": "ONLYOFFICE Docs Lokation angiver adressen på serveren med dokumenttjenesterne installeret. Skift venligst '' for serveradressen i linjen nedenfor.",
+ "Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.": "Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.",
+ "ONLYOFFICE Docs address": "ONLYOFFICE Docs-adresse",
+ "Advanced server settings": "Avancerede serverindstillinger",
+ "ONLYOFFICE Docs address for internal requests from the server": "ONLYOFFICE Docs-adresse for interne anmodninger fra serveren",
+ "Server address for internal requests from ONLYOFFICE Docs": "Serveradresse for interne anmodninger fra ONLYOFFICE Docs",
+ "Secret key (leave blank to disable)": "Hemmelig nøgle (lad være tom for at deaktivere)",
+ "Open file in the same tab": "Åbn filen i samme fane",
+ "The default application for opening the format": "Standardapplikationen til at åbne formatet",
+ "Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)": "Åbn filen til redigering (på grund af formatbegrænsninger kan data gå tabt, når du gemmer i formaterne fra listen nedenfor)",
+ "View details": "Se detaljer",
+ "Save": "Gem",
+ "Mixed Active Content is not allowed. HTTPS address for ONLYOFFICE Docs is required.": "Blandet aktivt indhold er ikke tilladt. HTTPS-adresse for ONLYOFFICE Docs er påkrævet.",
+ "Restrict access to editors to following groups": "Begræns adgangen til redaktører til følgende grupper",
+ "review": "Anmeldelse",
+ "form filling": "Formular udfyldning",
+ "comment": "Kommentar",
+ "custom filter": "Brugerdefineret filter",
+ "download": "Hent",
+ "Server settings": "Serverindstillinger",
+ "Common settings": "Fælles indstillinger",
+ "Editor customization settings": "Editor tilpasningsindstillinger",
+ "The customization section allows personalizing the editor interface": "Tilpasningssektionen gør det muligt at tilpasse editorgrænsefladen",
+ "Display Chat menu button": "Vis chatmenuknap",
+ "Display the header more compact": "Vis værktøjslinjen mere kompakt",
+ "Display Feedback & Support menu button": "Vis feedback- og supportmenuknap",
+ "Display Help menu button": "Vis menuknappen Hjælp",
+ "Display monochrome toolbar header": "Vis monokrom værktøjslinje",
+ "Save as": "Gem som",
+ "File saved": "Filen er gemt",
+ "Insert image": "Indsæt billede",
+ "Select recipients": "Vælg modtagere",
+ "Connect to demo ONLYOFFICE Docs server": "Opret forbindelse til demo ONLYOFFICE Docs-server",
+ "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.": "Dette er en offentlig testserver, brug den venligst ikke til private følsomme data. Serveren vil være tilgængelig i en 30-dages periode.",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Docs server.": "30-dages testperioden er forbi, du kan ikke længere oprette forbindelse til demo ONLYOFFICE Docs-server.",
+ "You are using public demo ONLYOFFICE Docs server. Please do not store private sensitive data.": "Du bruger den offentlige demo ONLYOFFICE Docs-server. Gem venligst ikke private følsomme data.",
+ "Select file to compare": "Vælg fil for at sammenligne",
+ "Review mode for viewing": "Gennemgangstilstand for visning",
+ "Markup": "Kladde",
+ "Final": "Endelig",
+ "Original": "Original",
+ "version": "version",
+ "Disable certificate verification (insecure)": "Deaktiver certifikatbekræftelse (usikker)",
+ "Keep intermediate versions when editing (forcesave)": "Behold mellemversioner under redigering (tvangsgem)",
+ "Use ONLYOFFICE to generate a document preview (it will take up disk space)": "Brug ONLYOFFICE til at generere et dokumenteksempel (...dette vil optage diskplads)",
+ "Keep metadata for each version once the document is edited (it will take up disk space)": "Gem metadata for hver version, når dokumentet er redigeret (...dette vil optage diskplads)",
+ "Clear": "Klar",
+ "All history successfully deleted": "Al historik blev slettet",
+ "Create": "Opret",
+ "Select template": "Vælg skabelon",
+ "Invalid file provided": "Ugyldig fil angivet",
+ "Empty": "Tom",
+ "Error": "Fejl",
+ "Add a new template": "Tilføj en ny skabelon",
+ "Template already exists": "Skabelonen findes allerede",
+ "Template must be in OOXML format": "Skabelonen skal være i OOXML-format",
+ "Template successfully added": "Skabelon blev tilføjet",
+ "Template successfully deleted": "Skabelonen blev slettet",
+ "Common templates": "Fælles skabeloner",
+ "Failed to delete template": "Skabelonen kunne ikke slettes",
+ "File has been converted. Its content might look different.": "Filen er blevet konverteret. Dens indhold kan se anderledes ud.",
+ "Download as": "Download som",
+ "Download": "Hent",
+ "Origin format": "Oprindelsesformat",
+ "Failed to send notification": "Kunne ikke sende notifikation",
+ "Notification sent successfully": "Meddelelse sendt",
+ "%1\$s mentioned in the %2\$s: \"%3\$s\".": "%1\$s nævnt i %2\$s: \"%3\$s\".",
+ "Choose a format to convert {fileName}": "Vælg et format til at konvertere {fileName}",
+ "Form template": "Formularskabelon",
+ "Form template from existing text file": "Formularskabelon fra eksisterende tekstfil",
+ "Create form": "Opret formular",
+ "Fill in form in ONLYOFFICE": "Udfyld formularen i ONLYOFFICE",
+ "Create new Form template": "Opret ny formularskabelon",
+ "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Opdater venligst ONLYOFFICE Docs til version 7.0 for at arbejde på udfyldelige formularer online",
+ "Security": "Sikkerhed",
+ "Run document macros": "Kør dokumentmakroer",
+ "Default editor theme": "Standard editortema",
+ "Light": "Lys",
+ "Classic Light": "Klassisk lys",
+ "Dark": "Mørk",
+ "This feature is unavailable due to encryption settings.": "Denne funktion er utilgængelig på grund af krypteringsindstillingerne"
+},
+"nplurals=2; plural=(n > 1);");
diff --git a/l10n/da.json b/l10n/da.json
new file mode 100644
index 00000000..a8fcfdb2
--- /dev/null
+++ b/l10n/da.json
@@ -0,0 +1,116 @@
+{ "translations": {
+ "Access denied": "Adgang nægtet",
+ "Invalid request": "Ugyldig anmodning",
+ "Files not found": "Filer ikke fundet",
+ "File not found": "Fil ikke fundet",
+ "Not permitted": "Ikke tilladt",
+ "Download failed": "Download fejlede",
+ "The required folder was not found": "Den nødvendige mappe blev ikke fundet",
+ "You don't have enough permission to create": "Du har ikke tilladelse nok til at oprette",
+ "Template not found": "Skabelonen blev ikke fundet",
+ "Can't create file": "Filen kan ikke oprettes",
+ "Format is not supported": "Format er ikke understøttet",
+ "Conversion is not required": "Konvertering er ikke påkrævet",
+ "Failed to download converted file": "Kunne ikke downloade den konverterede fil",
+ "ONLYOFFICE app is not configured. Please contact admin": "ONLYOFFICE-appen er ikke konfigureret. Kontakt venligst administrator",
+ "FileId is empty": "Fil-ID er tom",
+ "You do not have enough permissions to view the file": "Du har ikke tilstrækkelige tilladelser til at se filen",
+ "Error occurred in the document service": "Der opstod en fejl i dokumenttjenesten",
+ "Not supported version": "Ikke understøttet version",
+ "ONLYOFFICE cannot be reached. Please contact admin": "ONLYOFFICE kan ikke nås. Kontakt venligst administrator",
+ "Loading, please wait.": "Indlæser... vent venligst.",
+ "File created": "Fil oprettet",
+ "Open in ONLYOFFICE": "Åben i ONLYOFFICE",
+ "Convert with ONLYOFFICE": "Konverter med ONLYOFFICE",
+ "Document": "Dokument",
+ "Spreadsheet": "Regneark",
+ "Presentation": "Ppræsentation",
+ "Error when trying to connect": "Fejl under forsøg på at oprette forbindelse",
+ "Settings have been successfully updated": "Indstillingerne er blevet opdateret",
+ "Server can't read xml": "Serveren kan ikke læse xml",
+ "Bad Response. Errors: ": "Ingen respons. Fejl:",
+ "Documentation": "Dokumentation",
+ "ONLYOFFICE Docs Location specifies the address of the server with the document services installed. Please change the '' for the server address in the below line.": "ONLYOFFICE Docs Lokation angiver adressen på serveren med dokumenttjenesterne installeret. Skift venligst '' for serveradressen i linjen nedenfor.",
+ "Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.": "Encryption App is enabled, the application cannot work. You can continue working with the application if you enable master key.",
+ "ONLYOFFICE Docs address": "ONLYOFFICE Docs-adresse",
+ "Advanced server settings": "Avancerede serverindstillinger",
+ "ONLYOFFICE Docs address for internal requests from the server": "ONLYOFFICE Docs-adresse for interne anmodninger fra serveren",
+ "Server address for internal requests from ONLYOFFICE Docs": "Serveradresse for interne anmodninger fra ONLYOFFICE Docs",
+ "Secret key (leave blank to disable)": "Hemmelig nøgle (lad være tom for at deaktivere)",
+ "Open file in the same tab": "Åbn filen i samme fane",
+ "The default application for opening the format": "Standardapplikationen til at åbne formatet",
+ "Open the file for editing (due to format restrictions, the data might be lost when saving to the formats from the list below)": "Åbn filen til redigering (på grund af formatbegrænsninger kan data gå tabt, når du gemmer i formaterne fra listen nedenfor)",
+ "View details": "Se detaljer",
+ "Save": "Gem",
+ "Mixed Active Content is not allowed. HTTPS address for ONLYOFFICE Docs is required.": "Blandet aktivt indhold er ikke tilladt. HTTPS-adresse for ONLYOFFICE Docs er påkrævet.",
+ "Restrict access to editors to following groups": "Begræns adgangen til redaktører til følgende grupper",
+ "review": "Anmeldelse",
+ "form filling": "Formular udfyldning",
+ "comment": "Kommentar",
+ "custom filter": "Brugerdefineret filter",
+ "download": "Hent",
+ "Server settings": "Serverindstillinger",
+ "Common settings": "Fælles indstillinger",
+ "Editor customization settings": "Editor tilpasningsindstillinger",
+ "The customization section allows personalizing the editor interface": "Tilpasningssektionen gør det muligt at tilpasse editorgrænsefladen",
+ "Display Chat menu button": "Vis chatmenuknap",
+ "Display the header more compact": "Vis værktøjslinjen mere kompakt",
+ "Display Feedback & Support menu button": "Vis feedback- og supportmenuknap",
+ "Display Help menu button": "Vis menuknappen Hjælp",
+ "Display monochrome toolbar header": "Vis monokrom værktøjslinje",
+ "Save as": "Gem som",
+ "File saved": "Filen er gemt",
+ "Insert image": "Indsæt billede",
+ "Select recipients": "Vælg modtagere",
+ "Connect to demo ONLYOFFICE Docs server": "Opret forbindelse til demo ONLYOFFICE Docs-server",
+ "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.": "Dette er en offentlig testserver, brug den venligst ikke til private følsomme data. Serveren vil være tilgængelig i en 30-dages periode.",
+ "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Docs server.": "30-dages testperioden er forbi, du kan ikke længere oprette forbindelse til demo ONLYOFFICE Docs-server.",
+ "You are using public demo ONLYOFFICE Docs server. Please do not store private sensitive data.": "Du bruger den offentlige demo ONLYOFFICE Docs-server. Gem venligst ikke private følsomme data.",
+ "Select file to compare": "Vælg fil for at sammenligne",
+ "Review mode for viewing": "Gennemgangstilstand for visning",
+ "Markup": "Kladde",
+ "Final": "Endelig",
+ "Original": "Original",
+ "version": "version",
+ "Disable certificate verification (insecure)": "Deaktiver certifikatbekræftelse (usikker)",
+ "Keep intermediate versions when editing (forcesave)": "Behold mellemversioner under redigering (tvangsgem)",
+ "Use ONLYOFFICE to generate a document preview (it will take up disk space)": "Brug ONLYOFFICE til at generere et dokumenteksempel (...dette vil optage diskplads)",
+ "Keep metadata for each version once the document is edited (it will take up disk space)": "Gem metadata for hver version, når dokumentet er redigeret (...dette vil optage diskplads)",
+ "Clear": "Klar",
+ "All history successfully deleted": "Al historik blev slettet",
+ "Create": "Opret",
+ "Select template": "Vælg skabelon",
+ "Invalid file provided": "Ugyldig fil angivet",
+ "Empty": "Tom",
+ "Error": "Fejl",
+ "Add a new template": "Tilføj en ny skabelon",
+ "Template already exists": "Skabelonen findes allerede",
+ "Template must be in OOXML format": "Skabelonen skal være i OOXML-format",
+ "Template successfully added": "Skabelon blev tilføjet",
+ "Template successfully deleted": "Skabelonen kunne ikke slettes",
+ "Common templates": "Fælles skabeloner",
+ "Failed to delete template": "Skabelonen kunne ikke slettes",
+ "File has been converted. Its content might look different.": "Filen er blevet konverteret. Dens indhold kan se anderledes ud.",
+ "Download as": "Download som",
+ "Download": "Hent",
+ "Origin format": "Oprindelsesformat",
+ "Failed to send notification": "Kunne ikke sende notifikation",
+ "Notification sent successfully": "Meddelelse sendt",
+ "%1$s mentioned in the %2$s: \"%3$s\".": "%1$s nævnt i %2$s: \"%3$s\".",
+ "Choose a format to convert {fileName}": "Vælg et format til at konvertere {fileName}",
+ "Form template": "Formularskabelon",
+ "Form template from existing text file": "Formularskabelon fra eksisterende tekstfil",
+ "Create form": "Opret formular",
+ "Fill in form in ONLYOFFICE": "Udfyld formularen i ONLYOFFICE",
+ "Create new Form template": "Opret ny formularskabelon",
+ "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online": "Opdater venligst ONLYOFFICE Docs til version 7.0 for at arbejde på udfyldelige formularer online",
+ "Security": "Sikkerhed",
+ "Run document macros": "Kør dokumentmakroer",
+ "Default editor theme": "Standard editortema",
+ "Light": "Lys",
+ "Classic Light": "Klassisk lys",
+ "Dark": "Mørk",
+ "This feature is unavailable due to encryption settings.": "Denne funktion er utilgængelig på grund af krypteringsindstillingerne"
+},
+ "pluralForm": "nplurals=2; plural=(n > 1);"
+}
\ No newline at end of file
From 3551fb7bb9751fa265ce9e9e433e1c0619cbf506 Mon Sep 17 00:00:00 2001
From: rivexe
Date: Mon, 6 Mar 2023 17:13:24 +0300
Subject: [PATCH 07/27] leeway setting in configuration file
---
appinfo/application.php | 3 +++
lib/appconfig.php | 18 ++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/appinfo/application.php b/appinfo/application.php
index d55e9a8c..ddf8afe3 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -91,6 +91,9 @@ function () {
require_once __DIR__ . "/../3rdparty/jwt/SignatureInvalidException.php";
require_once __DIR__ . "/../3rdparty/jwt/JWT.php";
+ // Set the leeway for the JWT library in case the system clock is a second off
+ \Firebase\JWT\JWT::$leeway = $this->appConfig->GetJwtLeeway();
+
$container = $this->getContainer();
$detector = $container->query(IMimeTypeDetector::class);
diff --git a/lib/appconfig.php b/lib/appconfig.php
index d947028b..22ee8a29 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -207,6 +207,13 @@ class AppConfig {
*/
private $_jwtHeader = "jwt_header";
+ /**
+ * The config key for the allowable leeway in Jwt checks
+ *
+ * @var string
+ */
+ private $_jwtLeeway = "jwt_leeway";
+
/**
* The config key for the settings error
*
@@ -1031,6 +1038,17 @@ public function JwtHeader() {
return $header;
}
+ /**
+ * Get the Jwt Leeway
+ *
+ * @return int
+ */
+ public function GetJwtLeeway() {
+ $jwtLeeway = (integer)$this->GetSystemValue($this->_jwtLeeway);
+
+ return $jwtLeeway;
+ }
+
/**
* Save the status settings
*
From c6df1b83af6bda4a36c6db342415aea151d806c8 Mon Sep 17 00:00:00 2001
From: rivexe
Date: Tue, 7 Mar 2023 13:01:38 +0300
Subject: [PATCH 08/27] Change remote status to false if request to remote key
was failed, handle 404
---
lib/fileutility.php | 7 +------
lib/remoteinstance.php | 45 +++++++++++++++++++++++++++---------------
2 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/lib/fileutility.php b/lib/fileutility.php
index 60673abe..25bd254b 100644
--- a/lib/fileutility.php
+++ b/lib/fileutility.php
@@ -223,17 +223,12 @@ public function getKey($file, $origin = false) {
if ($origin
&& RemoteInstance::isRemoteFile($file)) {
- try {
$key = RemoteInstance::getRemoteKey($file);
-
if (!empty($key)) {
return $key;
}
- } catch (\Exception $e) {
- $this->logger->logException($e, ["message" => "Failed to request federated key " . $file->getId(), "app" => $this->appName]);
- }
}
-
+
$key = KeyManager::get($fileId);
if (empty($key) ) {
diff --git a/lib/remoteinstance.php b/lib/remoteinstance.php
index 012a6093..3de3b814 100644
--- a/lib/remoteinstance.php
+++ b/lib/remoteinstance.php
@@ -175,25 +175,38 @@ public function getRemoteKey($file) {
$httpClientService = \OC::$server->getHTTPClientService();
$client = $httpClientService->newClient();
- $response = $client->post($remote . "/ocs/v2.php/apps/" . self::App_Name . "/api/v1/key?format=json", [
- "timeout" => 5,
- "json" => [
- "shareToken" => $shareToken,
- "path" => $internalPath
- ]
- ]);
- $body = \json_decode($response->getBody(), true);
- $data = $body["ocs"]["data"];
- if (!empty($data["error"])) {
- $logger->error("Error federated key " . $data["error"], ["app" => self::App_Name]);
- return null;
- }
+ try {
+ $response = $client->post($remote . "/ocs/v2.php/apps/" . self::App_Name . "/api/v1/key?format=json", [
+ "timeout" => 5,
+ "json" => [
+ "shareToken" => $shareToken,
+ "path" => $internalPath
+ ]
+ ]);
+
+ $body = \json_decode($response->getBody(), true);
+
+ $data = $body["ocs"]["data"];
+ if (!empty($data["error"])) {
+ $logger->error("Error federated key " . $data["error"], ["app" => self::App_Name]);
+ return null;
+ }
- $key = $data["key"];
- $logger->debug("Federated key: $key", ["app" => self::App_Name]);
+ $key = $data["key"];
+ $logger->debug("Federated key: $key", ["app" => self::App_Name]);
+
+ return $key;
+ } catch (\Exception $e) {
+ $logger->logException($e, ["message" => "Failed to request federated key " . $file->getId(), "app" => self::App_Name]);
- return $key;
+ if ($e->getResponse()->getStatusCode() === 404) {
+ self::update($remote, false);
+ $logger->debug("Changed status for remote instance $remote to false", ["app" => self::App_Name]);
+ }
+
+ return null;
+ }
}
/**
From d15f5c462de6948571a8f1501f1ba4f88bcb2240 Mon Sep 17 00:00:00 2001
From: Sergey Linnik
Date: Wed, 8 Mar 2023 13:29:05 +0500
Subject: [PATCH 09/27] fix da
---
l10n/da.js | 2 +-
l10n/da.json | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/l10n/da.js b/l10n/da.js
index 77aaf9a4..586a0082 100644
--- a/l10n/da.js
+++ b/l10n/da.js
@@ -1,7 +1,7 @@
OC.L10N.register(
"onlyoffice",
{
- "Access denied" : "Adgang nægtet",
+ "Access denied": "Adgang nægtet",
"Invalid request": "Ugyldig anmodning",
"Files not found": "Filer ikke fundet",
"File not found": "Fil ikke fundet",
diff --git a/l10n/da.json b/l10n/da.json
index a8fcfdb2..6223424c 100644
--- a/l10n/da.json
+++ b/l10n/da.json
@@ -24,7 +24,7 @@
"Convert with ONLYOFFICE": "Konverter med ONLYOFFICE",
"Document": "Dokument",
"Spreadsheet": "Regneark",
- "Presentation": "Ppræsentation",
+ "Presentation": "Præsentation",
"Error when trying to connect": "Fejl under forsøg på at oprette forbindelse",
"Settings have been successfully updated": "Indstillingerne er blevet opdateret",
"Server can't read xml": "Serveren kan ikke læse xml",
@@ -87,7 +87,7 @@
"Template already exists": "Skabelonen findes allerede",
"Template must be in OOXML format": "Skabelonen skal være i OOXML-format",
"Template successfully added": "Skabelon blev tilføjet",
- "Template successfully deleted": "Skabelonen kunne ikke slettes",
+ "Template successfully deleted": "Skabelonen blev slettet",
"Common templates": "Fælles skabeloner",
"Failed to delete template": "Skabelonen kunne ikke slettes",
"File has been converted. Its content might look different.": "Filen er blevet konverteret. Dens indhold kan se anderledes ud.",
From 8aa4038bd60d34c26111f3ce8a5a67e3fc878b02 Mon Sep 17 00:00:00 2001
From: Sergey Linnik
Date: Wed, 8 Mar 2023 13:41:02 +0500
Subject: [PATCH 10/27] leeway to changelog
---
CHANGELOG.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3886522b..2483a2e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Change Log
+## Added
+- jwt leeway setting
+
## 7.6.7
## Added
- Dutch translation
From 80fca31bb7321f55d96b7f7ab5b63b071ea4d457 Mon Sep 17 00:00:00 2001
From: Sergey Linnik
Date: Wed, 8 Mar 2023 13:47:19 +0500
Subject: [PATCH 11/27] format
---
lib/fileutility.php | 10 +++++-----
lib/remoteinstance.php | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/fileutility.php b/lib/fileutility.php
index 25bd254b..29b61406 100644
--- a/lib/fileutility.php
+++ b/lib/fileutility.php
@@ -223,12 +223,12 @@ public function getKey($file, $origin = false) {
if ($origin
&& RemoteInstance::isRemoteFile($file)) {
- $key = RemoteInstance::getRemoteKey($file);
- if (!empty($key)) {
- return $key;
- }
+ $key = RemoteInstance::getRemoteKey($file);
+ if (!empty($key)) {
+ return $key;
+ }
}
-
+
$key = KeyManager::get($fileId);
if (empty($key) ) {
diff --git a/lib/remoteinstance.php b/lib/remoteinstance.php
index 3de3b814..9ac739cd 100644
--- a/lib/remoteinstance.php
+++ b/lib/remoteinstance.php
@@ -184,7 +184,7 @@ public function getRemoteKey($file) {
"path" => $internalPath
]
]);
-
+
$body = \json_decode($response->getBody(), true);
$data = $body["ocs"]["data"];
From 7294f6636fdb6f25225d590a625458f1e41a2528 Mon Sep 17 00:00:00 2001
From: Sergey Linnik
Date: Wed, 8 Mar 2023 14:10:42 +0500
Subject: [PATCH 12/27] fix changelog
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2483a2e9..97c7226c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,13 @@
# Change Log
## Added
+- disable plugins setting
- jwt leeway setting
## 7.6.7
## Added
- Dutch translation
- Chinese (Traditional, Taiwan), Basque (Spain), Armenian and Malay (Malaysia) empty file templates
-- disable plugins setting
## Changed
- fix edit locked file
From acbaca9549bc56781c48918ca17eeb6f7e0a6bc5 Mon Sep 17 00:00:00 2001
From: rivexe
Date: Thu, 9 Mar 2023 10:46:43 +0300
Subject: [PATCH 13/27] fix notification length
---
controller/editorcontroller.php | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php
index 07a394de..f6b8a284 100644
--- a/controller/editorcontroller.php
+++ b/controller/editorcontroller.php
@@ -457,6 +457,19 @@ public function mention($fileId, $anchor, $comment, $emails) {
return ["error" => $this->trans->t("Failed to send notification")];
}
+ foreach ($emails as $email) {
+ $substrToDelete = "+" . $email . " ";
+ $comment = str_replace($substrToDelete, "", $comment);
+ }
+
+ //Length from ownCloud:
+ //https://github.com/owncloud/core/blob/master/lib/private/Notification/Notification.php#L181
+ $maxLen = 64;
+ if (strlen($comment) > $maxLen) {
+ $ending = "...";
+ $comment = substr($comment, 0, ($maxLen - strlen($ending))) . $ending;
+ }
+
$notificationManager = \OC::$server->getNotificationManager();
$notification = $notificationManager->createNotification();
$notification->setApp($this->appName)
From 2f814aa8ec7dc35cb05aa9f574f3470e2118b821 Mon Sep 17 00:00:00 2001
From: rivexe
Date: Thu, 9 Mar 2023 11:22:43 +0300
Subject: [PATCH 14/27] notification length to changelog
---
CHANGELOG.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97c7226c..29a09e79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@
- disable plugins setting
- jwt leeway setting
+## Changed
+- fix notification length
+
## 7.6.7
## Added
- Dutch translation
From 08f2ce789d36659974d42d1eb01b47900fdaf779 Mon Sep 17 00:00:00 2001
From: rivexe
Date: Thu, 9 Mar 2023 13:06:28 +0300
Subject: [PATCH 15/27] added protection to settings in security section
---
controller/editorapicontroller.php | 6 ++++++
controller/settingscontroller.php | 8 +++++++-
js/settings.js | 4 +++-
l10n/ru.js | 5 ++++-
l10n/ru.json | 5 ++++-
lib/appconfig.php | 31 ++++++++++++++++++++++++++++++
templates/settings.php | 20 +++++++++++++++++++
7 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/controller/editorapicontroller.php b/controller/editorapicontroller.php
index 0cc12265..0f35dd20 100644
--- a/controller/editorapicontroller.php
+++ b/controller/editorapicontroller.php
@@ -386,6 +386,12 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
$ownerId = $owner->getUID();
}
+ $canProtect = true;
+ if ($this->config->GetProtection() === "owner") {
+ $canProtect = $ownerId === $userId;
+ }
+ $params["document"]["permissions"]["protect"] = $canProtect;
+
$hashCallback = $this->crypt->GetHash(["userId" => $userId, "ownerId" => $ownerId, "fileId" => $file->getId(), "filePath" => $filePath, "shareToken" => $shareToken, "action" => "track"]);
$callback = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.track", ["doc" => $hashCallback]);
diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php
index 9e9343ee..81e5e612 100644
--- a/controller/settingscontroller.php
+++ b/controller/settingscontroller.php
@@ -116,6 +116,7 @@ public function index() {
"sameTab" => $this->config->GetSameTab(),
"preview" => $this->config->GetPreview(),
"versionHistory" => $this->config->GetVersionHistory(),
+ "protection" => $this->config->GetProtection(),
"encryption" => $this->config->checkEncryptionModule(),
"limitGroups" => $this->config->GetLimitGroups(),
"chat" => $this->config->GetCustomizationChat(),
@@ -252,12 +253,17 @@ public function SaveCommon($defFormats,
* Save security settings
*
* @param bool $macros - run document macros
+ *
+ * @param string $protection - protection
*
* @return array
*/
- public function SaveSecurity($macros) {
+ public function SaveSecurity($macros,
+ $protection
+ ) {
$this->config->SetCustomizationMacros($macros);
+ $this->config->SetProtection($protection);
return [
];
diff --git a/js/settings.js b/js/settings.js
index acba34c9..9f672757 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -175,12 +175,14 @@
$(".section-onlyoffice").addClass("icon-loading");
var macros = $("#onlyofficeMacros").is(":checked");
+ var protection = $("input[type='radio'][name='protection']:checked").attr("id").replace("onlyofficeProtection_", "");
$.ajax({
method: "PUT",
url: OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/settings/security"),
data: {
- macros: macros
+ macros: macros,
+ protection: protection
},
success: function onSuccess(response) {
$(".section-onlyoffice").removeClass("icon-loading");
diff --git a/l10n/ru.js b/l10n/ru.js
index d89a5f96..4f698bd0 100644
--- a/l10n/ru.js
+++ b/l10n/ru.js
@@ -113,6 +113,9 @@ OC.L10N.register(
"Classic Light": "Светлая классическая",
"Dark": "Темная",
"This feature is unavailable due to encryption settings.": "Данная функция недоступна из-за настроек шифрования",
- "Enable plugins": "Включить работу с плагинами"
+ "Enable plugins": "Включить работу с плагинами",
+ "Enable document protection for": "Включить возможность задавать пароль на документ для",
+ "All users": "Всех пользователей",
+ "Owner only": "Только владельцу"
},
"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 bc2c6897..13cc0fd2 100644
--- a/l10n/ru.json
+++ b/l10n/ru.json
@@ -111,6 +111,9 @@
"Classic Light": "Светлая классическая",
"Dark": "Темная",
"This feature is unavailable due to encryption settings.": "Данная функция недоступна из-за настроек шифрования",
- "Enable plugins": "Включить работу с плагинами"
+ "Enable plugins": "Включить работу с плагинами",
+ "Enable document protection for": "Включить возможность задавать пароль на документ для",
+ "All users": "Всех пользователей",
+ "Owner only": "Только владельцу"
},"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 22ee8a29..99d44ed9 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -123,6 +123,13 @@ class AppConfig {
*/
private $_versionHistory = "versionHistory";
+ /**
+ * The config key for the protection
+ *
+ * @var string
+ */
+ private $_protection = "protection";
+
/**
* The config key for the chat display setting
*
@@ -687,6 +694,30 @@ public function GetVersionHistory() {
return $this->config->getAppValue($this->appName, $this->_versionHistory, "true") === "true";
}
+ /**
+ * Save protection
+ *
+ * @param bool $value - version history
+ */
+ public function SetProtection($value) {
+ $this->logger->info("Set protection: " . $value, ["app" => $this->appName]);
+
+ $this->config->setAppValue($this->appName, $this->_protection, $value);
+ }
+
+ /**
+ * Get protection
+ *
+ * @return bool
+ */
+ public function GetProtection() {
+ $value = $this->config->getAppValue($this->appName, $this->_protection, "owner");
+ if ($value === "all") {
+ return "all";
+ }
+ return "owner";
+ }
+
/**
* Save chat display setting
*
diff --git a/templates/settings.php b/templates/settings.php
index 5463ffbf..192307ae 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -293,6 +293,26 @@
+