Skip to content

Commit

Permalink
Merge pull request #406 from ONLYOFFICE/release/1.6.0
Browse files Browse the repository at this point in the history
Release/1.6.0
  • Loading branch information
LinneyS authored Jun 29, 2023
2 parents 2a6e5e4 + 50a4ddb commit fcb8074
Show file tree
Hide file tree
Showing 133 changed files with 5,650 additions and 2,913 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: cs2pr, phpcs

- name: Run phpcs
run: phpcs -q --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor ./
run: |
phpcs --version
phpcs -q --extensions=php,module,inc,install,test,profile,theme,info --ignore=node_modules,bower_components,vendor,css,js,lib --standard=./ruleset.xml ./
51 changes: 51 additions & 0 deletions 3rd-Party.license
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,57 @@ jQuery.UI - jQuery UI is an open source library of interface components —
License: MIT
License File: jQuery.UI.license

JWT - JSON Web Token implementation (https://github.com/firebase/php-jwt/blob/master/LICENSE)
License: BSD-3-Clause
License File: jwt.license

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)
License: BSD-3-Clause
License File: PHP_CodeSniffer.license


web/documentserver-example/python

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)
License: BSD-3-Clause
License File: Django.license

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/)
License: MIT
License File: jQuery.license

jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license

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)
License: MIT
License File: jQuery.FileUpload.license

jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license

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)
License: OpenJS
License File: jQuery.Migrate.license

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/)
License: MIT
License File: jQuery.UI.license

PyJWT - A Python implementation of RFC 7519. (https://github.com/jpadilla/pyjwt/blob/master/LICENSE)
License: MIT
License File: PyJWT.license

python-magic - python-magic is a Python interface to the libmagic file type identification library. (https://github.com/ahupp/python-magic/blob/master/LICENSE)
License: MIT
License File: python-magic.license

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)
License: Apache 2.0
License File: requests.license


web/documentserver-example/python

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## 1.6.0
- nodejs: setUsers for region protection
- si skin languages
- fix "no" skin languages
- anonymous can't change viewer to edit
- referenceData
- anonymous can't protect file
- separate setting for checking the token in requests
- php: linter refactoring
- horizontal scroll fix for Internet Explorer
- save file with extension from response after conversation
- conversation to ooxml

## 1.5.1
- update jquery

Expand Down
4 changes: 2 additions & 2 deletions build/msbuild/zip.proj
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<RemoveDir Directories="$(To)" ContinueOnError="true" />

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

<ItemGroup>
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**;$(DirMvc)**\.git" />
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc).vs\**;$(DirMvc)bin\*.pdb;$(DirMvc)bin\*.xml;$(DirMvc)obj\**;$(DirMvc)packages\**;$(DirMvc)**\.git" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />
Expand Down
5 changes: 5 additions & 0 deletions web/documentserver-example/csharp-mvc/Content/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,8 @@
max-width:15%;
}
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.tableRow td:first-child{
max-width: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public static string CreateDemo(string fileExt, bool withContent)
var fileName = GetCorrectName(demoName); // get a file name with an index if the file with such a name already exists

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

return fileName;
}
Expand Down
28 changes: 17 additions & 11 deletions web/documentserver-example/csharp-mvc/Helpers/DocumentConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@ static ServiceConverter()
/// <param name="toExtension">Extension to which to convert</param>
/// <param name="documentRevisionId">Key for caching on service</param>
/// <param name="isAsync">Perform conversions asynchronously</param>
/// <param name="convertedDocumentUri">Uri to the converted document</param>
/// <param name="convertedDocumentData">Uri and file type of the converted document</param>
/// <returns>The percentage of conversion completion</returns>
/// <example>
/// string convertedDocumentUri;
/// GetConvertedUri("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentUri);
/// Dictionary<string, string> convertedDocumentData;
/// GetConvertedData("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentData);
/// </example>
/// <exception>
/// </exception>
public static int GetConvertedUri(string documentUri,
public static int GetConvertedData(string documentUri,
string fromExtension,
string toExtension,
string documentRevisionId,
bool isAsync,
out string convertedDocumentUri,
out Dictionary<string, string> convertedDocumentData,
string filePass = null,
string lang = null)
{
convertedDocumentUri = string.Empty;
convertedDocumentData = new Dictionary<string, string>();

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

if (JwtManager.Enabled)
if (JwtManager.Enabled && JwtManager.SignatureUseForRequest)
{
// create payload object
var payload = new Dictionary<string, object>
Expand Down Expand Up @@ -157,7 +157,7 @@ public static int GetConvertedUri(string documentUri,
}
}

return GetResponseUri(dataResponse, out convertedDocumentUri);
return GetResponseData(dataResponse, out convertedDocumentData);
}

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

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

int resultPercent;
responseUri = string.Empty;
responseData = new Dictionary<string, string>();
var responseUri = string.Empty;
var responseFileType = string.Empty;
if (isEndConvert) // if the conversion is completed
{
responseUri = responseFromService.fileUrl; // get the file url
responseFileType = responseFromService.fileType; // get the file type
responseData.Add("fileUrl", responseUri);
responseData.Add("fileType", responseFileType);
resultPercent = 100;
}
else // if the conversion isn't completed
{
responseData.Add("fileUrl", "");
resultPercent = responseFromService.percent; // get the percentage value
if (resultPercent >= 100) resultPercent = 99;
}
Expand Down
2 changes: 2 additions & 0 deletions web/documentserver-example/csharp-mvc/Helpers/JwtManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ public static class JwtManager
{
private static readonly string Secret;
public static readonly bool Enabled;
public static readonly bool SignatureUseForRequest;

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

// encode a payload object into a token using a secret key
Expand Down
Loading

0 comments on commit fcb8074

Please sign in to comment.