Skip to content

Commit 62db166

Browse files
authored
Merge pull request #414 from ONLYOFFICE/develop
Release/7.8.1
2 parents 1081e26 + 1ecb417 commit 62db166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+575
-96
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
## 7.8.1
4+
## Added
5+
- disable plugins setting
6+
- document protection setting
7+
- jwt leeway setting
8+
- Danish translation
9+
10+
## Changed
11+
- fix notification length
12+
- additional check availability for external files when mention
13+
314
## 7.6.7
415
## Added
516
- Dutch translation

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,20 @@ If the server with the ownCloud installed does not have an Internet access, or i
5151
```
5252

5353
2. Get the ownCloud ONLYOFFICE integration app.
54-
5554
There are several ways to do that:
5655

5756
a. Download the latest signed version from the official store for [ownCloud](https://marketplace.owncloud.com/apps/onlyoffice).
5857

5958
b. Or you can download the latest signed version from the application [release page](https://github.com/ONLYOFFICE/onlyoffice-owncloud/releases) on GitHub.
6059

6160
c. Or you can clone the application source code and compile it yourself:
62-
6361
```bash
6462
git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice
6563
cd onlyoffice
6664
git submodule update --init --recursive
6765
```
6866

69-
> 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.
67+
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.
7068

7169
3. Change the owner to update the application right from ownCloud web interface:
7270

appinfo/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

appinfo/application.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -91,6 +91,9 @@ function () {
9191
require_once __DIR__ . "/../3rdparty/jwt/SignatureInvalidException.php";
9292
require_once __DIR__ . "/../3rdparty/jwt/JWT.php";
9393

94+
// Set the leeway for the JWT library in case the system clock is a second off
95+
\Firebase\JWT\JWT::$leeway = $this->appConfig->GetJwtLeeway();
96+
9497
$container = $this->getContainer();
9598

9699
$detector = $container->query(IMimeTypeDetector::class);

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within ownCloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.</description>
77
<licence>apl2</licence>
88
<author>Ascensio System SIA</author>
9-
<version>7.6.7</version>
9+
<version>7.8.1</version>
1010
<namespace>Onlyoffice</namespace>
1111
<types>
1212
<filesystem/>

appinfo/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

controller/callbackcontroller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

controller/editorapicontroller.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -386,6 +386,12 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
386386
$ownerId = $owner->getUID();
387387
}
388388

389+
$canProtect = true;
390+
if ($this->config->GetProtection() === "owner") {
391+
$canProtect = $ownerId === $userId;
392+
}
393+
$params["document"]["permissions"]["protect"] = $canProtect;
394+
389395
$hashCallback = $this->crypt->GetHash(["userId" => $userId, "ownerId" => $ownerId, "fileId" => $file->getId(), "filePath" => $filePath, "shareToken" => $shareToken, "action" => "track"]);
390396
$callback = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.track", ["doc" => $hashCallback]);
391397

@@ -703,6 +709,10 @@ private function setCustomization($params) {
703709
$params["editorConfig"]["customization"]["macros"] = false;
704710
}
705711

712+
//default is true
713+
if($this->config->GetCustomizationPlugins() === false) {
714+
$params["editorConfig"]["customization"]["plugins"] = false;
715+
}
706716

707717
/* from system config */
708718

controller/editorcontroller.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -457,6 +457,19 @@ public function mention($fileId, $anchor, $comment, $emails) {
457457
return ["error" => $this->trans->t("Failed to send notification")];
458458
}
459459

460+
foreach ($emails as $email) {
461+
$substrToDelete = "+" . $email . " ";
462+
$comment = str_replace($substrToDelete, "", $comment);
463+
}
464+
465+
//Length from ownCloud:
466+
//https://github.com/owncloud/core/blob/master/lib/private/Notification/Notification.php#L181
467+
$maxLen = 64;
468+
if (strlen($comment) > $maxLen) {
469+
$ending = "...";
470+
$comment = substr($comment, 0, ($maxLen - strlen($ending))) . $ending;
471+
}
472+
460473
$notificationManager = \OC::$server->getNotificationManager();
461474
$notification = $notificationManager->createNotification();
462475
$notification->setApp($this->appName)
@@ -481,7 +494,18 @@ public function mention($fileId, $anchor, $comment, $emails) {
481494

482495
foreach ($recipientIds as $recipientId) {
483496
$recipient = $this->userManager->get($recipientId);
484-
if (!in_array($recipient, $accessList)) {
497+
$isAvailable = in_array($recipient, $accessList);
498+
499+
if (!$isAvailable
500+
&& $file->getFileInfo()->getMountPoint() instanceof \OCA\Files_External\Config\ExternalMountPoint) {
501+
502+
$recipientFolder = $this->root->getUserFolder($recipientId);
503+
$recipientFile = $recipientFolder->getById($file->getId());
504+
505+
$isAvailable = !empty($recipientFile);
506+
}
507+
508+
if (!$isAvailable) {
485509
if (!$canShare) {
486510
continue;
487511
}

controller/federationcontroller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
*
4-
* (c) Copyright Ascensio System SIA 2022
4+
* (c) Copyright Ascensio System SIA 2023
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)