Compare commits

..

5 Commits

Author SHA1 Message Date
c4de5afd4b java-raw: inner 2025-07-07 15:52:44 +03:00
f6e04d5ab9 java-raw: set config 2025-07-07 15:52:43 +03:00
925c6e96fc java-raw: add custom cors 2025-07-07 15:52:30 +03:00
bf873519de java-raw: idk project file 2025-07-07 15:52:29 +03:00
0df41b9e36 java-raw: add docker files 2025-07-07 15:52:29 +03:00
95 changed files with 548 additions and 719 deletions

View File

@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.10'
go-version: '1.21'
- name: Lint Golangci
run: |

View File

@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v*'
permissions:
contents: write

1
.gitmodules vendored
View File

@ -5,7 +5,6 @@
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
path = web/documentserver-example/nodejs/public/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = feature/v9.1
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates

View File

@ -505,7 +505,7 @@ jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rail
License: MIT
License File: jquery-rails.license
mimemagic - A library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
mimemagic - А library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
License: MIT
License File: mimemagic.license

View File

@ -1,17 +1,12 @@
# Change Log
- nodejs: formats for ds v9.1
## 1.15.0
- php-laravel: fix custom jwt header
- user role
- start filling
- update demo files
- set users by parts
- open the conversion dialog box with a gray check mark on the type selection step
- preload frame moved from uploading popup
- preload frame moved from uploading popap
- change tab title on rename
- change uploaded file name in popup if converted
- change uploaded file name in popap if converted
- php-laravel: fix custom jwt header
- features tips for anonymous
- view odg, md
- edit xlsb
@ -19,7 +14,7 @@
## 1.14.0
- nodejs: set users by parts
- nodejs: preload frame moved from uploading popup
- nodejs: preload frame moved from uploading popap
- nodejs: view odg, md
- nodejs: edit xlsb
- nodejs: support vsdx in diagram editor

View File

@ -33,9 +33,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"This file isn't marked as favorite",
"Can create files from templates using data from the editor",
"Has an avatar",
"Can submit forms",
"Has no roles",
"Can start filling"
"Can submit forms"
};
static List<string> descr_user_2 = new List<string>()
@ -47,9 +45,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"This file is marked as favorite",
"Can create new files from the editor",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling"
"Can't submit forms"
};
static List<string> descr_user_3 = new List<string>()
@ -65,9 +61,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"Can create new files from the editor",
"Can't submit forms",
"Can't close history",
"Can't restore the file version",
"Has role 'role'",
"Can start filling"
"Can't restore the file version"
};
static List<string> descr_user_0 = new List<string>()
@ -86,9 +80,7 @@ namespace OnlineEditorsExampleMVC.Helpers
"View file without collaboration",
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling"
"Tour of tips when opening a document"
};
private static List<User> users = new List<User>() {
@ -106,8 +98,7 @@ namespace OnlineEditorsExampleMVC.Helpers
true,
true,
new Goback(null, false),
new Close(null, false),
null
new Close(null, false)
),
new User(
"uid-2",
@ -128,8 +119,7 @@ namespace OnlineEditorsExampleMVC.Helpers
false,
true,
new Goback("Go to Documents", null),
new Close(null, true),
new List<string>() { "Anyone" }
new Close(null, true)
),
new User(
"uid-3",
@ -150,8 +140,7 @@ namespace OnlineEditorsExampleMVC.Helpers
false,
false,
null,
new Close(null, true),
new List<string>() { "role" }
new Close(null, true)
),
new User(
"uid-0",
@ -167,8 +156,7 @@ namespace OnlineEditorsExampleMVC.Helpers
false,
false,
null,
null,
new List<string>()
null
)
};
@ -261,9 +249,8 @@ namespace OnlineEditorsExampleMVC.Helpers
public Goback goback;
public Close close;
public List<string> roles;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close, List<string> roles)
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
{
this.id = id;
this.name = name;
@ -279,7 +266,6 @@ namespace OnlineEditorsExampleMVC.Helpers
this.avatar = avatar;
this.goback = goback;
this.close = close;
this.roles = roles;
}
}

View File

@ -190,7 +190,6 @@ namespace OnlineEditorsExampleMVC.Models
{
{ "id", !user.id.Equals("uid-0") ? user.id : null },
{ "name", user.name },
{ "roles", user.roles },
{ "group", user.group },
{ "image", user.avatar ? DocManagerHelper.GetServerUrl(false) + "/Content/images/" + user.id + ".png" : null}
}

View File

@ -24,7 +24,7 @@ where the **documentserver** is the name of the server with the ONLYOFFICE Docum
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/docs/docs-api/usage-api/advanced-parameters/) in the *DocEditor.aspx* file.
## Step 3. Install the prerequisites
Check if your system meets the system requirements:
Сheck if your system meets the system requirements:
* **Microsoft .NET Framework**: version 4.5 (download it from the [official Microsoft website](https://www.microsoft.com/en-US/download/details.aspx?id=30653));
* **Internet Information Services**: version 7 or later.

View File

@ -397,18 +397,6 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
config = <%= Model.GetDocConfig(Request, Url) %>;
config.width = "100%";
@ -429,8 +417,6 @@
if (config.editorConfig.user.id) {
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestClose'] = onRequestClose;
// the user is trying to show the document version history
config.events['onRequestHistory'] = onRequestHistory;
@ -462,7 +448,7 @@
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
}
var connectEditor = function () {
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
@ -474,9 +460,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -154,18 +154,13 @@
</menu>
<% var storedFiles = DocManagerHelper.GetStoredFiles(); %>
<div id="portal-info" style="display: <%= storedFiles.Any() ? "none" : "table-cell" %>">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% foreach (User user in Users.getAllUsers())
{ %>
<div class="user-descr" onclick="toggleUserDescr(event)">

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<appSettings>
<clear />
<add key="version" value="1.15.0"/>
<add key="version" value="1.14.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>

View File

@ -156,18 +156,13 @@
<% } %>
</menu>
<div id="portal-info" style="display: <%= storedFiles.Any() ? "none" : "table-cell" %>">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% foreach (User user in Users.getAllUsers())
{ %>
<div class="user-descr" onclick="toggleUserDescr(event)">

View File

@ -362,18 +362,6 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
config = <%= DocConfig %>;
config.width = "100%";
@ -395,8 +383,6 @@
if (config.editorConfig.user.id) {
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
let xhr = new XMLHttpRequest();
@ -462,7 +448,7 @@
config.events['onRequestReferenceSource'] = onRequestReferenceSource;
}
var connectEditor = function () {
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
@ -474,9 +460,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -257,7 +257,6 @@ namespace OnlineEditorsExample
{
{ "id", !user.id.Equals("uid-0") ? user.id : null },
{ "name", user.name },
{ "roles", user.roles },
{ "group", user.group },
{ "image", user.avatar ? _Default.GetServerUrl(false) + "/App_Themes/images/"+ user.id + ".png" : null }
}

View File

@ -32,9 +32,7 @@ namespace OnlineEditorsExample
"This file isn't marked as favorite",
"Can create files from templates using data from the editor",
"Has an avatar",
"Can submit forms",
"Has no roles",
"Can start filling"
"Can submit forms"
};
static List<string> descr_user_2 = new List<string>()
@ -46,9 +44,7 @@ namespace OnlineEditorsExample
"This file is marked as favorite",
"Can create new files from the editor",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling"
"Can't submit forms"
};
static List<string> descr_user_3 = new List<string>()
@ -64,9 +60,7 @@ namespace OnlineEditorsExample
"Can create new files from the editor",
"Can't close history",
"Can't restore the file version",
"Can't submit forms",
"Has role 'role'",
"Can start filling"
"Can't submit forms"
};
static List<string> descr_user_0 = new List<string>()
@ -85,9 +79,7 @@ namespace OnlineEditorsExample
"View file without collaboration",
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling"
"Tour of tips when opening a document"
};
private static List<User> users = new List<User>() {
@ -105,8 +97,7 @@ namespace OnlineEditorsExample
true,
true,
new Goback(null, false),
new Close(null, false),
null
new Close(null, false)
),
new User(
"uid-2",
@ -127,8 +118,7 @@ namespace OnlineEditorsExample
false,
true,
new Goback("Go to Documents",null),
new Close(null, true),
new List<string>() { "Anyone" }
new Close(null, true)
),
new User(
"uid-3",
@ -149,8 +139,7 @@ namespace OnlineEditorsExample
false,
false,
null,
new Close(null, true),
new List<string>() { "role" }
new Close(null, true)
),
new User(
"uid-0",
@ -166,8 +155,7 @@ namespace OnlineEditorsExample
false,
false,
null,
null,
new List<string>()
null
)
};
@ -261,9 +249,8 @@ namespace OnlineEditorsExample
public bool avatar;
public Goback goback;
public Close close;
public List<string> roles;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close, List<string> roles)
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
{
this.id = id;
this.name = name;
@ -279,7 +266,6 @@ namespace OnlineEditorsExample
this.avatar = avatar;
this.goback = goback;
this.close = close;
this.roles = roles;
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<clear />
<add key="version" value="1.15.0"/>
<add key="version" value="1.14.0"/>
<add key="filesize-max" value="52428800"/>
<add key="storage-path" value=""/>

View File

@ -1,5 +1,5 @@
{
"VERSION": "1.15.0",
"VERSION": "1.14.0",
"SERVER_ADDRESS" : "",
"SERVER_PORT" : 3000,

View File

@ -1,9 +1,9 @@
module github.com/ONLYOFFICE/document-server-integration
go 1.23.10
go 1.21
require (
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/gorilla/mux v1.8.1
github.com/gorilla/schema v1.4.1
github.com/mitchellh/mapstructure v1.5.0

View File

@ -6,8 +6,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=

View File

@ -27,7 +27,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
)
func (srv *DefaultServerEndpointsHandler) Config(w http.ResponseWriter, r *http.Request) {
@ -73,9 +73,9 @@ func (srv *DefaultServerEndpointsHandler) Config(w http.ResponseWriter, r *http.
),
Mode: "edit",
},
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * srv.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * srv.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}

View File

@ -29,7 +29,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
)
func (srv *DefaultServerEndpointsHandler) Reference(w http.ResponseWriter, r *http.Request) {
@ -97,9 +97,9 @@ func (srv *DefaultServerEndpointsHandler) Reference(w http.ResponseWriter, r *ht
},
Link: remoteAddr + "/editor?filename=" + url.QueryEscape(fileName),
Path: fileName,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * srv.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * srv.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}

