Skip to content

Commit

Permalink
Merge pull request #393 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/7.6.7
  • Loading branch information
LinneyS authored Oct 20, 2022
2 parents 5801236 + 1a40518 commit a88bc15
Show file tree
Hide file tree
Showing 35 changed files with 693 additions and 188 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## 7.6.7
## Added
- Dutch translation
- Chinese (Traditional, Taiwan), Basque (Spain), Armenian and Malay (Malaysia) empty file templates

## Changed
- fix edit locked file
- generate preview by default
- fix collaboration of federated files
- disable forcesave on encryption

## 7.5.4
## Changed
- compatible with ownCloud 10.11
Expand Down
43 changes: 42 additions & 1 deletion appinfo/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<comments>last forcesave done</comments>
</field>
<index>
<name>file_id_index</name>
<name>onlyoffice_file_id_index</name>
<unique>true</unique>
<field>
<name>file_id</name>
Expand All @@ -51,4 +51,45 @@
</index>
</declaration>
</table>

<table>
<name>*dbprefix*onlyoffice_instance</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
</field>
<field>
<name>remote</name>
<type>text</type>
<notnull>true</notnull>
<length>128</length>
<comments>remote instance address</comments>
</field>
<field>
<name>expire</name>
<type>bigint</type>
<default>0</default>
<comments>time to live</comments>
</field>
<field>
<name>status</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<comments>remote instance status</comments>
</field>
<index>
<name>onlyoffice_remote_index</name>
<unique>true</unique>
<field>
<name>remote</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
</database>
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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>
<licence>apl2</licence>
<author>Ascensio System SIA</author>
<version>7.5.4</version>
<version>7.6.7</version>
<namespace>Onlyoffice</namespace>
<types>
<filesystem/>
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"ocs" => [
["name" => "federation#key", "url" => "/api/v1/key", "verb" => "POST"],
["name" => "federation#keylock", "url" => "/api/v1/keylock", "verb" => "POST"],
["name" => "federation#healthcheck", "url" => "/api/v1/healthcheck", "verb" => "GET"],
["name" => "editorapi#config", "url" => "/api/v1/config/{fileId}", "verb" => "GET"],
["name" => "editorapi#fillempty", "url" => "/api/v1/empty/{fileId}", "verb" => "GET"],
["name" => "settingsapi#get_doc_server_url", "url" => "/api/v1/settings/docserver", "verb" => "GET"],
Expand Down
2 changes: 1 addition & 1 deletion assets
Submodule assets updated 78 files
+ az-Latn-AZ/new.docx
+ az-Latn-AZ/new.docxf
+ az-Latn-AZ/new.pptx
+ az-Latn-AZ/new.xlsx
+ bg-BG/new.pptx
+ bg-BG/new.xlsx
+ de-DE/new.pptx
+ de-DE/new.xlsx
+ el-GR/new.pptx
+ el-GR/new.xlsx
+ en-GB/new.pptx
+ en-GB/new.xlsx
+ en-US/new.pptx
+ en-US/new.xlsx
+ es-ES/new.docxf
+ es-ES/new.pptx
+ es-ES/new.xlsx
+ eu-ES/new.docx
+ eu-ES/new.docxf
+ eu-ES/new.pptx
+ eu-ES/new.xlsx
+ fr-FR/new.pptx
+ fr-FR/new.xlsx
+ gl-ES/new.pptx
+ gl-ES/new.xlsx
+ hy-AM/new.docx
+ hy-AM/new.docxf
+ hy-AM/new.pptx
+ hy-AM/new.xlsx
+ it-IT/new.pptx
+ it-IT/new.xlsx
+ ja-JP/new.docx
+ ja-JP/new.docxf
+ ja-JP/new.pptx
+ ja-JP/new.xlsx
+ ko-KR/new.pptx
+ ko-KR/new.xlsx
+ lv-LV/new.pptx
+ lv-LV/new.xlsx
+ ms-MY/new.docx
+ ms-MY/new.docxf
+ ms-MY/new.pptx
+ ms-MY/new.xlsx
+ nl-NL/new.pptx
+ nl-NL/new.xlsx
+ pl-PL/new.pptx
+ pl-PL/new.xlsx
+ pt-BR/new.docx
+ pt-BR/new.docxf
+ pt-BR/new.pptx
+ pt-BR/new.xlsx
+ pt-PT/new.docx
+ pt-PT/new.docxf
+ pt-PT/new.pptx
+ pt-PT/new.xlsx
+ ru-RU/new.pptx
+ ru-RU/new.xlsx
+ sk-SK/new.docx
+ sk-SK/new.docxf
+ sk-SK/new.pptx
+ sk-SK/new.xlsx
+ sv-SE/new.docx
+ sv-SE/new.docxf
+ sv-SE/new.pptx
+ sv-SE/new.xlsx
+ tr-TR/new.docxf
+ tr-TR/new.pptx
+ tr-TR/new.xlsx
+ uk-UA/new.pptx
+ uk-UA/new.xlsx
+ vi-VN/new.pptx
+ vi-VN/new.xlsx
+ zh-CN/new.pptx
+ zh-CN/new.xlsx
+ zh-TW/new.docx
+ zh-TW/new.docxf
+ zh-TW/new.pptx
+ zh-TW/new.xlsx
18 changes: 11 additions & 7 deletions controller/callbackcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;

use OCA\Files_Sharing\External\Storage as SharingExternalStorage;

use OCA\Onlyoffice\AppConfig;
use OCA\Onlyoffice\Crypt;
use OCA\Onlyoffice\DocumentService;
use OCA\Onlyoffice\FileVersions;
use OCA\Onlyoffice\KeyManager;
use OCA\Onlyoffice\VersionManager;
use OCA\Onlyoffice\KeyManager;
use OCA\Onlyoffice\RemoteInstance;
use OCA\Onlyoffice\TemplateManager;

/**
Expand Down Expand Up @@ -534,8 +533,8 @@ public function track($doc, $users, $key, $status, $url, $token, $history, $chan

$prevIsForcesave = KeyManager::wasForcesave($fileId);

if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
$isLock = KeyManager::lockFederatedKey($file, $isForcesave, null);
if (RemoteInstance::isRemoteFile($file)) {
$isLock = RemoteInstance::lockRemoteKey($file, $isForcesave, null);
if ($isForcesave && !$isLock) {
break;
}
Expand All @@ -548,9 +547,9 @@ public function track($doc, $users, $key, $status, $url, $token, $history, $chan
return $file->putContent($newData);
});

if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
if (RemoteInstance::isRemoteFile($file)) {
if ($isForcesave) {
KeyManager::lockFederatedKey($file, false, $isForcesave);
RemoteInstance::lockRemoteKey($file, false, $isForcesave);
}
} else {
KeyManager::lock($fileId, false);
Expand All @@ -573,6 +572,11 @@ public function track($doc, $users, $key, $status, $url, $token, $history, $chan
FileVersions::saveAuthor($file->getFileInfo(), $user);
}

if ($this->config->checkEncryptionModule() === "master"
&& !$isForcesave) {
KeyManager::delete($fileId);
}

$result = 0;
} catch (\Exception $e) {
$this->logger->logException($e, ["message" => "Track: $fileId status $status error", "app" => $this->appName]);
Expand Down
7 changes: 5 additions & 2 deletions controller/editorapicontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =

$user = $this->userSession->getUser();
$userId = null;
$accountId = null;
if (!empty($user)) {
$userId = $user->getUID();
$accountId = $user->getAccountId();
}

list ($file, $error, $share) = empty($shareToken) ? $this->getFile($userId, $fileId, $filePath, $template) : $this->fileUtility->getFileByToken($fileId, $shareToken);
Expand Down Expand Up @@ -360,9 +362,10 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
$locks = $fileStorage->getLocks($file->getFileInfo()->getInternalPath(), false);
if (count($locks) > 0) {
$activeLock = $locks[0];
$lockOwner = explode(' ', trim($activeLock->getOwner()))[0];
if ($userId !== $lockOwner) {

if ($accountId !== $activeLock->getOwnerAccountId()) {
$isPersistentLock = true;
$lockOwner = $activeLock->getOwner();
$this->logger->debug("File $fileId is locked by $lockOwner", ["app" => $this->appName]);
}
}
Expand Down
22 changes: 18 additions & 4 deletions controller/federationcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@

use OC\OCS\Result;

use OCA\Files_Sharing\External\Storage as SharingExternalStorage;

use OCA\Onlyoffice\AppConfig;
use OCA\Onlyoffice\DocumentService;
use OCA\Onlyoffice\FileUtility;
use OCA\Onlyoffice\KeyManager;
use OCA\Onlyoffice\RemoteInstance;

/**
* OCS handler
Expand Down Expand Up @@ -137,8 +136,8 @@ public function keylock($shareToken, $path, $lock, $fs) {

$fileId = $file->getId();

if ($file->getStorage()->instanceOfStorage(SharingExternalStorage::class)) {
$isLock = KeyManager::lockFederatedKey($file, $lock, $fs);
if (RemoteInstance::isRemoteFile($file)) {
$isLock = RemoteInstance::lockRemoteKey($file, $lock, $fs);
if (!$isLock) {
return new Result(["error" => "Failed request"]);
}
Expand All @@ -152,4 +151,19 @@ public function keylock($shareToken, $path, $lock, $fs) {
$this->logger->debug("Federated request lock for " . $fileId, ["app" => $this->appName]);
return new Result();
}

/**
* Health check instance
*
* @return Result
*
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
*/
public function healthcheck() {
$this->logger->debug("Federated healthcheck", ["app" => $this->appName]);

return new Result(["alive" => true]);
}
}
2 changes: 1 addition & 1 deletion controller/settingscontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function index() {
"sameTab" => $this->config->GetSameTab(),
"preview" => $this->config->GetPreview(),
"versionHistory" => $this->config->GetVersionHistory(),
"encryption" => ($this->config->checkEncryptionModule() === true),
"encryption" => $this->config->checkEncryptionModule(),
"limitGroups" => $this->config->GetLimitGroups(),
"chat" => $this->config->GetCustomizationChat(),
"compactHeader" => $this->config->GetCustomizationCompactHeader(),
Expand Down
5 changes: 4 additions & 1 deletion css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
-moz-column-width: 140px;
-webkit-column-width: 140px;
}
#personal-show + label{
#personal-show + label {
margin-top: -25px;
margin-left: 230px;
}
.onlyoffice-option-desc {
margin-left: 20px;
}
3 changes: 2 additions & 1 deletion l10n/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OC.L10N.register(
"Default editor theme": "Standardmäßiges Thema des Editors",
"Light": "Hell",
"Classic Light": "Klassisch Hell",
"Dark": "Dunkel"
"Dark": "Dunkel",
"This feature is unavailable due to encryption settings.": "Diese Funktion ist wegen der Verschlüsselungseinstellungen nicht verfügbar"
},
"nplurals=2; plural=(n != 1);");
3 changes: 2 additions & 1 deletion l10n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Default editor theme": "Standardmäßiges Thema des Editors",
"Light": "Hell",
"Classic Light": "Klassisch Hell",
"Dark": "Dunkel"
"Dark": "Dunkel",
"This feature is unavailable due to encryption settings.": "Diese Funktion ist wegen der Verschlüsselungseinstellungen nicht verfügbar"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
3 changes: 2 additions & 1 deletion l10n/de_DE.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OC.L10N.register(
"Default editor theme": "Standardmäßiges Thema des Editors",
"Light": "Hell",
"Classic Light": "Klassisch Hell",
"Dark": "Dunkel"
"Dark": "Dunkel",
"This feature is unavailable due to encryption settings.": "Diese Funktion ist wegen der Verschlüsselungseinstellungen nicht verfügbar"
},
"nplurals=2; plural=(n != 1);");
3 changes: 2 additions & 1 deletion l10n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Default editor theme": "Standardmäßiges Thema des Editors",
"Light": "Hell",
"Classic Light": "Klassisch Hell",
"Dark": "Dunkel"
"Dark": "Dunkel",
"This feature is unavailable due to encryption settings.": "Diese Funktion ist wegen der Verschlüsselungseinstellungen nicht verfügbar"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
3 changes: 2 additions & 1 deletion l10n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OC.L10N.register(
"Default editor theme": "Tema del editor predeterminado",
"Light": "Claro",
"Classic Light": "Clásico claro",
"Dark": "Oscuro"
"Dark": "Oscuro",
"This feature is unavailable due to encryption settings.": "Esta característica no está disponible debido a la configuración de cifrado."
},
"nplurals=2; plural=(n != 1);");
3 changes: 2 additions & 1 deletion l10n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Default editor theme": "Tema del editor predeterminado",
"Light": "Claro",
"Classic Light": "Clásico claro",
"Dark": "Oscuro"
"Dark": "Oscuro",
"This feature is unavailable due to encryption settings.": "Esta característica no está disponible debido a la configuración de cifrado."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
3 changes: 2 additions & 1 deletion l10n/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OC.L10N.register(
"Default editor theme": "Thème d'éditeur par défaut",
"Light": "Clair",
"Classic Light": "Classique clair",
"Dark": "Sombre"
"Dark": "Sombre",
"This feature is unavailable due to encryption settings.": "Cette fonctionnalité n'est pas disponible en raison des paramètres de chiffrement."
},
"nplurals=2; plural=(n > 1);");
3 changes: 2 additions & 1 deletion l10n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Default editor theme": "Thème d'éditeur par défaut",
"Light": "Clair",
"Classic Light": "Classique clair",
"Dark": "Sombre"
"Dark": "Sombre",
"This feature is unavailable due to encryption settings.": "Cette fonctionnalité n'est pas disponible en raison des paramètres de chiffrement."
},"pluralForm" :"nplurals=2; plural=(n > 1);"
}
3 changes: 2 additions & 1 deletion l10n/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OC.L10N.register(
"Default editor theme": "Tema dell'editor predefinito",
"Light": "Chiaro",
"Classic Light": "Classico chiaro",
"Dark": "Scuro"
"Dark": "Scuro",
"This feature is unavailable due to encryption settings.": "Questa funzionalità non è disponibile a causa delle impostazioni di crittografia."
},
"nplurals=2; plural=(n != 1);");
3 changes: 2 additions & 1 deletion l10n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"Default editor theme": "Tema dell'editor predefinito",
"Light": "Chiaro",
"Classic Light": "Classico chiaro",
"Dark": "Scuro"
"Dark": "Scuro",
"This feature is unavailable due to encryption settings.": "Questa funzionalità non è disponibile a causa delle impostazioni di crittografia."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
Loading

0 comments on commit a88bc15

Please sign in to comment.