Plugin: OnlyOffice: Bump plugin version to upstream's 1.3

pull/5396/head
Yannick Warnier 1 year ago
parent ece7789649
commit 2a47d07420
  1. 13
      plugin/onlyoffice/CHANGELOG.md
  2. 5
      plugin/onlyoffice/README.md
  3. 2
      plugin/onlyoffice/ajax/saveas.php
  4. BIN
      plugin/onlyoffice/assets/az-Latn-AZ/pptx.zip
  5. BIN
      plugin/onlyoffice/assets/az-Latn-AZ/xlsx.zip
  6. BIN
      plugin/onlyoffice/assets/bg-BG/pptx.zip
  7. BIN
      plugin/onlyoffice/assets/bg-BG/xlsx.zip
  8. BIN
      plugin/onlyoffice/assets/de-DE/pptx.zip
  9. BIN
      plugin/onlyoffice/assets/de-DE/xlsx.zip
  10. BIN
      plugin/onlyoffice/assets/el-GR/pptx.zip
  11. BIN
      plugin/onlyoffice/assets/el-GR/xlsx.zip
  12. BIN
      plugin/onlyoffice/assets/en-GB/pptx.zip
  13. BIN
      plugin/onlyoffice/assets/en-GB/xlsx.zip
  14. BIN
      plugin/onlyoffice/assets/en-US/pptx.zip
  15. BIN
      plugin/onlyoffice/assets/en-US/xlsx.zip
  16. BIN
      plugin/onlyoffice/assets/es-ES/docxf.zip
  17. BIN
      plugin/onlyoffice/assets/es-ES/pptx.zip
  18. BIN
      plugin/onlyoffice/assets/es-ES/xlsx.zip
  19. BIN
      plugin/onlyoffice/assets/fr-FR/pptx.zip
  20. BIN
      plugin/onlyoffice/assets/fr-FR/xlsx.zip
  21. BIN
      plugin/onlyoffice/assets/it-IT/pptx.zip
  22. BIN
      plugin/onlyoffice/assets/it-IT/xlsx.zip
  23. BIN
      plugin/onlyoffice/assets/ja-JP/docx.zip
  24. BIN
      plugin/onlyoffice/assets/ja-JP/docxf.zip
  25. BIN
      plugin/onlyoffice/assets/ja-JP/pptx.zip
  26. BIN
      plugin/onlyoffice/assets/ja-JP/xlsx.zip
  27. BIN
      plugin/onlyoffice/assets/ko-KR/xlsx.zip
  28. BIN
      plugin/onlyoffice/assets/lv-LV/pptx.zip
  29. BIN
      plugin/onlyoffice/assets/lv-LV/xlsx.zip
  30. BIN
      plugin/onlyoffice/assets/nl-NL/pptx.zip
  31. BIN
      plugin/onlyoffice/assets/nl-NL/xlsx.zip
  32. BIN
      plugin/onlyoffice/assets/pl-PL/pptx.zip
  33. BIN
      plugin/onlyoffice/assets/pl-PL/xlsx.zip
  34. BIN
      plugin/onlyoffice/assets/pt-BR/docx.zip
  35. BIN
      plugin/onlyoffice/assets/pt-BR/docxf.zip
  36. BIN
      plugin/onlyoffice/assets/pt-BR/pptx.zip
  37. BIN
      plugin/onlyoffice/assets/pt-BR/xlsx.zip
  38. BIN
      plugin/onlyoffice/assets/pt-PT/docx.zip
  39. BIN
      plugin/onlyoffice/assets/pt-PT/docxf.zip
  40. BIN
      plugin/onlyoffice/assets/pt-PT/pptx.zip
  41. BIN
      plugin/onlyoffice/assets/pt-PT/xlsx.zip
  42. BIN
      plugin/onlyoffice/assets/ru-RU/pptx.zip
  43. BIN
      plugin/onlyoffice/assets/ru-RU/xlsx.zip
  44. BIN
      plugin/onlyoffice/assets/sk-SK/docx.zip
  45. BIN
      plugin/onlyoffice/assets/sk-SK/docxf.zip
  46. BIN
      plugin/onlyoffice/assets/sk-SK/pptx.zip
  47. BIN
      plugin/onlyoffice/assets/sk-SK/xlsx.zip
  48. BIN
      plugin/onlyoffice/assets/sv-SE/docx.zip
  49. BIN
      plugin/onlyoffice/assets/sv-SE/docxf.zip
  50. BIN
      plugin/onlyoffice/assets/sv-SE/pptx.zip
  51. BIN
      plugin/onlyoffice/assets/sv-SE/xlsx.zip
  52. BIN
      plugin/onlyoffice/assets/tr-TR/docxf.zip
  53. BIN
      plugin/onlyoffice/assets/tr-TR/pptx.zip
  54. BIN
      plugin/onlyoffice/assets/tr-TR/xlsx.zip
  55. BIN
      plugin/onlyoffice/assets/uk-UA/pptx.zip
  56. BIN
      plugin/onlyoffice/assets/uk-UA/xlsx.zip
  57. BIN
      plugin/onlyoffice/assets/vi-VN/pptx.zip
  58. BIN
      plugin/onlyoffice/assets/vi-VN/xlsx.zip
  59. BIN
      plugin/onlyoffice/assets/zh-CN/pptx.zip
  60. BIN
      plugin/onlyoffice/assets/zh-CN/xlsx.zip
  61. 20
      plugin/onlyoffice/callback.php
  62. 2
      plugin/onlyoffice/create.php
  63. 43
      plugin/onlyoffice/editor.php
  64. 2
      plugin/onlyoffice/install.php
  65. 20
      plugin/onlyoffice/lang/bulgarian.php
  66. 23
      plugin/onlyoffice/lang/dutch.php
  67. 20
      plugin/onlyoffice/lang/english.php
  68. 24
      plugin/onlyoffice/lang/french.php
  69. 20
      plugin/onlyoffice/lang/german.php
  70. 24
      plugin/onlyoffice/lang/greek.php
  71. 20
      plugin/onlyoffice/lang/italian.php
  72. 23
      plugin/onlyoffice/lang/polish.php
  73. 20
      plugin/onlyoffice/lang/portuguese.php
  74. 28
      plugin/onlyoffice/lang/russian.php
  75. 20
      plugin/onlyoffice/lang/spanish.php
  76. 76
      plugin/onlyoffice/lib/appConfig.php
  77. 9
      plugin/onlyoffice/lib/crypt.php
  78. 8
      plugin/onlyoffice/lib/fileUtility.php
  79. 2
      plugin/onlyoffice/lib/langManager.php
  80. 2
      plugin/onlyoffice/lib/onlyofficeActionObserver.php
  81. 2
      plugin/onlyoffice/lib/onlyofficeItemActionObserver.php
  82. 2
      plugin/onlyoffice/lib/onlyofficeItemViewObserver.php
  83. 223
      plugin/onlyoffice/lib/onlyofficePlugin.php
  84. 2
      plugin/onlyoffice/lib/onlyofficeTools.php
  85. 9
      plugin/onlyoffice/lib/templateManager.php
  86. 10
      plugin/onlyoffice/plugin.php
  87. 2
      plugin/onlyoffice/uninstall.php

