From 6ca8071c495ebf4cd7797dd44a0700f9970abc31 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 15 Oct 2024 09:31:39 +0200 Subject: [PATCH] feat: expose the documentSigningCa personal setting in the WOPI CheckFileInfo This setting was already possible to read and write from the personal settings UI, but was not available towards Collabora Online. Other private user settings like the Zotero API key are exposed in the WOPI CheckFileInfo reply. Do the same here: if the feature is enabled in general and this is not a public share, then include the signature CA setting in the CheckFileInfo response. The same still needs doing for the signature cert/key. Related to #4123 Signed-off-by: Miklos Vajna --- lib/Controller/WopiController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index 1c900cca58..fdbe14ff09 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -165,6 +165,11 @@ public function checkFileInfo(string $fileId, string $access_token): JSONRespons $zoteroAPIKey = $this->config->getUserValue($wopi->getEditorUid(), 'richdocuments', 'zoteroAPIKey', ''); $response['UserPrivateInfo']['ZoteroAPIKey'] = $zoteroAPIKey; } + $enableDocumentSigning = $this->config->getAppValue(Application::APPNAME, 'documentSigningEnabled', 'yes') === 'yes'; + if (!$isPublic && $enableDocumentSigning) { + $documentSigningCa = $this->config->getUserValue($wopi->getEditorUid(), 'richdocuments', 'documentSigningCa', ''); + $response['UserPrivateInfo']['SignatureCa'] = $documentSigningCa; + } if ($wopi->hasTemplateId()) { $response['TemplateSource'] = $this->getWopiUrlForTemplate($wopi); }