View File

@ -22,7 +22,7 @@ import (
"net/http"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
)
type DocumentManager interface {

View File

@ -27,7 +27,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/config"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
)
type DefaultCommandManager struct {
@ -40,13 +40,13 @@ type CommandPayload struct {
Key string `json:"key"`
Meta interface{} `json:"meta"`
Token string `json:"token"`
jwt.RegisteredClaims
jwt.StandardClaims
}
type CommandRequestHeaderPayload struct {
Query map[string]string `json:"query"`
Payload CommandPayload `json:"payload"`
jwt.RegisteredClaims
jwt.StandardClaims
}
func NewDefaultCommandManager(config config.ApplicationConfig, jmanager managers.JwtManager) managers.CommandManager {
@ -60,9 +60,9 @@ func (cm DefaultCommandManager) CommandRequest(method string, docKey string, met
payload := CommandPayload{
C: method,
Key: docKey,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}
if meta != nil {
@ -119,9 +119,9 @@ func fillJwtByUrl(uri string, payload CommandPayload, config config.ApplicationC
return CommandRequestHeaderPayload{
Query: queryMap,
Payload: payload,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}
}

View File

@ -30,7 +30,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
"go.uber.org/zap"
)
@ -115,9 +115,9 @@ func (cm DefaultConversionManager) GetConverterUri(
Title: title,
Key: docKey,
Async: isAsync,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}
@ -128,9 +128,9 @@ func (cm DefaultConversionManager) GetConverterUri(
if secret != "" && cm.config.JwtEnabled {
headerPayload := managers.ConvertRequestHeaderPayload{
Payload: payload,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * cm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * cm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}
headerToken, err = cm.JwtManager.JwtSign(headerPayload, []byte(secret))

View File

@ -28,7 +28,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/utils"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
"go.uber.org/zap"
)
@ -227,9 +227,9 @@ func (dm DefaultDocumentManager) BuildDocumentConfig(
},
},
},
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * dm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * dm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}

View File

@ -30,7 +30,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/ONLYOFFICE/document-server-integration/server/shared"
"github.com/ONLYOFFICE/document-server-integration/utils"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
"go.uber.org/zap"
)
@ -197,9 +197,9 @@ func (hm DefaultHistoryManager) fetchNextHistoryEntry(
Key: key,
Url: url,
Version: version,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * hm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * hm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}
}
@ -267,9 +267,9 @@ func (hm DefaultHistoryManager) GetHistory(
Url: hm.StorageManager.GeneratePublicFileUri(filename, remoteAddress, managers.FileMeta{}),
Version: version,
ChangesUrl: changesUrl,
RegisteredClaims: jwt.RegisteredClaims{
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Minute * hm.config.JwtExpiresIn)),
IssuedAt: jwt.NewNumericDate(time.Now()),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Minute * hm.config.JwtExpiresIn).Unix(),
IssuedAt: time.Now().Unix(),
},
}

View File

@ -24,7 +24,7 @@ import (
"github.com/ONLYOFFICE/document-server-integration/config"
"github.com/ONLYOFFICE/document-server-integration/server/managers"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
"github.com/mitchellh/mapstructure"
"go.uber.org/zap"
)

View File