@ -2,6 +2,19 @@
This plugin is developed and maintained at https://github.com/ONLYOFFICE/onlyoffice-chamilo.
## 1.3.0
## Added
- Chinese (Taiwan), Basque (Spain), Malay (Malaysia), and Galician empty file templates
- jwt header setting
- connection to the demo server
- setting address for internal requests from the server
- Link to docs cloud
- connection settings validation
## Changed
- document server v6.0 and earlier is no longer supported
- used firebase-jwt library from vendor
## 1.2.0
## Added
- support docxf and oform formats

@ -51,6 +51,7 @@ To use ONLYOFFICE behind a proxy, please refer to [this article](https://helpcen
cp -r ./ /tmp/onlyoffice-deploy/onlyoffice
cd /tmp/onlyoffice-deploy/onlyoffice
rm -rf ./.git*
rm -rf */.git*
```
4. Archive
@ -83,6 +84,10 @@ Return to the plugin list, select the ONLYOFFICE plugin, and click Enable the se
On the Plugins page, find ONLYOFFICE and click _Configure_. You'll see the _Settings_ page. Enable the plugin and specify the _Document Server address_.
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** on the Chamilo **Settings** page.
In the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/editors/signature/), specify the same secret key and enable the validation.
## How it works
* To create a new file, the teacher opens the necessary folder and clicks the ONLYOFFICE icon "Create new".

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,6 +20,8 @@
require_once __DIR__.'/../../main/inc/global.inc.php';
use ChamiloSession as Session;
use \Firebase\JWT\JWT;
use \Firebase\JWT\Key;
/**
* Status of the document
@ -117,20 +119,20 @@ function track(): array
return $result;
}
if (!empty($plugin->get("jwt_secret"))) {
if (!empty($plugin->getDocumentServerSecret())) {
if (!empty($data["token"])) {
try {
$payload = \Firebase\JWT\JWT::decode($data["token"], $plugin->get("jwt_secret"), array("HS256"));
$payload = JWT::decode($data["token"], new Key($plugin->getDocumentServerSecret(), "HS256"));
} catch (\UnexpectedValueException $e) {
$result["status"] = "error";
$result["error"] = "403 Access denied";
return $result;
}
} else {
$token = substr(getallheaders()[AppConfig::JwtHeader()], strlen("Bearer "));
$token = substr(getallheaders()[$plugin->getJwtHeader()], strlen("Bearer "));
try {
$decodeToken = \Firebase\JWT\JWT::decode($token, $plugin->get("jwt_secret"), array("HS256"));
$decodeToken = JWT::decode($token, new Key($plugin->getDocumentServerSecret(), "HS256"));
$payload = $decodeToken->payload;
} catch (\UnexpectedValueException $e) {
$result["status"] = "error";
@ -151,6 +153,7 @@ function track(): array
case TrackerStatus_Corrupted:
$downloadUri = $data["url"];
$downloadUri = $plugin->replaceDocumentServerUrlToInternal($downloadUri);
if (!empty($docId) && !empty($courseCode)) {
$docInfo = DocumentManager::get_document_data_by_id($docId, $courseCode, false, $sessionId);
@ -225,10 +228,10 @@ function download()
global $sessionId;
global $courseInfo;
if (!empty($plugin->get("jwt_secret"))) {
$token = substr(getallheaders()[AppConfig::JwtHeader()], strlen("Bearer "));
if (!empty($plugin->getDocumentServerSecret())) {
$token = substr(getallheaders()[$plugin->getJwtHeader()], strlen("Bearer "));
try {
$payload = \Firebase\JWT\JWT::decode($token, $plugin->get("jwt_secret"), array("HS256"));
$payload = JWT::decode($token, new Key($plugin->getDocumentServerSecret(), "HS256"));
} catch (\UnexpectedValueException $e) {
$result["status"] = "error";
@ -255,6 +258,7 @@ function download()
@header("Content-Disposition: attachment; filename=" . $docInfo["title"]);
readfile($filePath);
exit();
}
/**

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,6 +19,8 @@
require_once __DIR__.'/../../main/inc/global.inc.php';
use \Firebase\JWT\JWT;
const USER_AGENT_MOBILE = "/android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i";
$plugin = OnlyofficePlugin::create();
@ -29,7 +31,7 @@ if (!$isEnable) {
return;
}
$documentServerUrl = $plugin->get("document_server_url");
$documentServerUrl = $plugin->getDocumentServerUrl();
if (empty($documentServerUrl)) {
die ("Document server isn't configured");
return;
@ -49,6 +51,9 @@ $userInfo = api_get_user_info($userId);
$sessionId = api_get_session_id();
$courseId = api_get_course_int_id();
$courseInfo = api_get_course_info();
if (empty($courseInfo)) {
api_not_allowed(true);
}
$courseCode = $courseInfo["code"];
$docInfo = DocumentManager::get_document_data_by_id($docId, $courseCode, false, $sessionId);
@ -61,6 +66,10 @@ $docType = FileUtility::getDocType($extension);
$key = FileUtility::getKey($courseCode, $docId);
$fileUrl = FileUtility::getFileUrl($courseId, $userId, $docId, $sessionId, $groupId);
if (!empty($plugin->getStorageUrl())) {
$fileUrl = str_replace(api_get_path(WEB_PATH), $plugin->getStorageUrl(), $fileUrl);
}
$config = [
"type" => "desktop",
"documentType" => $docType,
@ -144,13 +153,19 @@ if (!$isVisible) {
if ($canEdit && $accessRights && !$isReadonly) {
$config["editorConfig"]["mode"] = "edit";
$config["editorConfig"]["callbackUrl"] = getCallbackUrl(
$callback = getCallbackUrl(
$docId,
$userId,
$courseId,
$sessionId,
$groupId
);
if (!empty($plugin->getStorageUrl())) {
$callback = str_replace(api_get_path(WEB_PATH), $plugin->getStorageUrl(), $callback);
}
$config["editorConfig"]["callbackUrl"] = $callback;
} else {
$canView = in_array($extension, FileUtility::$can_view_types);
if ($canView) {
@ -161,8 +176,8 @@ if ($canEdit && $accessRights && !$isReadonly) {
}
$config["document"]["permissions"]["edit"] = $accessRights && !$isReadonly;
if (!empty($plugin->get("jwt_secret"))) {
$token = \Firebase\JWT\JWT::encode($config, $plugin->get("jwt_secret"));
if (!empty($plugin->getDocumentServerSecret())) {
$token = JWT::encode($config, $plugin->getDocumentServerSecret(), "HS256");
$config["token"] = $token;
}
@ -242,17 +257,17 @@ function getCallbackUrl(int $docId, int $userId, int $courseId, int $sessionId,
var connectEditor = function () {
var config = <?php echo json_encode($config)?>;
var errorPage = <?php echo json_encode(api_get_path(WEB_PLUGIN_PATH) . "onlyoffice/error.php")?>;
var docsVersion = DocsAPI.DocEditor.version().split(".");
if ((config.document.fileType === "docxf" || config.document.fileType === "oform")
&& DocsAPI.DocEditor.version().split(".")[0] < 7) {
<?php
echo Display::addFlash(
Display::return_message(
$plugin->get_lang("UpdateOnlyoffice"),
"error"
)
);
?>;
&& docsVersion[0] < 7) {
window.location.href = errorPage + "?status=" + 1;
return;
}
if (docsVersion[0] < 6
|| docsVersion[0] == 6 && docsVersion[1] == 0) {
window.location.href = errorPage + "?status=" + 2;
return;
}

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Създай нов документ";
$strings["formTemplate"] = "Шаблон на формуляр";
$strings["fillInFormInOnlyoffice"] = "Попълнете формуляр в ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Молим да актуализирате ONLYOFFICE Docs към версия 7.0, за да работи с онлайн формуляри за попълване";
$strings["NotSupportedVersion"] = "Неподдържана версия";
$strings["jwt_header"] = "Заглавка за упълномощаване (оставете празно, за да използвате заглавката по подразбиране)";
$strings["connect_demo"] = "Свързване с демо ONLYOFFICE Docs сървър";
$strings["demoPeriodIsOver"] = "30-дневният тестов период приключи, вече не можете да се свържете с демо ONLYOFFICE Docs сървър.";
$strings["demoPrevMessage"] = "Това е обществен тестов сървър, моля, не използвайте за чувствителни частни данни. Сървърът ще е на разположение по време на 30-дневния период.";
$strings["demoUsingMessage"] = "Използвате обществения демо ONLYOFFICE Docs сървър. Моля, не съхранявайте чувствителни частни данни на него.";
$strings["document_server_internal"] = "Адрес на ONLYOFFICE Docs за вътрешни заявки към сървъра";
$strings["NotSupportedVersion"] = "Неподдържана версия";
$strings["storage_url"] = "Адрес на сървъра за вътрешни заявки на ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Стартирайте лесно редакторите в облака без изтегляне и инсталиране";
$strings["DocsCloudBannerButton"] = "Вземи го сега";
$strings["connectionError"] = "Грешка при опит за свързване";
$strings["docServiceError"] = "Възникна грешка в услугата за документи";
$strings["pluginIsNotConfigured"] = "Приложението ONLYOFFICE не конфигурирано. Моля, свържете се с администратора";
$strings["cantReadXml"] = "Невъзможно прочитане на xml файла на сървъра";
$strings["badResponseErrors"] = "Неправилен отговор. Грешки: ";
$strings["mixedContent"] = "Смесеното активно съдържание е недопустимо. За ONLYOFFICE Docs е необходимо използването на HTTPS-адрес.";
$strings["badHealthcheckStatus"] = "Лош статус на проверка за изправност";
$strings["notSupportedVersion"] = "Неподдържана версия";

@ -19,3 +19,26 @@ $strings["create"] = "Maak";
$strings["fileIsExist"] = "Bestand bestaat al";
$strings["impossibleCreateFile"] = "Onmogelijk om bestand te maken";
$strings["createNewDocument"] = "Nieuw document maken";
$strings["formTemplate"] = "Formulier sjabloon";
$strings["fillInFormInOnlyoffice"] = "Formulier invullen in ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Update ONLYOFFICE Docs naar versie 7.0 om online invulbare formulieren te kunnen gebruiken";
$strings["NotSupportedVersion"] = "Niet ondersteunde versie";
$strings["jwt_header"] = "Autorisatiekop (leeg laten om de standaardkop te gebruiken)";
$strings["connect_demo"] = "Verbinden met de demo ONLYOFFICE Docs server";
$strings["demoPeriodIsOver"] = "De 30-dagen proefperiode is voorbij, u kunt niet langer verbinding maken met demo ONLYOFFICE Docs server.";
$strings["demoPrevMessage"] = "Dit is een openbare testserver, gelieve deze niet te gebruiken voor persoonlijke en vertrouwelijke gegevens. De server zal gedurende een periode van 30 dagen beschikbaar zijn.";
$strings["demoUsingMessage"] = "U gebruikt de openbare demo ONLYOFFICE Docs server. Sla geen vertrouwelijke gegevens op.";
$strings["document_server_internal"] = "Adres van de ONLYOFFICE Docs voor interne verzoeken van de server";
$strings["NotSupportedVersion"] = "Niet ondersteunde versie";
$strings["storage_url"] = "Serveradres voor interne verzoeken van de ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Start de editors eenvoudig in de cloud zonder downloaden en installeren";
$strings["DocsCloudBannerButton"] = "Nu verkrijgen";
$strings["connectionError"] = "Fout bij het verbinden";
$strings["docServiceError"] = "Er is een fout opgetreden in de documentservice";
$strings["pluginIsNotConfigured"] = "ONLYOFFICE app is niet geconfigureerd. Neem contact op met de admin";
$strings["cantReadXml"] = "Server kan xml niet lezen";
$strings["badResponseErrors"] = "Slechte Reactie. Fouten: ";
$strings["mixedContent"] = "Gemende Actieve Inhoud is niet toegestaan. HTTPS-adres voor ONLYOFFICE Docs is vereist.";
$strings["badHealthcheckStatus"] = "Ongeldige status van de statuscontrole";
$strings["notSupportedVersion"] = "Niet ondersteunde versie";

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Create new document";
$strings["formTemplate"] = "Form template";
$strings["fillInFormInOnlyoffice"] = "Fill in form in ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online";
$strings["NotSupportedVersion"] = "Not supported version";
$strings["jwt_header"] = "Authorization header (leave blank to use default header)";
$strings["connect_demo"] = "Connect to demo ONLYOFFICE Docs server";
$strings["demoPeriodIsOver"] = "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Docs server.";
$strings["demoPrevMessage"] = "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.";
$strings["demoUsingMessage"] = "You are using public demo ONLYOFFICE Docs server. Please do not store private sensitive data.";
$strings["document_server_internal"] = "ONLYOFFICE Docs address for internal requests from the server";
$strings["NotSupportedVersion"] = "Not supported version";
$strings["storage_url"] = "Server address for internal requests from ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Easily launch the editors in the cloud without downloading and installation";
$strings["DocsCloudBannerButton"] = "Get Now";
$strings["connectionError"] = "Error when trying to connect";
$strings["docServiceError"] = "Error occurred in the document service";
$strings["pluginIsNotConfigured"] = "ONLYOFFICE app is not configured. Please contact admin";
$strings["cantReadXml"] = "Server can't read xml";
$strings["badResponseErrors"] = "Bad Response. Errors: ";
$strings["mixedContent"] = "Mixed Active Content is not allowed. HTTPS address for ONLYOFFICE Docs is required.";
$strings["badHealthcheckStatus"] = "Bad healthcheck status";
$strings["notSupportedVersion"] = "Not supported version";

@ -4,7 +4,7 @@
*
*/
$strings["plugin_title"] = "ONLYOFFICE";
$strings['plugin_comment'] = "Connecteur ONLYOFFICE vous permet dafficher, éditer et coéditer les documents texte, les feuilles de calcul et les présentations au sein de Chamilo en utilisant ONLYOFFICE Docs.";
$strings['plugin_comment'] = "Connecteur ONLYOFFICE vous permet d'afficher, éditer et coéditer les documents texte, les feuilles de calcul et les présentations au sein de Chamilo en utilisant ONLYOFFICE Docs.";
$strings["enable_onlyoffice_plugin"] = "Activer";
$strings["document_server_url"] = "L'URL du serveur ONLYOFFICE Docs";
$strings["jwt_secret"] = "Clé secrète (laisser vide pour désactiver)";
@ -13,7 +13,7 @@ $strings["createNew"] = "Créer nouveau";
$strings["title"] = "Titre";
$strings["chooseFileFormat"] = "Sélectionner le format du fichier";
$strings["document"] = "Document";
$strings["spreadsheet"] = "Classeur";
$strings["spreadsheet"] = "Feuille de calcul";
$strings["presentation"] = "Présentation";
$strings["create"] = "Créer";
$strings["fileIsExist"] = "Le fichier existe déjà";
@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Créer un nouveau document";
$strings["formTemplate"] = "Modèle de formulaire";
$strings["fillInFormInOnlyoffice"] = "Remplir le formulaire dans ONLYOFFICE,";
$strings["UpdateOnlyoffice"] = "Veuillez mettre à jour ONLYOFFICE Docs vers la version 7.0 pour travailler sur les formulaires à remplir en ligne";
$strings["NotSupportedVersion"] = "Version non supportée";
$strings["jwt_header"] = "En-tête d'autorisation (laissez vide pour utiliser l'en-tête par défaut)";
$strings["connect_demo"] = "Se connecter à la version démo de ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "La période d'essai de 30 jours est expirée, vous n'êtes plus en mesure de vous connecter à la version démo de ONLYOFFICE Docs.";
$strings["demoPrevMessage"] = "C'est un serveur public proposé à des fins de tests, veuillez ne pas l'utiliser pour vos données personnelles sensibles. Le serveur est disponible pendant 30 jours.";
$strings["demoUsingMessage"] = "Vous utilisez la version démo de ONLYOFFICE Docs, proposée à des fins de tests. Veuillez ne pas stocker vos données confidentielles.";
$strings["document_server_internal"] = "Adresse du ONLYOFFICE Docs pour les demandes internes du serveur";
$strings["NotSupportedVersion"] = "Version non supportée";
$strings["storage_url"] = "Adresse du serveur pour les demandes internes du ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Lancez facilement les éditeurs dans le cloud sans téléchargement ni installation";
$strings["DocsCloudBannerButton"] = "Obtenir maintenant";
$strings["connectionError"] = "Erreur durant la tentative de connexion";
$strings["docServiceError"] = "Une erreur s'est produite dans le service de document";
$strings["pluginIsNotConfigured"] = "L'application ONLYOFFICE n'est pas configuré. Veuillez contacter votre administrateur";
$strings["cantReadXml"] = "Le serveur ne peut pas lire le XML";
$strings["badResponseErrors"] = "Mauvaise réponse. Erreurs: ";
$strings["mixedContent"] = "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le ONLYOFFICE Docs est requise";
$strings["badHealthcheckStatus"] = "Le statut de healthcheck n'est pas valide";
$strings["notSupportedVersion"] = "Version non supportée";

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Neues Dokument erstellen";
$strings["formTemplate"] = "Formularvorlage";
$strings["fillInFormInOnlyoffice"] = "Formular in ONLYOFFICE ausfüllen";
$strings["UpdateOnlyoffice"] = "Für Online-Arbeit mit Formularen ist Version 7.0 von ONLYOFFICE Docs erforderlich";
$strings["NotSupportedVersion"] = "Nicht unterstützte Version";
$strings["jwt_header"] = "Authorization-Header (leer lassen, um die standardmäßige Kopfzeile zu verwenden)";
$strings["connect_demo"] = "Verbindung zu Demo ONLYOFFICE Docs Server herstellen";
$strings["demoPeriodIsOver"] = "Der 30-tägige Testzeitraum ist abgelaufen. Du kannst keine Verbindung mehr zu Demo ONLYOFFICE Docs Server herstellen.";
$strings["demoPrevMessage"] = "Dies ist ein öffentlicher Testserver. Bitte verwende beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar.";
$strings["demoUsingMessage"] = "Du verwendest den öffentlichen Demo ONLYOFFICE Docs Server. Bitte benutze ihn nicht zum Speichern von Deinen privaten sensiblen Daten.";
$strings["document_server_internal"] = "Die Adresse von ONLYOFFICE Docs für interne Anforderungen vom Server";
$strings["NotSupportedVersion"] = "Nicht unterstützte Version";
$strings["storage_url"] = "Serveradresse für interne Anforderungen vom ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Öffnen Sie die Editoren in der Cloud einfach ohne Herunterladen und Installation";
$strings["DocsCloudBannerButton"] = "Jetzt erhalten";
$strings["connectionError"] = "Fehler beim Anschließen";
$strings["docServiceError"] = "Im Dokumentenservice ist ein Fehler aufgetreten";
$strings["pluginIsNotConfigured"] = "ONLYOFFICE App ist nicht konfiguriert. Bitte wenden Sie sich an Ihren Administrator";
$strings["cantReadXml"] = "Server kann eine xml-Datei nicht einlesen";
$strings["badResponseErrors"] = "Bad Response. Fehler: ";
$strings["mixedContent"] = "Mixed Active Content ist nicht möglich. HTTPS-Adresse für ONLYOFFICE Docs ist erforderlich.";
$strings["badHealthcheckStatus"] = "Ungültiger healthcheck-Status";
$strings["notSupportedVersion"] = "Nicht unterstützte Version";

@ -7,6 +7,7 @@ $strings["plugin_title"] = "ONLYOFFICE";
$strings['plugin_comment'] = "Ο συνδετήρας ONLYOFFICE σάς επιτρέπει να προβάλετε, να επεξεργαστείτε και να συνεργαστείτε σε έγγραφα κειμένου, υπολογιστικά φύλλα και παρουσιάσεις στο Chamilo χρησιμοποιώντας έγγραφα ONLYOFFICE.";
$strings["enable_onlyoffice_plugin"] = "Ενεργοποίηση";
$strings["document_server_url"] = "Διεύθυνση ONLYOFFICE Docs";
$strings["jwt_secret"] = "Μυστικό κλειδί (αφήστε κενό για απενεργοποίηση)";
$strings["openByOnlyoffice"] = "Άνοιγμα με ONLYOFFICE";
$strings["createNew"] = "Δημιουργία νέου";
$strings["title"] = "Τίτλος";
@ -18,3 +19,26 @@ $strings["create"] = "Δημιουργία";
$strings["fileIsExist"] = "Το αρχείο υπάρχει ήδη";
$strings["impossibleCreateFile"] = "Η δημιουργία αρχείου είναι αδύνατη";
$strings["createNewDocument"] = "Δημιουργία νέου εγγράφου";
$strings["formTemplate"] = "Πρότυπο φόρμας";
$strings["fillInFormInOnlyoffice"] = "Συμπληρώστε τη φόρμα στο ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Ενημερώστε το ONLYOFFICE Docs στην έκδοση 7.0 για να εργαστείτε σε διαδικτυακές συμπληρωμένες φόρμες";
$strings["NotSupportedVersion"] = "Μη υποστηριζόμενη έκδοση";
$strings["jwt_header"] = "Κεφαλίδα εξουσιοδότησης (αφήστε την κενή για να χρησιμοποιήσετε την προεπιλεγμένη κεφαλίδα)";
$strings["connect_demo"] = "Σύνδεση στον δοκιμαστικό διακομιστή ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "Η δοκιμαστική περίοδος 30 ημερών έχει λήξει. Δεν μπορείτε πλέον να συνδεθείτε στον δοκιμαστικό διακομιστή ONLYOFFICE Docs.";
$strings["demoPrevMessage"] = "Αυτός ο δοκιμαστικός διακομιστής είναι δημόσιος. Μην τον χρησιμοποιείτε για ιδιωτικά ευαίσθητα δεδομένα. Ο διακομιστής θα είναι διαθέσιμος κατά τη διάρκεια μιας περιόδου 30 ημερών.";
$strings["demoUsingMessage"] = "Χρησιμοποιήστε τον δημόσιο δοκιμαστικό διακομιστή ONLYOFFICE Docs. Μην αποθηκεύετε ιδιωτικά ευαίσθητα δεδομένα.";
$strings["document_server_internal"] = "Διεύθυνση ONLYOFFICE Docs για εσωτερικά αιτήματα από τον διακομιστή";
$strings["NotSupportedVersion"] = "Μη υποστηριζόμενη έκδοση";
$strings["storage_url"] = "Διεύθυνση διακομιστή για εσωτερικά αιτήματα από το ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Εύκολη εκκίνηση των προγραμμάτων επεξεργασίας κειμένων στο cloud χωρίς λήψη και εγκατάσταση";
$strings["DocsCloudBannerButton"] = "Λήψη τώρα";
$strings["connectionError"] = "Σφάλμα κατά την προσπάθεια σύνδεσης";
$strings["docServiceError"] = "Εμφανίστηκε σφάλμα στην υπηρεσία εγγράφων";
$strings["pluginIsNotConfigured"] = "Η εφαρμογή ONLYOFFICE δεν έχει ρυθμιστεί. Επικοινωνήστε με τον διαχειριστή";
$strings["cantReadXml"] = "Ο διακομιστής δεν μπορεί να διαβάσει xml";
$strings["badResponseErrors"] = "Κακή απάντηση. Σφάλματα: ";
$strings["mixedContent"] = "Δεν επιτρέπεται το μικτό ενεργό περιεχόμενο. Απαιτείται διεύθυνση HTTPS για τα ONLYOFFICE Docs.";
$strings["badHealthcheckStatus"] = "Κακή κατάσταση ελέγχου υγείας";
$strings["notSupportedVersion"] = "Μη υποστηριζόμενη έκδοση";

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Crea nuovo documento";
$strings["formTemplate"] = "Modello di modulo";
$strings["fillInFormInOnlyoffice"] = "Compilare il modulo in ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Si prega di aggiornare ONLYOFFICE Docs alla versione 7.0 per lavorare su moduli compilabili online";
$strings["NotSupportedVersion"] = "Versione non supportata";
$strings["jwt_header"] = "Intestazione di autorizzazione (lascia vuoto per utilizzare l'intestazione predefinita)";
$strings["connect_demo"] = "Collegati alla versione demo di ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "Il periodo di prova di 30 giorni è terminato; non è più possibile connettersi alla versione demo di ONLYOFFICE Docs.";
$strings["demoPrevMessage"] = "Questo è un server di prova pubblico, non utilizzarlo per dati sensibili privati. Il server sarà disponibile per un periodo di 30 giorni.";
$strings["demoUsingMessage"] = "Stai utilizzando la versione demo pubblica di ONLYOFFICE Docs. Non memorizzare dati sensibili privati.";
$strings["document_server_internal"] = "Indirizzo di ONLYOFFICE Docs per le richieste interne del server";
$strings["NotSupportedVersion"] = "Versione non supportata";
$strings["storage_url"] = "Indirizzo del server per le richieste interne da ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Avvia facilmente gli editor nel cloud senza scaricarli e installarli";
$strings["DocsCloudBannerButton"] = "Ottieni ora";
$strings["connectionError"] = "Errore durante il tentativo di connessione";
$strings["docServiceError"] = "Si è verificato un errore nel servizio documenti";
$strings["pluginIsNotConfigured"] = "L'applicazione ONLYOFFICE non è configurata. Si prega di contattare l'amministratore";
$strings["cantReadXml"] = "Il server non può leggere xml";
$strings["badResponseErrors"] = "Risposta non corretta. Errori: ";
$strings["mixedContent"] = "Il contenuto attivo misto non è consentito. È richiesto l'indirizzo HTTPS per ONLYOFFICE Docs.";
$strings["badHealthcheckStatus"] = "Stato del healthcheck non valido";
$strings["notSupportedVersion"] = "Versione non supportata";

@ -19,3 +19,26 @@ $strings["create"] = "Utwórz";
$strings["fileIsExist"] = "Plik już istnieje";
$strings["impossibleCreateFile"] = "Nie można utworzyć pliku";
$strings["createNewDocument"] = "Utwórz nowy dokument";
$strings["formTemplate"] = "Szablon formularza";
$strings["fillInFormInOnlyoffice"] = "Wypełnić formularz w ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Zaktualizuj ONLYOFFICE Docs do wersji 7.0, aby działały w formularzach do wypełniania online";
$strings["NotSupportedVersion"] = "Nieobsługiwana wersja";
$strings["jwt_header"] = "Nagłówek autoryzacji (pozostaw puste, aby użyć domyślnego nagłówka)";
$strings["connect_demo"] = "Połącz się z serwerem demo ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "Upłyneło 30 dni, nie możesz się już łączyć z serwerem demo.";
$strings["demoPrevMessage"] = "To jest publiczny testowy serwer, proszę nie używać go do prywatnych danych. Serwer będzie dostępny przez 30 dni.";
$strings["demoUsingMessage"] = "Używasz publicznego serwera demo. Nie przechowuj tu prywatnych danych.";
$strings["document_server_internal"] = "Adres ONLYOFFICE Docs dla zapytań wewnętrznych";
$strings["NotSupportedVersion"] = "Nieobsługiwana wersja";
$strings["storage_url"] = "Adres serwera dla zapytań wewnętrznych z ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Z łatwością uruchamiaj edytory w chmurze bez pobierania i instalacji";
$strings["DocsCloudBannerButton"] = "Uzyskaj teraz";
$strings["connectionError"] = "Błąd przy próbie połączenia";
$strings["docServiceError"] = "Wystąpił błąd w usłudze dokumentów";
$strings["pluginIsNotConfigured"] = "OAplikacja ONLYOFFICE nie jest skonfigurowana. Skontaktuj się z administratorem";
$strings["cantReadXml"] = "Serwer nie może przeczytać xml";
$strings["badResponseErrors"] = "Zła odpowiedź. Błędy: ";
$strings["mixedContent"] = "Aktywna Zawartość Mieszana nie jest dozwolona. Adres HTTPS jest wymagany dla ONLYOFFICE Docs.";
$strings["badHealthcheckStatus"] = "Zły stan kontroli kondycji";
$strings["notSupportedVersion"] = "Nieobsługiwana wersja";

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Criar novo documento";
$strings["formTemplate"] = "Modelo de formulário";
$strings["fillInFormInOnlyoffice"] = "Preencher formulário no ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Atualize o ONLYOFFICE Docs para a versão 7.0 para trabalhar em formulários preenchíveis online";
$strings["NotSupportedVersion"] = "Versão não suportada";
$strings["jwt_header"] = "Cabeçalho de autorização (Deixe em branco para usar o cabeçalho padrão)";
$strings["connect_demo"] = "Conectar ao Servidor de demonstração do ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "O período de teste de 30 dias acabou, você não pode mais se conectar ao Servidor de demonstração do ONLYOFFICE Docs";
$strings["demoPrevMessage"] = "Este é um servidor de teste público, não o use para dados confidenciais. O servidor estará disponível por um período de 30 dias.";
$strings["demoUsingMessage"] = "Você está usando o Servidor de demonstração pública. Não armazene dados confidenciais.";
$strings["document_server_internal"] = "Endereço do ONLYOFFICE Docs para pedidos internos do servidor";
$strings["NotSupportedVersion"] = "Versão não suportada";
$strings["storage_url"] = "Endereço do servidor para pedidos internos do ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Inicie facilmente os editores na nuvem sem download e instalação";
$strings["DocsCloudBannerButton"] = "Obter agora";
$strings["connectionError"] = "Erro ao tentar conectar";
$strings["docServiceError"] = "Ocorreu um erro no serviço de documentos";
$strings["pluginIsNotConfigured"] = "Aplicação ONLYOFFICE não está configurada. Favor contatar o administrador";
$strings["cantReadXml"] = "Servidor não pode ler xml";
$strings["badResponseErrors"] = "Resposta ruim. Erros: ";
$strings["mixedContent"] = "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o ONLYOFFICE Docs.";
$strings["badHealthcheckStatus"] = "Status de verificação de saúde ruim";
$strings["notSupportedVersion"] = "Versão não suportada";

@ -12,13 +12,33 @@ $strings["openByOnlyoffice"] = "Открыть с помощью ONLYOFFICE";
$strings["createNew"] = "Создать новый";
$strings["title"] = "Заголовок";
$strings["chooseFileFormat"] = "Выбрать формат файла";
$strings["document"] = "Документ ";
$strings["spreadsheet"] = "Таблица ";
$strings["presentation"] = "Презентация ";
$strings["create"] = "Создать ";
$strings["document"] = "Текстовый документ";
$strings["spreadsheet"] = "Электронная таблица";
$strings["presentation"] = "Презентация";
$strings["create"] = "Создать";
$strings["fileIsExist"] = "Файл уже существует";
$strings["impossibleCreateFile"] = "Невозможно создать файл";
$strings["createNewDocument"] = "Создать новый документ";
$strings["formTemplate"] = "Шаблон формы";
$strings["fillInFormInOnlyoffice"] = "Заполнить форму в ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Обновите сервер ONLYOFFICE Docs до версии 7.0 для работы с формами онлайн";
$strings["NotSupportedVersion"] = "Неподдерживаемая версия";
$strings["jwt_header"] = "Заголовок авторизации (оставьте пустым, чтобы использовать заголовок по умолчанию)";
$strings["connect_demo"] = "Подключиться к демонстрационному серверу ONLYOFFICE Docs";
$strings["demoPeriodIsOver"] = "30-дневный тестовый период закончен, вы больше не можете подключаться к демонстрационному серверу ONLYOFFICE Docs.";
$strings["demoPrevMessage"] = "Это публичный тестовый сервер, пожалуйста, не используйте его для личных конфиденциальных данных. Сервер будет доступен в течение 30 дней.";
$strings["demoUsingMessage"] = "Вы используете публичный демонстрационный сервер ONLYOFFICE Docs. Пожалуйста, не храните конфиденциальные данные.";
$strings["document_server_internal"] = "Адрес ONLYOFFICE Docs для внутренних запросов сервера";
$strings["NotSupportedVersion"] = "Неподдерживаемая версия";
$strings["storage_url"] = "Адрес сервера для внутренних запросов ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Легко запускайте редакторы в облаке без скачивания и установки";
$strings["DocsCloudBannerButton"] = "Получить сейчас";
$strings["connectionError"] = "При попытке соединения возникла ошибка";
$strings["docServiceError"] = "Возникла ошибка в службе документов";
$strings["pluginIsNotConfigured"] = "Приложение ONLYOFFICE не сконфигурировано. Пожалуйста, свяжитесь с администратором.";
$strings["cantReadXml"] = "Невозможно прочитать xml файл на сервере";
$strings["badResponseErrors"] = "Неправильный ответ. Ошибки: ";
$strings["mixedContent"] = "Смешанное активное содержимое запрещено. Для ONLYOFFICE Docs необходимо использовать HTTPS-адрес.";
$strings["badHealthcheckStatus"] = "Ошибка при проверке работоспособности";
$strings["notSupportedVersion"] = "Неподдерживаемая версия";

@ -22,3 +22,23 @@ $strings["createNewDocument"] = "Crear documento nuevo";
$strings["formTemplate"] = "Plantilla de formulario";
$strings["fillInFormInOnlyoffice"] = "Rellenar el formulario en ONLYOFFICE";
$strings["UpdateOnlyoffice"] = "Por favor, actualice ONLYOFFICE Docs a la versión 7.0 para poder trabajar con formularios rellenables en línea";
$strings["NotSupportedVersion"] = "Versión no compatible";
$strings["jwt_header"] = "Encabezado de autenticación (dejar en blanco para utilizar el encabezado predeterminado)";
$strings["connect_demo"] = "Conectarse al servidor de ONLYOFFICE Docs de demostración";
$strings["demoPeriodIsOver"] = "El período de prueba de 30 días ha terminado, ya no puedes conectarte al servidor de ONLYOFFICE Docs de demostración";
$strings["demoPrevMessage"] = "Este es un servidor de pruebas público, por favor no lo uses para tus datos confidenciales. El servidor estará disponible durante un período de 30 días.";
$strings["demoUsingMessage"] = "Estás usando el servidor de ONLYOFFICE Docs de demostración. Por favor, no almacenes tus datos confidenciales aquí.";
$strings["document_server_internal"] = "Dirección de ONLYOFFICE Docs para solicitudes internas del servidor";
$strings["NotSupportedVersion"] = "Versión no compatible";
$strings["storage_url"] = "Dirección de servidor para solicitudes internas del ONLYOFFICE Docs";
$strings["DocsCloudBannerTitle"] = "ONLYOFFICE Docs Cloud";
$strings["DocsCloudBannerMain"] = "Inicie fácilmente los editores en la nube sin tener que descargarlos ni instalarlos";
$strings["DocsCloudBannerButton"] = "Obtener ahora";
$strings["connectionError"] = "Error al intentar establecer la conexión";
$strings["docServiceError"] = "Se ha producido un error en el servicio de documentos";
$strings["pluginIsNotConfigured"] = "Aplicación ONLYOFFICE no está configurada. Por favor, contacte con admin";
$strings["cantReadXml"] = "Servidor no puede leer xml";
$strings["badResponseErrors"] = "Respuesta Mala. Errores: ";
$strings["mixedContent"] = "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para ONLYOFFICE Docs.";
$strings["badHealthcheckStatus"] = "Mal comprobación de estado";
$strings["notSupportedVersion"] = "Versión no compatible";

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,6 +28,27 @@ class AppConfig {
*/
private const jwtHeader = "onlyoffice_jwt_header";
/**
* The config key for the internal url
*
* @var string
*/
private const internalUrl = "onlyoffice_internal_url";
/**
* Link to Docs Cloud
*
* @var string
*/
private const linkToDocs = "https://www.onlyoffice.com/docs-registration.aspx?referer=chamilo";
/**
* The config key for the storage url
*
* @var string
*/
private const storageUrl = "onlyoffice_storage_url";
/**
* Get the jwt header setting
*
@ -36,10 +57,57 @@ class AppConfig {
public static function JwtHeader()
{
$header = api_get_configuration_value(self::jwtHeader);
if (empty($header)) {
$header = "Authorization";
return $header;
}
return $header;
/**
* Get the internal url setting
*
* @return string
*/
public static function InternalUrl()
{
$internalUrl = api_get_configuration_value(self::internalUrl);
return $internalUrl;
}
/**
* Get the storage url setting
*
* @return string
*/
public static function StorageUrl()
{
$storageUrl = api_get_configuration_value(self::storageUrl);
return $storageUrl;
}
/**
* DEMO DATA
*/
private const DEMO_PARAM = [
"ADDR" => "https://onlinedocs.onlyoffice.com/",
"HEADER" => "AuthorizationJWT",
"SECRET" => "sn2puSUF7muF5Jas",
"TRIAL" => 30
];
/**
* Get demo params
*
* @return array
*/
public static function GetDemoParams()
{
return self::DEMO_PARAM;
}
/**
* Get link to Docs Cloud
*
* @return string
*/
public function GetLinkToDocs() {
return self::linkToDocs;
}
}

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,6 +19,9 @@
require_once __DIR__ . "/../../../main/inc/global.inc.php";
use \Firebase\JWT\JWT;
use \Firebase\JWT\Key;
class Crypt {
/**
@ -30,7 +33,7 @@ class Crypt {
*/
public static function GetHash($object)
{
return \Firebase\JWT\JWT::encode($object, api_get_security_key());
return JWT::encode($object, api_get_security_key(), "HS256");
}
/**
@ -48,7 +51,7 @@ class Crypt {
return [$result, "token is empty"];
}
try {
$result = \Firebase\JWT\JWT::decode($token, api_get_security_key(), array("HS256"));
$result = JWT::decode($token, new Key(api_get_security_key(), "HS256"));
} catch (\UnexpectedValueException $e) {
$error = $e->getMessage();
}

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -86,13 +86,13 @@ class FileUtility {
public static function getDocType(string $extension): string
{
if (in_array($extension, self::$text_doc)) {
return "text";
return "word";
}
if (in_array($extension, self::$presentation_doc)) {
return "presentation";
return "slide";
}
if (in_array($extension, self::$spreadsheet_doc)) {
return "spreadsheet";
return "cell";
}
return "";

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,18 +24,27 @@
*/
class OnlyofficePlugin extends Plugin implements HookPluginInterface
{
/**
* OnlyofficePlugin name.
*/
private $pluginName = "onlyoffice";
/**
* OnlyofficePlugin constructor.
*/
protected function __construct()
{
parent::__construct(
"1.2.0",
"1.3.0",
"Asensio System SIA",
[
"enable_onlyoffice_plugin" => "boolean",
"document_server_url" => "text",
"jwt_secret" => "text"
"jwt_secret" => "text",
"jwt_header" => "text",
"document_server_internal" => "text",
"storage_url" => "text"
]
);
}
@ -95,4 +104,212 @@ class OnlyofficePlugin extends Plugin implements HookPluginInterface
$viewObserver = OnlyofficeItemViewObserver::create();
HookDocumentItemView::create()->detach($viewObserver);
}
/**
* Get status of demo server
*
* @return bool
*/
public function useDemo() {
return $this->getDemoData()["enabled"] === true;
}
/**
* Get demo data
*
* @return array
*/
public function getDemoData() {
$data = api_get_setting('onlyoffice_connect_demo_data')[0];
if (empty($data)) {
$data = [
"available" => true,
"enabled" => false
];
api_add_setting(json_encode($data), 'onlyoffice_connect_demo_data', null, 'setting', 'Plugins');
return $data;
}
$data = json_decode($data, true);
if (isset($data['start'])) {
$overdue = $data["start"];
$overdue += 24*60*60*AppConfig::GetDemoParams()["TRIAL"];
if ($overdue > time()) {
$data["available"] = true;
$data["enabled"] = $data["enabled"] === true;
} else {
$data["available"] = false;
$data["enabled"] = false;
api_set_setting('onlyoffice_connect_demo_data', json_encode($data));
}
}
return $data;
}
/**
* Switch on demo server
*
* @param bool $value - select demo
*
* @return bool
*/
public function selectDemo($value) {
$data = $this->getDemoData();
if ($value === true && !$data["available"]) {
return false;
}
$data["enabled"] = $value === true;
if (!isset($data["start"])) {
$data["start"] = time();
}
api_set_setting('onlyoffice_connect_demo_data', json_encode($data));
return true;
}
/**
* Get the document server url
*
* @param bool $origin - take origin
*
* @return string
*/
public function getDocumentServerUrl($origin = false)
{
if (!$origin && $this->useDemo()) {
return AppConfig::GetDemoParams()["ADDR"];
}
$url = $this->get("document_server_url");
return self::processUrl($url);
}
/**
* Get the document service address available from Chamilo from the application configuration
*
* @param bool $origin - take origin
*
* @return string
*/
public function getDocumentServerInternalUrl($origin = false) {
if (!$origin && $this->useDemo()) {
return $this->getDocumentServerUrl();
}
$url = $this->get('document_server_internal');
if (empty($url)) {
$url = AppConfig::InternalUrl();
}
if (!$origin && empty($url)) {
$url = $this->getDocumentServerUrl();
}
return self::processUrl($url);
}
/**
* Replace domain in document server url with internal address from configuration
*
* @param string $url - document server url
*
* @return string
*/
public function replaceDocumentServerUrlToInternal($url) {
$documentServerUrl = $this->getDocumentServerInternalUrl();
if (!empty($documentServerUrl)) {
$from = $this->getDocumentServerUrl();
if (!preg_match("/^https?:\/\//i", $from)) {
$parsedUrl = parse_url($url);
$from = $parsedUrl["scheme"] . "://" . $parsedUrl["host"] . (array_key_exists("port", $parsedUrl) ? (":" . $parsedUrl["port"]) : "") . $from;
}
if ($from !== $documentServerUrl)
{
$url = str_replace($from, $documentServerUrl, $url);
}
}
return $url;
}
/**
* Get the Chamilo address available from document server from the application configuration
*
* @return string
*/
public function getStorageUrl() {
$storageUrl = $this->get('storage_url');
if (empty($storageUrl)) {
$storageUrl = AppConfig::StorageUrl();
}
return self::processUrl($storageUrl);
}
/**
* Get the document service secret key from the application configuration
*
* @param bool $origin - take origin
*
* @return string
*/
public function getDocumentServerSecret($origin = false) {
if (!$origin && $this->useDemo()) {
return AppConfig::GetDemoParams()["SECRET"];
}
return $this->get("jwt_secret");
}
/**
* Get the jwt header setting
*
* @param bool $origin - take origin
*
* @return string
*/
public function getJwtHeader($origin = false) {
if (!$origin && $this->useDemo()) {
return AppConfig::GetDemoParams()["HEADER"];
}
$header = $this->get('jwt_header');
if (empty($header)) {
$header = AppConfig::JwtHeader() ? AppConfig::JwtHeader() : "Authorization";
}
return $header;
}
/**
* Get link to plugin settings
*
* @return string
*/
public function getConfigLink() {
return api_get_path(WEB_PATH)."main/admin/configure_plugin.php?name=".$this->pluginName;
}
/**
* Get plugin name
*
* @return string
*/
public function getPluginName() {
return $this->pluginName;
}
/**
* Add backslash to url if it's needed
*
* @return string
*/
public function processUrl($url) {
if ($url !== null && $url !== "/") {
$url = rtrim($url, "/");
if (strlen($url) > 0) {
$url = $url . "/";
}
}
return $url;
}
}

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,21 +33,26 @@ class TemplateManager {
"el" => "el-GR",
"en" => "en-US",
"es" => "es-ES",
"eu" => "eu-ES",
"fr" => "fr-FR",
"gl" => "gl-ES",
"it" => "it-IT",
"ja" => "ja-JP",
"ko" => "ko-KR",
"lv" => "lv-LV",
"nl" => "nl-NL",
"ms" => "ms-MY",
"pl" => "pl-PL",
"pt" => "pt-PT",
"pt-BR" => "pt-BR",
"ru" => "ru-RU",
"sk" => "sk-SK",
"sv" => "sv-SE",
"tr" => "tr-TR",
"uk" => "uk-UA",
"vi" => "vi-VN",
"zh" => "zh-CN"
"zh" => "zh-CN",
"zh-TW" => "zh-TW"
];
/**

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,9 +18,15 @@
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/lib/onlyofficeSettingsFormBuilder.php';
/**
* @author Asensio System SIA
*/
$plugin_info = OnlyofficePlugin::create()->get_info();
$plugin = OnlyofficePlugin::create();
$plugin_info = $plugin->get_info();
$plugin_info['settings_form'] = OnlyofficeSettingsFormBuilder::buildSettingsForm($plugin);
if ($plugin_info['settings_form']->validate()) {
$plugin = OnlyofficeSettingsFormBuilder::validateSettingsForm($plugin);
}

@ -1,7 +1,7 @@
<?php
/**
*
* (c) Copyright Ascensio System SIA 2021
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Loading…
Cancel
Save