diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Migration/MimeRepair.php | 112 | ||||
-rw-r--r-- | lib/documentservice.php | 4 | ||||
-rw-r--r-- | lib/templatemanager.php | 2 |
3 files changed, 6 insertions, 112 deletions
diff --git a/lib/Migration/MimeRepair.php b/lib/Migration/MimeRepair.php deleted file mode 100644 index 069baa9..0000000 --- a/lib/Migration/MimeRepair.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php -/** - * - * (c) Copyright Ascensio System SIA 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -namespace OCA\Onlyoffice\Migration; - -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; -use OCP\Files\IMimeTypeDetector; - -use OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder; - -use Psr\Log\LoggerInterface; - -use OCA\Onlyoffice\AppConfig; - -class MimeRepair implements IRepairStep { - - private const MIMETYPELIST = "mimetypelist.js"; - private const CUSTOM_MIMETYPEALIASES = "mimetypealiases.json"; - - private const DOCUMENT_ALIAS = "x-office/document"; - - /** - * Application name - * - * @var string - */ - private static $appName = "onlyoffice"; - - /** - * Application configuration - * - * @var AppConfig - */ - private $config; - - /** - * Logger Interface - * - * @var LoggerInterface - */ - protected $logger; - - /** - * Mimetype detector - * - * @var IMimeTypeDetector - */ - protected $detector; - - public function __construct(LoggerInterface $logger, - IMimeTypeDetector $detector) { - $this->logger = $logger; - $this->detector = $detector; - $this->config = new AppConfig(self::$appName); - } - - /** - * Returns the step's name - */ - public function getName() { - return self::$appName; - } - - /** - * @param IOutput $output - */ - public function run(IOutput $output) { - $this->logger->debug("Mimetypes repair run", ["app" => self::$appName]); - - $customAliasPath = \OC::$SERVERROOT . "/config/" . self::CUSTOM_MIMETYPEALIASES; - - $mimes = [ - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf" => self::DOCUMENT_ALIAS, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform" => self::DOCUMENT_ALIAS - ]; - - $customAlias = $mimes; - if (file_exists($customAliasPath)) { - $customAlias = json_decode(file_get_contents($customAliasPath), true); - foreach ($mimes as $mime => $icon) { - if (!isset($customAlias[$mime])) { - $customAlias[$mime] = $icon; - } - } - } - - file_put_contents($customAliasPath, json_encode($customAlias, JSON_PRETTY_PRINT)); - - //matches the command maintenance:mimetype:update-js - //from OC\Core\Command\Maintenance\Mimetype\UpdateJS - $aliases = $this->detector->getAllAliases(); - $generatedMimetypeFile = new GenerateMimetypeFileBuilder(); - file_put_contents(\OC::$SERVERROOT . "/core/js/" . self::MIMETYPELIST, $generatedMimetypeFile->generateFile($aliases)); - } -}
\ No newline at end of file diff --git a/lib/documentservice.php b/lib/documentservice.php index 85437e8..fe54c8f 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -364,6 +364,10 @@ class DocumentService { $opts["timeout"] = 60; } + $opts['nextcloud'] = [ + 'allow_local_address' => true, + ]; + if ($method === "post") { $response = $client->post($url, $opts); } else { diff --git a/lib/templatemanager.php b/lib/templatemanager.php index 3ff675a..2f7e43b 100644 --- a/lib/templatemanager.php +++ b/lib/templatemanager.php @@ -243,6 +243,7 @@ class TemplateManager { "en_GB" => "en-GB", "es" => "es-ES", "fr" => "fr-FR", + "gl" => "gl-ES", "it" => "it-IT", "ja" => "ja-JP", "ko" => "ko-KR", @@ -254,6 +255,7 @@ class TemplateManager { "ru" => "ru-RU", "sk" => "sk-SK", "sv" => "sv-SE", + "tr" => "tr-TR", "uk" => "uk-UA", "vi" => "vi-VN", "zh_CN" => "zh-CN" |