Skip to content

Commit fcb8074

Browse files
authored
Merge pull request #406 from ONLYOFFICE/release/1.6.0
Release/1.6.0
2 parents 2a6e5e4 + 50a4ddb commit fcb8074

File tree

133 files changed

+5650
-2913
lines changed

Some content is hidden

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

133 files changed

+5650
-2913
lines changed

.github/workflows/lint-php.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ jobs:
2222
- name: Setup PHP
2323
uses: shivammathur/setup-php@v2
2424
with:
25-
php-version: '8.1'
25+
php-version: '8.2'
2626
tools: cs2pr, phpcs
2727

2828
- name: Run phpcs
29-
run: phpcs -q --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor ./
29+
run: |
30+
phpcs --version
31+
phpcs -q --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor,css,js,lib --standard=./ruleset.xml ./

3rd-Party.license

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,57 @@ jQuery.UI - jQuery UI is an open source library of interface components —
274274
License: MIT
275275
License File: jQuery.UI.license
276276

277+
JWT - JSON Web Token implementation (https://github.com/firebase/php-jwt/blob/master/LICENSE)
278+
License: BSD-3-Clause
279+
License File: jwt.license
280+
281+
PHP_CodeSniffer - PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent. (https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt)
282+
License: BSD-3-Clause
283+
License File: PHP_CodeSniffer.license
284+
285+
286+
web/documentserver-example/python
287+
288+
Django - Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Thanks for checking it out. (https://github.com/django/django/blob/main/LICENSE)
289+
License: BSD-3-Clause
290+
License File: Django.license
291+
292+
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
293+
License: MIT
294+
License File: jQuery.license
295+
296+
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
297+
License: MIT, GPL
298+
License File: jQuery.BlockUI.license
299+
300+
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
301+
License: MIT
302+
License File: jQuery.FileUpload.license
303+
304+
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
305+
License: MIT
306+
License File: jQuery.iframe-transport.license
307+
308+
jQuery.Migrate - Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used. (https://github.com/jquery/jquery-migrate/blob/main/LICENSE.txt)
309+
License: OpenJS
310+
License File: jQuery.Migrate.license
311+
312+
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
313+
License: MIT
314+
License File: jQuery.UI.license
315+
316+
PyJWT - A Python implementation of RFC 7519. (https://github.com/jpadilla/pyjwt/blob/master/LICENSE)
317+
License: MIT
318+
License File: PyJWT.license
319+
320+
python-magic - python-magic is a Python interface to the libmagic file type identification library. (https://github.com/ahupp/python-magic/blob/master/LICENSE)
321+
License: MIT
322+
License File: python-magic.license
323+
324+
requests - Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method! (https://github.com/psf/requests/blob/main/LICENSE)
325+
License: Apache 2.0
326+
License File: requests.license
327+
277328

278329
web/documentserver-example/python
279330

CHANGELOG.md

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

3+
## 1.6.0
4+
- nodejs: setUsers for region protection
5+
- si skin languages
6+
- fix "no" skin languages
7+
- anonymous can't change viewer to edit
8+
- referenceData
9+
- anonymous can't protect file
10+
- separate setting for checking the token in requests
11+
- php: linter refactoring
12+
- horizontal scroll fix for Internet Explorer
13+
- save file with extension from response after conversation
14+
- conversation to ooxml
15+
316
## 1.5.1
417
- update jquery
518

build/msbuild/zip.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
<RemoveDir Directories="$(To)" ContinueOnError="true" />
2727

2828
<ItemGroup>
29-
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)obj\**;$(DirCSharp)**\.git" />
29+
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp).vs\**;$(DirCSharp)bin\*.pdb;$(DirCSharp)bin\*.xml;$(DirCSharp)obj\**;$(DirCSharp)packages\**;$(DirCSharp)**\.git" />
3030
</ItemGroup>
3131
<Copy SourceFiles="@(ZipFilesCSharp)" DestinationFiles="@(ZipFilesCSharp->'$(NameCSharp)\%(RecursiveDir)%(Filename)%(Extension)')" />
3232
<Zip Files="$(NameCSharp)" WorkingDirectory="$(To)" ZipFileName="$(NameCSharp).zip" />
3333

3434
<ItemGroup>
35-
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**;$(DirMvc)**\.git" />
35+
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc).vs\**;$(DirMvc)bin\*.pdb;$(DirMvc)bin\*.xml;$(DirMvc)obj\**;$(DirMvc)packages\**;$(DirMvc)**\.git" />
3636
</ItemGroup>
3737
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
3838
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />

web/documentserver-example/csharp-mvc/Content/media.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,8 @@
682682
max-width:15%;
683683
}
684684
}
685+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
686+
.tableRow td:first-child{
687+
max-width: none;
688+
}
689+
}

web/documentserver-example/csharp-mvc/Helpers/DocManagerHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public static string CreateDemo(string fileExt, bool withContent)
220220
var fileName = GetCorrectName(demoName); // get a file name with an index if the file with such a name already exists
221221