@ -45,7 +45,6 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
Avatar: false,
Goback: nil,
Close: nil,
Roles: []string{},
},
{
Id: "uid-1",
@ -66,7 +65,6 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
Close: map[string]interface{}{
"visible": false,
},
Roles: nil,
},
{
Id: "uid-2",
@ -91,7 +89,6 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
Close: map[string]interface{}{
"visible": true,
},
Roles: []string{"Anyone"},
},
{
Id: "uid-3",
@ -114,7 +111,6 @@ func NewDefaultUserManager(logger *zap.SugaredLogger) managers.UserManager {
Close: map[string]interface{}{
"visible": true,
},
Roles: []string{"role"},
},
}
return &DefaultUserManager{
@ -139,8 +135,6 @@ var descriptionUser0 []string = []string{
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling",
}
var descriptionUser1 []string = []string{
"File author by default",
@ -152,8 +146,6 @@ var descriptionUser1 []string = []string{
"Can create files from templates using data from the editor",
"Can submit forms",
"Has an avatar",
"Has no roles",
"Can start filling",
}
var descriptionUser2 []string = []string{
"Belongs to Group2",
@ -164,8 +156,6 @@ var descriptionUser2 []string = []string{
"Can create new files from the editor",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling",
}
var descriptionUser3 []string = []string{
"Belongs to Group3",
@ -180,8 +170,6 @@ var descriptionUser3 []string = []string{
"Can't close history",
"Can't restore the file version",
"Can't submit forms",
"Has role 'role'",
"Can start filling",
}
func (um DefaultUserManager) GetUsers() []models.User {
@ -210,7 +198,6 @@ func (um DefaultUserManager) GetUserInfoById(uid string, serverAddress string) m
return models.UserInfo{
Id: user.Id,
Name: user.Username,
Roles: user.Roles,
Email: user.Email,
Image: image,
}

View File

@ -21,7 +21,7 @@ import (
"errors"
"github.com/ONLYOFFICE/document-server-integration/server/models"
"github.com/golang-jwt/jwt/v5"
"github.com/golang-jwt/jwt"
)
var ErrInvalidFilename = errors.New("invalid filename")
@ -39,7 +39,7 @@ type HistorySet struct {
Url string `json:"url"`
Version int `json:"version"`
Token string `json:"token,omitempty"`
jwt.RegisteredClaims
jwt.StandardClaims
}
type HistoryPrevious struct {
@ -99,10 +99,10 @@ type ConvertRequestPayload struct {
Key string `json:"key"`
Async bool `json:"async"`
JwtToken string `json:"token,omitempty"`
jwt.RegisteredClaims
jwt.StandardClaims
}
type ConvertRequestHeaderPayload struct {
Payload ConvertRequestPayload `json:"payload"`
jwt.RegisteredClaims
jwt.StandardClaims
}

View File

@ -17,7 +17,7 @@
*/
package models
import "github.com/golang-jwt/jwt/v5"
import "github.com/golang-jwt/jwt"
type Command int
@ -38,9 +38,9 @@ func (c Command) Ordinal() int {
}
type CommandBody struct {
Command string `json:"c"`
Token string `json:"token,omitempty"`
jwt.RegisteredClaims `json:"-"`
Command string `json:"c"`
Token string `json:"token,omitempty"`
jwt.StandardClaims `json:"-"`
}
type CommandResponse struct {

View File

@ -17,7 +17,7 @@
*/
package models
import "github.com/golang-jwt/jwt/v5"
import "github.com/golang-jwt/jwt"
type Config struct {
Type string `json:"type"`
@ -25,5 +25,5 @@ type Config struct {
DocumentType string `json:"documentType"`
EditorConfig EditorConfig `json:"editorConfig"`
Token string `json:"token,omitempty"`
jwt.RegisteredClaims
jwt.StandardClaims
}

View File

@ -17,7 +17,7 @@
*/
package models
import "github.com/golang-jwt/jwt/v5"
import "github.com/golang-jwt/jwt"
type ReferenceData struct {
FileKey string `json:"fileKey"`
@ -32,5 +32,5 @@ type Reference struct {
Key string `json:"key"`
Url string `json:"url"`
Token string `json:"token,omitempty"`
jwt.RegisteredClaims
jwt.StandardClaims
}

View File

@ -32,13 +32,11 @@ type User struct {
Avatar bool `json:"avatar"`
Goback map[string]interface{} `json:"goback"`
Close map[string]interface{} `json:"close"`
Roles []string `json:"roles"`
}
type UserInfo struct {
Id string `json:"id"`
Name string `json:"name"`
Roles []string `json:"roles"`
Email string `json:"email"`
Image string `json:"image"`
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Image string `json:"image"`
}

View File

@ -404,18 +404,6 @@
innerAlert(xhr.responseText);
docEditor.refreshFile(JSON.parse(xhr.responseText));
};
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
var events = {
@ -436,8 +424,6 @@
if (config.editorConfig.user.id !== "uid-0") {
events["onRequestRefreshFile"] = onRequestRefreshFile;
events['onRequestStartFilling'] = onRequestStartFilling;
events['onStartFilling'] = onStartFilling;
events["onRequestClose"] = onRequestClose;
events["onRequestSendNotify"] = onRequestSendNotify;
events["onRequestEditRights"] = onRequestEditRights;

View File

@ -146,18 +146,13 @@
{{ else }}
<div id="portal-info" style="display: table-cell">
{{ end }}
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
{{ range .Users }}
<div class="user-descr" onclick="toggleUserDescr(event)">
<b>{{ if eq .Username "" }} Anonymous {{ else }} {{ .Username }} {{ end }}</b>

View File

@ -59,7 +59,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.15.0</version>
<version>2.13.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@ -84,7 +84,7 @@
<dependency>
<groupId>com.onlyoffice</groupId>
<artifactId>docs-integration-sdk</artifactId>
<version>1.6.0</version>
<version>1.4.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>

View File

@ -51,9 +51,7 @@ public class ExampleData {
"View file without collaboration",
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling"
"Tour of tips when opening a document"
);
// the description for user 1
@ -67,9 +65,7 @@ public class ExampleData {
"Can create a file from a template with data from the editor",
"Can view chat",
"Has an avatar",
"Can submit forms",
"Has no roles",
"Can start filling"
"Can submit forms"
);
// the description for user 2
@ -84,9 +80,7 @@ public class ExampleData {
"Can create a file from an editor",
"Can view chat",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling"
"Can't submit forms"
);
// the description for user 3
@ -104,9 +98,7 @@ public class ExampleData {
"Can view chat",
"Can't close history",
"Can't restore the file version",
"Can't submit forms",
"Has role 'role'",
"Can start filling"
"Can't submit forms"
);
// create user 1 with the specified parameters
@ -114,24 +106,24 @@ public class ExampleData {
"", List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), false, true, true, true,
new Goback(null, false), new Close(null, false), null, true);
new Goback(null, false), new Close(null, false), true);
// create user 2 with the specified parameters
userService.createUser("Mark Pottato", "pottato@example.com", descriptionUserSecond,
"group-2", List.of("", "group-2"), List.of(FilterState.NULL.toString()),
List.of("group-2", ""), List.of("group-2"), List.of("group-2", ""), true, true,
true, true, new Goback("Go to Documents", null), new Close(null, true), List.of("Anyone"), false);
true, true, new Goback("Go to Documents", null), new Close(null, true), false);
// create user 3 with the specified parameters
userService.createUser("Hamish Mitchell", null, descriptionUserThird,
"group-3", List.of("group-2"), List.of("group-2", "group-3"), List.of("group-2"),
new ArrayList<>(), List.of("group-2"), null, true, true, false,
null, new Close(null, true), List.of("role"), false);
null, new Close(null, true), false);
// create user 0 with the specified parameters
userService.createUser("Anonymous", null, descriptionUserZero, "",
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
List.of(FilterState.NULL.toString()), List.of(FilterState.NULL.toString()),
new ArrayList<>(), null, false, false, false, null, null, new ArrayList<>(), false);
new ArrayList<>(), null, false, false, false, null, null, false);
}
}

View File

@ -49,7 +49,4 @@ public class User extends AbstractEntity {
private String image;
private Goback goback;
private Close close;
@ElementCollection
@CollectionTable(name = "user_roles")
private List<String> roles;
}

View File

@ -215,7 +215,6 @@ public class ConfigServiceImpl extends DefaultConfigService implements ConfigSer
.id(String.valueOf(appUser.getId()))
.name(appUser.getName())
.group(appUser.getGroup().getName())
.roles(appUser.getRoles())
.build();
if (appUser.getAvatar()) {

View File

@ -68,7 +68,6 @@ public class UserServices {
final Boolean avatar,
final Goback goback,
final Close close,
final List<String> roles,
final Boolean submitForm) {
User newUser = new User();
newUser.setName(name); // set the user name
@ -103,8 +102,6 @@ public class UserServices {
newUser.setClose(close);
newUser.setRoles(roles);
userRepository.save(newUser); // save a new user
return newUser;

View File

@ -1,4 +1,4 @@
server.version=1.15.0
server.version=1.14.0
server.address=
server.port=4000

View File

@ -391,17 +391,6 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
config.width = "100%";
config.height = "100%";
config.events = {
@ -418,8 +407,6 @@
};
if (config.editorConfig.user.id != 4) {
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
// add mentions for not anonymous users
@ -442,7 +429,7 @@
}
}
var connectEditor = function () {
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
@ -454,9 +441,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -130,18 +130,13 @@
</li>
</menu>
<div id="portal-info" th:attr="tooltip=${tooltip}" th:style="${not #lists.isEmpty(files)} ? 'display: none' : 'display: table-cell' ">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
</div>
<th:block th:if="${not #lists.isEmpty(files)}">
<div class="stored-list">

View File

@ -1,23 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OnlineEditorsExampleJava</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<name>OnlineEditorsExampleJava</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1690280351006</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@ -1,8 +1,22 @@
FROM maven:3.6.1-jdk-8-alpine AS MVN_BLDR
COPY ./ /tmp/
WORKDIR /tmp/
# FROM maven:3.9.3-eclipse-temurin-11-alpine AS example-build
# WORKDIR /srv
# COPY . .
# RUN mvn package
FROM maven:3.6.1-jdk-8-alpine AS example-build
WORKDIR /srv
COPY . .
RUN mvn package
FROM tomcat:alpine
RUN rm -fr /usr/local/tomcat/webapps/ROOT
COPY --from=MVN_BLDR /tmp/target/*.war $CATALINA_HOME/webapps/ROOT.war
# no main manifest attribute, in example.war
# FROM eclipse-temurin:11-jdk-alpine AS example
# WORKDIR /srv
# COPY --from=example-build /srv/target/*.war example.war
# CMD ["java", "-jar", "example.war"]
FROM tomcat:9.0.20-jre8-alpine AS example
RUN rm -rf /usr/local/tomcat/webapps/ROOT
COPY --from=example-build /srv/target/*.war $CATALINA_HOME/webapps/ROOT.war
FROM nginx:1.23.4-alpine3.17 AS proxy
COPY proxy/nginx.conf /etc/nginx/nginx.conf

View File

@ -1,9 +1,31 @@
version: '3'
version: "3.8"
services:
java-intg-ex:
build:
context: ./
dockerfile: Dockerfile
ports:
- 8080:8080
document-server:
container_name: document-server
image: onlyoffice/documentserver:7.3.3.50
expose:
- "80"
environment:
- JWT_SECRET=your-256-bit-secret
example:
container_name: example
build:
context: .
target: example
# platform: linux/amd64
expose:
# - "80"
- "8080"
proxy:
container_name: proxy
build:
context: .
target: proxy
ports:
# - "80:80"
# - "8080:8080"
- "8080:8080"
- "3000:3000"

View File

@ -14,18 +14,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.19.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
@ -41,7 +29,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.13.1</version>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>com.inversoft</groupId>

View File

@ -0,0 +1,41 @@
worker_processes auto;
events {
worker_connections 512;
}
http {
include /etc/nginx/mime.types;
server {
# listen 80;
listen 8080;
server_name localhost;
location / {
proxy_http_version 1.1;
# proxy_pass http://example;
proxy_pass http://example:8080;
}
}
server {
# listen 8080;
listen 3000;
server_name localhost;
location / {
client_max_body_size 100m;
proxy_http_version 1.1;
proxy_pass http://document-server;
proxy_redirect off;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_x_forwarded_host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Real-IP $remote_addr;
}
}
}

View File

@ -0,0 +1,59 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package controllers;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CorsFilter implements Filter {
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
}
@Override
public void destroy() {
}
@Override
public void doFilter(final ServletRequest request,
final ServletResponse response,
final FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Credentials", "false");
res.setHeader("Access-Control-Allow-Methods", "*");
res.setHeader("Access-Control-Allow-Headers", "*");
if ("OPTIONS".equalsIgnoreCase(req.getMethod())) {
res.setStatus(HttpServletResponse.SC_OK);
} else {
filterChain.doFilter(request, response);
}
}
}

View File

@ -110,7 +110,6 @@ public class FileModel {
// write user information to the config (id, name and group)
editorConfig.getUser().setId(!user.getId().equals("uid-0") ? user.getId() : null);
editorConfig.getUser().setName(user.getName());
editorConfig.getUser().setRoles(user.getRoles());
editorConfig.getUser().setGroup(user.getGroup());
editorConfig.getUser().setImage(user.getAvatar() ? DocumentManager.getServerUrl(false)
+ "/css/img/" + user.getId() + ".png" : null);
@ -305,7 +304,7 @@ public class FileModel {
public Permissions(final String modeParam, final String typeParam, final Boolean canEdit, final User user) {
comment = !modeParam.equals("view") && !modeParam.equals("fillForms") && !modeParam.equals("embedded")
&& !modeParam.equals("blockcontent");
copy = !user.getDeniedPermissions().contains("copy");
copy = !user.getDeniedPermissions().contains("сopy");
download = !user.getDeniedPermissions().contains("download");
edit = canEdit && (modeParam.equals("edit") || modeParam.equals("view") || modeParam.equals("filter")
|| modeParam.equals("blockcontent"));
@ -541,7 +540,6 @@ public class FileModel {
public class User {
private String id;
private String name;
private List<String> roles;
private String group;
private String image;
@ -572,10 +570,6 @@ public class FileModel {
public void setImage(final String imageParam) {
this.image = imageParam;
}
public void setRoles(final List<String> rolesParam) {
this.roles = rolesParam;
}
}
// customization parameters

View File

@ -35,14 +35,13 @@ public class User {
private final Boolean avatar;
private final Goback goback;
private final Close close;
private final List<String> roles;
public User(final String idParam, final String nameParam, final String emailParam, final String groupParam,
final List<String> reviewGroupsParam, final CommentGroups commentGroupsParam,
final List<String> userInfoGroupsParam, final Boolean favoriteParam,
final List<String> deniedPermissionsParam, final List<String> descriptionsParam,
final Boolean templatesParam, final Boolean avatarParam, final Goback gobackParam,
final Close closeParam, final List<String> rolesParam) {
final Close closeParam) {
this.id = idParam;
this.name = nameParam;
this.email = emailParam;
@ -57,7 +56,6 @@ public class User {
this.avatar = avatarParam;
this.goback = gobackParam;
this.close = closeParam;
this.roles = rolesParam;
}
public String getId() {
@ -115,8 +113,4 @@ public class User {
public Close getClose() {
return close;
}
public List<String> getRoles() {
return roles;
}
}

View File

@ -137,10 +137,24 @@ public final class TrackManager {
return body;
}
public static JSONObject resolveProcessSaveBody(final JSONObject body) {
JSONObject copied = body;
String url = (String) copied.get("url");
copied.put("url", url.replace("localhost", "proxy"));
String changesURL = (String) copied.get("changesurl");
copied.put("changesurl", changesURL.replace("localhost", "proxy"));
return copied;
}
// file saving process
public static void processSave(final JSONObject body,
public static void processSave(final JSONObject rawBody,
final String fileName,
final String userAddress) throws Exception {
JSONObject body = TrackManager.resolveProcessSaveBody(rawBody);
if (body.get("url") == null) {
throw new Exception("DownloadUrl is null");
}

View File

@ -41,8 +41,6 @@ public final class Users {
add("Can create files from templates using data from the editor");
add("Has an avatar");
add("Can submit forms");
add("Has no roles");
add("Can start filling");
}};
private static List<String> descriptionUserSecond = new ArrayList<String>() {{
@ -55,8 +53,6 @@ public final class Users {
add("Can create new files from the editor");
add("Has an avatar");
add("Can't submit forms");
add("Has role 'Anyone'");
add("Can start filling");
}};
private static List<String> descriptionUserThird = new ArrayList<String>() {{
@ -72,8 +68,6 @@ public final class Users {
add("Can't close history");
add("Can't restore the file version");
add("Can't submit forms");
add("Has role 'role'");
add("Can start filling");
}};
private static List<String> descriptionUserZero = new ArrayList<String>() {{
@ -92,29 +86,26 @@ public final class Users {
add("Can't refresh outdated file");
add("Can't submit forms");
add("Tour of tips when opening a document");
add("Has empty role");
add("Can't start filling");
}};
private static List<User> users = new ArrayList<User>() {{
add(new User("uid-1", "John Smith", "smith@example.com",
"", null, new CommentGroups(), null,
false, new ArrayList<String>(), descriptionUserFirst, true, true, new Goback(null, false),
new Close(null, false), null));
new Close(null, false)));
add(new User("uid-2", "Mark Pottato", "pottato@example.com",
"group-2", Arrays.asList("group-2", ""), new CommentGroups(null,
Arrays.asList("group-2", ""), Arrays.asList("group-2")), Arrays.asList("group-2", ""),
true, new ArrayList<String>(), descriptionUserSecond, false, true,
new Goback("Go to Documents", false), new Close(null, true), Arrays.asList("Anyone")));
new Goback("Go to Documents", false), new Close(null, true)));
add(new User("uid-3", "Hamish Mitchell", null,
"group-3", Arrays.asList("group-2"), new CommentGroups(Arrays.asList("group-3", "group-2"),
Arrays.asList("group-2"), null), Arrays.asList("group-2"),
null, Arrays.asList("copy", "download", "print"),
descriptionUserThird, false, false, null, new Close(null, true), Arrays.asList("role")));
descriptionUserThird, false, false, null, new Close(null, true)));
add(new User("uid-0", null, null,
"", null, null, null,
null, Arrays.asList("protect"), descriptionUserZero, false, false, null, null,
new ArrayList<String>()));
null, Arrays.asList("protect"), descriptionUserZero, false, false, null, null));
}};
private Users() { }

View File

@ -1,4 +1,4 @@
version=1.15.0
version=1.14.0
filesize-max=5242880
storage-folder=app_data
@ -7,16 +7,16 @@ enable-forgotten=TRUE
files.docservice.timeout=120000
files.docservice.url.site=http://documentserver/
files.docservice.url.site=http://localhost:3000/
files.docservice.url.converter=converter
files.docservice.url.command=command
files.docservice.url.api=web-apps/apps/api/documents/api.js
files.docservice.url.preloader=web-apps/apps/api/documents/preload.html
files.docservice.url.example=
files.docservice.url.example=http://proxy:8080/
files.docservice.languages=en:English|sq-AL:Albanian (Albania)|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|he-IL:Hebrew (Israel)|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|ur:Urdu|vi:Vietnamese|aa-AA:Test Language
files.docservice.secret=
files.docservice.secret=your-256-bit-secret
files.docservice.header=Authorization
files.docservice.token-use-for-request=TRUE
files.docservice.token-expiration=5

View File

@ -2,23 +2,7 @@
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET</param-value>
</init-param>
<init-param>
<param-name>cors.support.credentials</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>cors.exposed.headers</param-name>
<param-value>Access-Control-Allow-Origin,Access-Control-Allow-Methods</param-value>
</init-param>
<filter-class>controllers.CorsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>

View File

@ -394,18 +394,6 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
config = JSON.parse('<%= FileModel.serialize(Model) %>');
config.width = "100%";
config.height = "100%";
@ -423,8 +411,6 @@
};
if (config.editorConfig.user.id) {
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
// add mentions for not anonymous users
@ -447,7 +433,7 @@
}
}
var connectEditor = function () {
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
@ -459,9 +445,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -153,18 +153,13 @@
<% } %>
</menu>
<div id="portal-info" style="display: <%= files.length > 0 ? "none" : "table-cell" %>">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% for (User user : Users.getAllUsers()) { %>
<div class="user-descr" onclick="toggleUserDescr(event)">
<b><%= user.getName() == null ? "Anonymous" : user.getName() %></b>

View File

@ -16,5 +16,6 @@ module.exports = {
'no-continue': 'off',
'no-extend-native': ['error', { exceptions: ['String'] }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-prototype-builtins': 'off',
},
};

View File

@ -1005,7 +1005,7 @@ app.post('/track', async (req, res) => { // define a handler for tracking file c
// check jwt token
if (cfgSignatureEnable && cfgSignatureUseForRequest) {
let body = null;
if (Object.hasOwn(req.body, 'token')) { // if request body has its own token
if (req.body.hasOwnProperty('token')) { // if request body has its own token
body = documentService.readToken(req.body.token); // read and verify it
} else {
const checkJwtHeaderRes = documentService.checkJwtHeader(req); // otherwise, check jwt token headers
@ -1034,7 +1034,7 @@ app.post('/track', async (req, res) => { // define a handler for tracking file c
return;
}
if (Object.hasOwn(req.body, 'status')) { // if the request body has status parameter
if (req.body.hasOwnProperty('status')) { // if the request body has status parameter
await processTrack(res, req.body, fName, uAddress); // track file changes
} else {
await readbody(req, res, fName, uAddress); // otherwise, read request body first
@ -1200,7 +1200,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
}
if (user.goback != null) {
user.goback.url = `${req.DocManager.getServerUrl()}/`;
user.goback.url = `${req.DocManager.getServerUrl()}`;
}
// file config data

View File

@ -1,5 +1,5 @@
{
"version": "1.15.0",
"version": "1.14.0",
"log": {
"appenders": [
{

View File

@ -42,11 +42,11 @@ exports.isValidToken = async (req, res, next) => {
{
url: `${req.DocManager.getServerPath()}${req.originalUrl || req.url}`,
accessToken: req.query.access_token,
timestamp,
timestamp: timestamp,
},
{
proof,
proofold,
proof: proof,
proofold: proofold,
},
{
modulus: proofKey.modulus,

View File

@ -32,7 +32,7 @@ const getCustomWopiParams = function getCustomWopiParams(query) {
let actionParams = '';
const { userid } = query; // user id
tokenParams += (userid ? `&userid=${userid}` : '');
tokenParams += (userid ? `-userid=${userid}` : '');
const { lang } = query; // language
actionParams += (lang ? `&ui=${lang}` : '');

View File

@ -494,10 +494,9 @@
}
},
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"license": "MIT",
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -1430,10 +1429,9 @@
}
},
"node_modules/filelist/node_modules/brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"license": "MIT",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dependencies": {
"balanced-match": "^1.0.0"
}
@ -4059,9 +4057,9 @@
}
},
"brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4766,9 +4764,9 @@
},
"dependencies": {
"brace-expansion": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"requires": {
"balanced-match": "^1.0.0"
}

View File

@ -3,7 +3,7 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no<%= (editor.type === "mobile" ? ", interactive-widget=resizes-content" : "") -%>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, interactive-widget=resizes-content" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<!--

View File

@ -142,18 +142,13 @@
<% } %>
</menu>
<div id="portal-info" style="display: <%= storedFiles.length > 0 ? "none" : "table-cell" %>">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% users.forEach(user => { %>
<div class="user-descr" onclick="toggleUserDescr(event)">
<b><%= user.name == null ? 'Anonymous' : user.name %></b>

View File

@ -128,26 +128,21 @@
<div id="portal-info" style="display: <%= storedFiles.length > 0 ? "none" : "table-cell" %>">
<% if (!wopiEnable)
{ %>
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr"></span>
<span class="portal-descr">Before launching the demo, make sure the WOPI protocol is enabled.</span>
<span class="portal-descr">To do this, set the <code>wopi.enable</code> parameter to <code>true</code> in the ONLYOFFICE Docs configuration file and restart the Document Server.</span>
<span class="portal-descr">⚠️ The WOPI protocol is required for communication between ONLYOFFICE Docs and third-party platforms that support WOPI.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
Before you get started with a demo sample of ONLYOFFICE Docs, please enable the WOPI protocol.
<br />Set the <b>wopi.enable</b> parameter in the Document Server configuration file to <b>true</b> and restart ONLYOFFICE Docs.
</span>
<% }
else
{ %>
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% } %>
</div>
<% if (storedFiles.length > 0)

View File

@ -16,7 +16,7 @@ DOCUMENT_STORAGE_DISPLAY_FORGOTTEN_PAGE=false
## DOCUMENT SERVER ENV VARIABLES
DOCUMENT_SERVER_VERSION=1.15.0
DOCUMENT_SERVER_VERSION=1.14.0
DOCUMENT_SERVER_PUBLIC_URL=http://localhost:8080
DOCUMENT_SERVER_PRIVATE_URL=http://proxy:8080

View File

@ -238,8 +238,6 @@ class EditorController extends Controller
if ($user['id'] != 'uid-0') {
$historyLayout .= "// add mentions for not anonymous users
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
config.events['onRequestUsers'] = onRequestUsers;

View File

@ -119,7 +119,6 @@ class Editor
'user' => [
'id' => $this->user->id != 'uid-0' ? $this->user->id : null,
'name' => $this->user->name,
'roles' => $this->user->roles,
'group' => $this->user->group,
'image' => $this->user->avatar ? $this->config->imagesUrl.$this->user->id.'.png' : null,
],

View File

@ -49,8 +49,6 @@ final class User
public ?array $close;
public ?array $roles;
/**
* Constructor
*
@ -71,8 +69,7 @@ final class User
?bool $templates,
?bool $avatar,
?array $goback,
?array $close,
?array $roles
?array $close
) {
$this->id = $id;
$this->name = $name;
@ -88,7 +85,6 @@ final class User
$this->avatar = $avatar;
$this->goback = $goback;
$this->close = $close;
$this->roles = $roles;
}
public function toArray(): array
@ -108,7 +104,6 @@ final class User
'avatar' => $this->avatar,
'goback' => $this->goback,
'close' => $this->close,
'roles' => $this->roles,
];
}
}

View File

@ -36,8 +36,6 @@ class UserRepository
'Can create files from templates using data from the editor',
'Has an avatar',
'Can submit forms',
'Has no roles',
'Can start filling',
];
$descriptions[] = [
'Belongs to Group2',
@ -49,8 +47,6 @@ class UserRepository
'Can create new files from the editor',
'Has an avatar',
'Can\'t submit forms',
'Has role "Anyone"',
'Can start filling',
];
$descriptions[] = [
'Belongs to Group3',
@ -65,8 +61,6 @@ class UserRepository
"Can't close history",
"Can't restore the file version",
'Can\'t submit forms',
'Has role "role"',
'Can start filling',
];
$descriptions[] = [
'The name is requested when the editor is opened',
@ -83,8 +77,6 @@ class UserRepository
'Can\'t refresh outdated file',
'Can\'t submit forms',
'Tour of tips when opening a document',
'Has empty role',
'Can\'t start filling',
];
$this->users = [
new User(
@ -101,8 +93,7 @@ class UserRepository
true,
true,
['blank' => false],
['visible' => false],
null
['visible' => false]
),
new User(
'uid-2',
@ -122,8 +113,7 @@ class UserRepository
false,
true,
['text' => 'Go to Documents'],
['visible' => true],
['Anyone']
['visible' => true]
),
new User(
'uid-3',
@ -143,8 +133,7 @@ class UserRepository
false,
false,
null,
['visible' => true],
['role']
['visible' => true]
),
new User(
'uid-0',
@ -160,8 +149,7 @@ class UserRepository
false,
false,
null,
null,
[]
null
),
];
}

View File

@ -1520,16 +1520,16 @@
},
{
"name": "league/commonmark",
"version": "2.7.1",
"version": "2.6.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "10732241927d3971d28e7ea7b5712721fa2296ca"
"reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/10732241927d3971d28e7ea7b5712721fa2296ca",
"reference": "10732241927d3971d28e7ea7b5712721fa2296ca",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/06c3b0bf2540338094575612f4a1778d0d2d5e94",
"reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94",
"shasum": ""
},
"require": {
@ -1558,7 +1558,7 @@
"symfony/process": "^5.4 | ^6.0 | ^7.0",
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0",
"unleashedtech/php-coding-standard": "^3.1.1",
"vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0"
"vimeo/psalm": "^4.24.0 || ^5.0.0"
},
"suggest": {
"symfony/yaml": "v2.3+ required if using the Front Matter extension"
@ -1566,7 +1566,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.8-dev"
"dev-main": "2.7-dev"
}
},
"autoload": {
@ -1623,7 +1623,7 @@
"type": "tidelift"
}
],
"time": "2025-07-20T12:47:49+00:00"
"time": "2025-04-18T21:09:27+00:00"
},
{
"name": "league/config",

View File

@ -430,19 +430,7 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
var connectEditor = function() {
var сonnectEditor = function() {
config = {!! $config !!}
config.width = "100%";
@ -476,9 +464,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>
</head>

View File

@ -278,18 +278,25 @@
</div>
@endif
<div id="portal-info" @if ($files) style="display: none" @endif>
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors,
the first html5-based editors.
<br /> You may upload your own documents for testing using the
"<b>Upload file</b>" button and <b>selecting</b>
the necessary files on your PC.
</span>
<span class="portal-descr">
Please do NOT use this integration example on your own server without
proper code modifications, it is intended for testing purposes only.
In case you enabled this test example, disable it before going for
production.
</span>
<span class="portal-descr">
You can open the same document using different
users in different Web browser sessions, so you can check out multi-user
editing functions.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
@foreach ($users as $user)
<div class="user-descr">
<b>{{ $user['name'] ?? 'Anonymous' }}</b>

View File

@ -22,7 +22,7 @@ use Example\Common\URL;
class ConfigurationManager
{
public string $version = '1.15.0';
public string $version = '1.14.0';
public function getVersion(): string
{

View File

@ -39,9 +39,7 @@ final class ExampleUsers
"This file isn't marked as favorite",
"Can create files from templates using data from the editor",
"Has an avatar",
"Can submit forms",
"Has no roles",
"Can start filling"
"Can submit forms"
];
$this->user2Description = [
"Belongs to Group2",
@ -52,9 +50,7 @@ final class ExampleUsers
"This file is marked as favorite",
"Can create new files from the editor",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling"
"Can't submit forms"
];
$this->user3Description = [
"Belongs to Group3",
@ -68,9 +64,7 @@ final class ExampleUsers
"Can create new files from the editor",
"Can't close history",
"Can't restore the file version",
"Can't submit forms",
"Has role 'role'",
"Can start filling"
"Can't submit forms"
];
$this->user0Description = [
"The name is requested when the editor is opened",
@ -86,9 +80,7 @@ final class ExampleUsers
"View file without collaboration",
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling"
"Tour of tips when opening a document"
];
$this->users = [
new Users(
@ -105,8 +97,7 @@ final class ExampleUsers
true,
true,
["blank" => false,],
["visible" => false],
null
["visible" => false]
),
new Users(
"uid-2",
@ -126,8 +117,7 @@ final class ExampleUsers
false,
true,
["text" => "Go to Documents",],
["visible" => true],
["Anyone"]
["visible" => true]
),
new Users(
"uid-3",
@ -147,8 +137,7 @@ final class ExampleUsers
false,
false,
null,
["visible" => true],
["role"]
["visible" => true]
),
new Users(
"uid-0",
@ -164,8 +153,7 @@ final class ExampleUsers
false,
false,
null,
null,
[]
null
),
];
}

View File

@ -36,7 +36,6 @@ final class Users
public ?string $image;
public ?array $goback;
public ?array $close;
public ?array $roles;
/**
* Constructor
@ -55,7 +54,6 @@ final class Users
* @param bool|null $avatar
* @param array|null $goback
* @param array|null $close
* @param array|null $roles
*
* @return void
*/
@ -73,8 +71,7 @@ final class Users
?bool $templates,
?bool $avatar,
?array $goback,
?array $close,
?array $roles
?array $close
) {
$this->id = $id;
$this->name = $name;
@ -90,6 +87,5 @@ final class Users
$this->avatar = $avatar;
$this->goback = $goback;
$this->close = $close;
$this->roles = $roles;
}
}

View File

@ -162,7 +162,6 @@ final class DocEditorView extends View
"user" => [ // the user currently viewing or editing the document
"id" => $user->id != "uid-0" ? $user->id : null,
"name" => $user->name,
"roles" => $user->roles,
"group" => $user->group,
"image" => $user->avatar ? serverPath(false) . "/assets/images/" . $user->id . ".png" : null
],
@ -258,8 +257,6 @@ final class DocEditorView extends View
if ($user->id != "uid-0") {
$historyLayout .= "// add mentions for not anonymous users
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestUsers'] = onRequestUsers;
config.events['onRequestSaveAs'] = onRequestSaveAs;

View File

@ -408,19 +408,7 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
var connectEditor = function () {
var сonnectEditor = function () {
{fileNotFoundAlert}
config = {config};
@ -456,9 +444,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -127,18 +127,25 @@
{forgottenLink}
</menu>
<div id="portal-info" style="display: {portalInfoDisplay}">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
Get started with a demo-sample of ONLYOFFICE Document Editors,
the first html5-based editors.
<br /> You may upload your own documents for testing using the
"<b>Upload file</b>" button and <b>selecting</b>
the necessary files on your PC.
</span>
<span class="portal-descr">
Please do NOT use this integration example on your own server without
proper code modifications, it is intended for testing purposes only.
In case you enabled this test example, disable it before going for
production.
</span>
<span class="portal-descr">
You can open the same document using different
users in different Web browser sessions, so you can check out multi-user
editing functions.
</span>
{userDescr}
</div>
{storedList}

View File

@ -22,7 +22,7 @@ from src.common import string
class ConfigurationManager:
version = '1.15.0'
version = '1.14.0'
def getVersion(self) -> str:
return self.version

View File

@ -21,7 +21,7 @@ from typing import Optional
class User:
def __init__(self, uid, name, email, group, reviewGroups, commentGroups, userInfoGroups, favorite,
deniedPermissions, descriptions, templates, avatar, goback, close, roles):
deniedPermissions, descriptions, templates, avatar, goback, close):
self.id = uid
self.name = name
self.email = email
@ -36,7 +36,6 @@ class User:
self.avatar = avatar
self.goback = goback
self.close = close
self.roles = roles
descr_user_1 = [
@ -48,9 +47,7 @@ descr_user_1 = [
"This file isn't marked as favorite",
"Can create files from templates using data from the editor",
"Has an avatar",
"Can submit forms",
"Has no roles",
"Can start filling"
"Can submit forms"
]
descr_user_2 = [
@ -62,9 +59,7 @@ descr_user_2 = [
"This file is marked as favorite",
"Can create new files from the editor",
"Has an avatar",
"Can't submit forms",
"Has role 'Anyone'",
"Can start filling"
"Can't submit forms"
]
descr_user_3 = [
@ -79,9 +74,7 @@ descr_user_3 = [
"Can create new files from the editor",
"Can't close history",
"Can't restore the file version",
"Can't submit forms",
"Has role 'role'",
"Can start filling"
"Can't submit forms"
]
descr_user_0 = [
@ -99,15 +92,13 @@ descr_user_0 = [
"View file without collaboration",
"Can't refresh outdated file",
"Can't submit forms",
"Tour of tips when opening a document",
"Has empty role",
"Can't start filling"
"Tour of tips when opening a document"
]
USERS = [
User('uid-1', 'John Smith', 'smith@example.com',
'', None, {}, None,
False, [], descr_user_1, True, True, {'blank': False}, {'visible': False}, None),
False, [], descr_user_1, True, True, {'blank': False}, {'visible': False}),
User('uid-2', 'Mark Pottato', 'pottato@example.com',
'group-2', ['group-2', ''], {
'view': "",
@ -115,7 +106,7 @@ USERS = [
'remove': ["group-2"]
},
['group-2', ''],
True, [], descr_user_2, False, True, {'text': "Go to Documents"}, {}, ['Anyone']),
True, [], descr_user_2, False, True, {'text': "Go to Documents"}, {}),
User('uid-3', 'Hamish Mitchell', None,
'group-3', ['group-2'], {
'view': ["group-3", "group-2"],
@ -123,10 +114,10 @@ USERS = [
'remove': []
}, ['group-2'],
None, ["copy", "download", "print"], descr_user_3, False, False,
None, {}, ['role']),
None, {}),
User('uid-0', None, None,
'', None, {}, [],
None, ["protect"], descr_user_0, False, False, None, None, [])
None, ["protect"], descr_user_0, False, False, None, None)
]
DEFAULT_USER = USERS[0]

View File

@ -324,7 +324,6 @@ def edit(request):
'user': { # the user currently viewing or editing the document
'id': user.id if user.id != 'uid-0' else None,
'name': user.name,
'roles': user.roles,
'group': user.group,
'image': docManager.getServerUrl(False, request) + f'/static/images/{user.id}.jpg' if user.avatar
else None

View File

@ -390,18 +390,6 @@
innerAlert("onRequestSendNotify: " + data);
};
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
var connectEditor = function () {
config = {{ cfg | safe }}
@ -421,8 +409,6 @@
};
if (config.editorConfig.user.id) {
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose
// add mentions for not anonymous users

View File

@ -146,18 +146,13 @@
{% else %}
<div id="portal-info" style="display: table-cell">
{% endif %}
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
{% for user in users %}
<div class="user-descr" onclick="toggleUserDescr(event)">
<b>{% if user.name %} {{ user.name }} {% else %} Anonymous {% endif %}</b>

View File

@ -44,7 +44,7 @@ jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rail
License: MIT
License File: jquery-rails.license
mimemagic - A library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
mimemagic - А library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
License: MIT
License File: mimemagic.license

View File

@ -10,7 +10,7 @@ gem 'jquery-rails', '~> 4.5'
gem 'jwt', '~> 2.7'
gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'
gem 'rack-cors', '~> 2.0'
gem 'rails', '~> 7.0.8.7'
gem 'rails', '~> 7.0.8'
gem 'rubocop', '~> 1.52', group: :development
gem 'rubocop-rails', '~> 2.20', group: :development
gem 'sass-rails', '~> 6.0'
@ -22,7 +22,7 @@ gem 'tzinfo-data', '~> 1.2023'
gem 'uglifier', '~> 4.2'
gem 'uuid', '~> 2.3'
gem 'web-console', '~> 4.2', groups: [:development, :test]
gem 'webrick', '~> 1.8.2'
gem 'webrick', '~> 1.8'
# Unfortunately, Sorbet only supports Darwin and Linux-based systems.
# Additionally, it doesn't support Linux on ARM64, which may be used in a Docker

View File

@ -8,67 +8,67 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
actioncable (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
actionmailbox (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.7)
actionpack (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activesupport (= 7.0.8.7)
actionmailer (7.0.8.5)
actionpack (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.7)
actionview (= 7.0.8.7)
activesupport (= 7.0.8.7)
actionpack (7.0.8.5)
actionview (= 7.0.8.5)
activesupport (= 7.0.8.5)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.7)
actionpack (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
actiontext (7.0.8.5)
actionpack (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.7)
activesupport (= 7.0.8.7)
actionview (7.0.8.5)
activesupport (= 7.0.8.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8.7)
activesupport (= 7.0.8.7)
activejob (7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.3.6)
activemodel (7.0.8.7)
activesupport (= 7.0.8.7)
activerecord (7.0.8.7)
activemodel (= 7.0.8.7)
activesupport (= 7.0.8.7)
activestorage (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activesupport (= 7.0.8.7)
activemodel (7.0.8.5)
activesupport (= 7.0.8.5)
activerecord (7.0.8.5)
activemodel (= 7.0.8.5)
activesupport (= 7.0.8.5)
activestorage (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activesupport (= 7.0.8.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.7)
activesupport (7.0.8.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@ -121,20 +121,22 @@ GEM
method_source (1.0.0)
mini_mime (1.1.5)
minitest (5.25.1)
net-imap (0.5.9)
net-imap (0.4.20)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.1)
net-smtp (0.5.0)
net-protocol
netrc (0.11.0)
nio4r (2.7.4)
nokogiri (1.18.9-arm64-darwin)
nio4r (2.7.0)
nokogiri (1.18.8-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
nokogiri (1.18.8-x86_64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-musl)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
@ -146,25 +148,25 @@ GEM
psych (5.1.2)
stringio
racc (1.8.1)
rack (2.2.14)
rack (2.2.13)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.7)
actioncable (= 7.0.8.7)
actionmailbox (= 7.0.8.7)
actionmailer (= 7.0.8.7)
actionpack (= 7.0.8.7)
actiontext (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activemodel (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
rails (7.0.8.5)
actioncable (= 7.0.8.5)
actionmailbox (= 7.0.8.5)
actionmailer (= 7.0.8.5)
actionpack (= 7.0.8.5)
actiontext (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activemodel (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
bundler (>= 1.15.0)
railties (= 7.0.8.7)
railties (= 7.0.8.5)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
@ -172,9 +174,9 @@ GEM
rails-html-sanitizer (1.6.1)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
railties (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
method_source
rake (>= 12.2)
thor (~> 1.0)
@ -254,7 +256,7 @@ GEM
yard-sorbet
test-unit (3.6.2)
power_assert
thor (1.4.0)
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.3)
turbolinks (5.2.1)
@ -274,9 +276,8 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webrick (1.8.2)
websocket-driver (0.8.0)
base64
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yard (0.9.36)
@ -298,7 +299,7 @@ DEPENDENCIES
jwt (~> 2.7)
mimemagic!
rack-cors (~> 2.0)
rails (~> 7.0.8.7)
rails (~> 7.0.8)
rubocop (~> 1.52)
rubocop-rails (~> 2.20)
sass-rails (~> 6.0)
@ -312,7 +313,7 @@ DEPENDENCIES
uglifier (~> 4.2)
uuid (~> 2.3)
web-console (~> 4.2)
webrick (~> 1.8.2)
webrick (~> 1.8)
BUNDLED WITH
2.4.10

View File

@ -31,7 +31,7 @@ class ConfigurationManager
sig { void }
def initialize
@version = '1.15.0'
@version = '1.14.0'
end
sig { returns(T.nilable(URI::Generic)) }

View File

@ -182,7 +182,6 @@ class FileModel
user: { # the user currently viewing or editing the document
id: @user.id.eql?('uid-0') ? nil : @user.id,
name: @user.name,
roles: @user.roles,
group: @user.group,
image: @user.avatar ? "#{DocumentHelper.get_server_url(false)}/assets/#{@user.id}.png" : nil
},

View File

@ -32,7 +32,6 @@ class User
attr_accessor :avatar
attr_accessor :goback
attr_accessor :close
attr_accessor :roles
def initialize(
id,
@ -48,8 +47,7 @@ class User
templates,
avatar,
goback,
close,
roles
close
)
@id = id
@name = name
@ -65,7 +63,6 @@ class User
@avatar = avatar
@goback = goback
@close = close
@roles = roles
end
end
@ -80,9 +77,7 @@ class Users
'This file isn\'t marked as favorite',
'Can create files from templates using data from the editor',
'Has an avatar',
'Can submit forms',
'Has no roles',
'Can start filling'
'Can submit forms'
]
@descr_user_second = [
@ -94,9 +89,7 @@ class Users
'This file is marked as favorite',
'Can create new files from the editor',
'Has an avatar',
'Can\'t submit forms',
'Has role "Anyone"',
'Can start filling'
'Can\'t submit forms'
]
@descr_user_third = [
@ -111,9 +104,7 @@ class Users
'Can create new files from the editor',
'Can\'t close history',
'Can\'t restore the file version',
'Can\'t submit forms',
'Has role "role"',
'Can start filling'
'Can\'t submit forms'
]
@descr_user_null = [
@ -131,9 +122,7 @@ class Users
'View file without collaboration',
'Can\'t refresh outdated file',
'Can\'t submit forms',
'Tour of tips when opening a document',
'Has empty role',
'Can\'t start filling'
'Tour of tips when opening a document'
]
@users = [
@ -151,8 +140,7 @@ class Users
true,
true,
{ blank: false },
{ visible: false },
nil
{ visible: false }
),
User.new(
'uid-2',
@ -172,8 +160,7 @@ class Users
false,
true,
{ text: 'Go to Documents' },
{},
['Anyone']
{}
),
User.new(
'uid-3',
@ -193,8 +180,7 @@ class Users
false,
false,
nil,
{},
['role']
{}
),
User.new(
'uid-0',
@ -210,8 +196,7 @@ class Users
false,
false,
nil,
nil,
[]
nil
)
]

View File

@ -368,19 +368,7 @@
document.location.reload();
}
var onRequestStartFilling = function(event) {
var data = event.data;
var submit = confirm("Start filling?\n" + JSON.stringify(data));
if (submit) {
docEditor.startFilling(true);
}
};
var onStartFilling = function(event) {
innerAlert("The form is ready to fill out.");
};
var connectEditor = function () {
var сonnectEditor = function () {
config = <%= raw @file.config.to_json %>;
@ -400,8 +388,6 @@
};
if (config.editorConfig.user.id) {
config.events['onRequestStartFilling'] = onRequestStartFilling;
config.events['onStartFilling'] = onStartFilling;
config.events['onRequestRefreshFile'] = onRequestRefreshFile;
config.events['onRequestClose'] = onRequestClose;
// add mentions for not anonymous users
@ -435,9 +421,9 @@
};
if (window.addEventListener) {
window.addEventListener("load", connectEditor);
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", connectEditor);
window.attachEvent("load", сonnectEditor);
}
</script>

View File

@ -130,18 +130,13 @@
<% end %>
</menu>
<div id="portal-info" style="display: <%= docs.length > 0 ? "none" : "table-cell" %>">
<span class="portal-name">Welcome to ONLYOFFICE Docs!</span>
<span class="portal-descr">Get started with a live demo of ONLYOFFICE Docs, a powerful open-source office suite for your browser.</span>
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
You can test editing features in real-time and explore multi-user collaboration:
<ul>
<li>Create a new Document, Spreadsheet, Presentation, or PDF Form or use the sample files</li>
<li>Upload your own files to test using the Upload file button</li>
<li>Select your username and language to simulate different users and environments</li>
<li>Try real-time collaboration by opening the same document using different users in different Web browser sessions</li>
</ul>
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
<span class="portal-descr">⚠️ This example is intended for testing purposes only. Do not use it on a production server without proper code modifications. If you have enabled this test demo, please disable it before deploying the editors in production.</span>
<span class="portal-descr">Please do NOT use this integration example on your own server without proper code modifications, it is intended for testing purposes only. In case you enabled this test example, disable it before going for production.</span>
<span class="portal-descr">You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.</span>
<% for user in Users.all_users() do %>
<div class="user-descr" onclick="toggleUserDescr(event)">
<b><%= user.name ? user.name : "Anonymous" %></b>

View File

@ -44,7 +44,7 @@ jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rail
License: MIT
License File: jquery-rails.license
mimemagic - A library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
mimemagic - А library to detect the mime type of a file by extension or by content. (https://github.com/mimemagicrb/mimemagic/blob/master/LICENSE)
License: MIT
License File: mimemagic.license