222222
File.Copy(HttpRuntime.AppDomainAppPath + demoPath + demoName, StoragePath(fileName)); // copy file to the storage directory
223+
File.SetLastWriteTime(StoragePath(fileName), DateTime.Now);
223224

224225
return fileName;
225226
}

web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,24 @@ static ServiceConverter()
6868
/// <param name="toExtension">Extension to which to convert</param>
6969
/// <param name="documentRevisionId">Key for caching on service</param>
7070
/// <param name="isAsync">Perform conversions asynchronously</param>
71-
/// <param name="convertedDocumentUri">Uri to the converted document</param>
71+
/// <param name="convertedDocumentData">Uri and file type of the converted document</param>
7272
/// <returns>The percentage of conversion completion</returns>
7373
/// <example>
74-
/// string convertedDocumentUri;
75-
/// GetConvertedUri("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentUri);
74+
/// Dictionary<string, string> convertedDocumentData;
75+
/// GetConvertedData("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentData);
7676
/// </example>
7777
/// <exception>
7878
/// </exception>
79-
public static int GetConvertedUri(string documentUri,
79+
public static int GetConvertedData(string documentUri,
8080
string fromExtension,
8181
string toExtension,
8282
string documentRevisionId,
8383
bool isAsync,
84-
out string convertedDocumentUri,
84+
out Dictionary<string, string> convertedDocumentData,
8585
string filePass = null,
8686
string lang = null)
8787
{
88-
convertedDocumentUri = string.Empty;
88+
convertedDocumentData = new Dictionary<string, string>();
8989

9090
// check if the fromExtension parameter is defined; if not, get it from the document url
9191
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri).ToLower() : fromExtension;
@@ -119,7 +119,7 @@ public static int GetConvertedUri(string documentUri,
119119
{ "region", lang }
120120
};
121121

122-
if (JwtManager.Enabled)
122+
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
123123
{
124124
// create payload object
125125
var payload = new Dictionary<string, object>
@@ -157,7 +157,7 @@ public static int GetConvertedUri(string documentUri,
157157
}
158158
}
159159

160-
return GetResponseUri(dataResponse, out convertedDocumentUri);
160+
return GetResponseData(dataResponse, out convertedDocumentData);
161161
}
162162

163163
/// <summary>
@@ -181,9 +181,9 @@ public static string GenerateRevisionId(string expectedKey)
181181
/// Processing document received from the editing service
182182
/// </summary>
183183
/// <param name="jsonDocumentResponse">The resulting json from editing service</param>
184-
/// <param name="responseUri">Uri to the converted document</param>
184+
/// <param name="responseData">Uri and file type of the converted document</param>
185185
/// <returns>The percentage of conversion completion</returns>
186-
private static int GetResponseUri(string jsonDocumentResponse, out string responseUri)
186+
private static int GetResponseData(string jsonDocumentResponse, out Dictionary<string, string> responseData)
187187
{
188188
if (string.IsNullOrEmpty(jsonDocumentResponse)) throw new ArgumentException("Invalid param", "jsonDocumentResponse");
189189

@@ -197,14 +197,20 @@ private static int GetResponseUri(string jsonDocumentResponse, out string respon
197197
var isEndConvert = responseFromService.endConvert;
198198

199199
int resultPercent;
200-
responseUri = string.Empty;
200+
responseData = new Dictionary<string, string>();
201+
var responseUri = string.Empty;
202+
var responseFileType = string.Empty;
201203
if (isEndConvert) // if the conversion is completed
202204
{
203205
responseUri = responseFromService.fileUrl; // get the file url
206+
responseFileType = responseFromService.fileType; // get the file type
207+
responseData.Add("fileUrl", responseUri);
208+
responseData.Add("fileType", responseFileType);
204209
resultPercent = 100;
205210
}
206211
else // if the conversion isn't completed
207212
{
213+
responseData.Add("fileUrl", "");
208214
resultPercent = responseFromService.percent; // get the percentage value
209215
if (resultPercent >= 100) resultPercent = 99;
210216
}

web/documentserver-example/csharp-mvc/Helpers/JwtManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ public static class JwtManager
2929
{
3030
private static readonly string Secret;
3131
public static readonly bool Enabled;
32+
public static readonly bool SignatureUseForRequest;
3233

3334
static JwtManager()
3435
{
3536
Secret = WebConfigurationManager.AppSettings["files.docservice.secret"] ?? ""; // get token secret from the config parameters
3637
Enabled = !string.IsNullOrEmpty(Secret); // check if the token is enabled
38+
SignatureUseForRequest = bool.Parse(WebConfigurationManager.AppSettings["files.docservice.token.useforrequest"]);
3739
}
3840

3941
// encode a payload object into a token using a secret key

0 commit comments

Comments
 (0)