From 9189d5e1c32d95896014f4c7fad67a20d9383feb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 24 May 2023 17:25:22 +0300 Subject: [PATCH] Disable editing when no support for anonymous users or limit of connections/users is exceeded --- .../forms/app/controller/ApplicationController.js | 2 ++ apps/documenteditor/main/app/controller/Main.js | 2 ++ apps/documenteditor/mobile/src/controller/Main.jsx | 2 ++ apps/presentationeditor/main/app/controller/Main.js | 2 ++ apps/presentationeditor/mobile/src/controller/Main.jsx | 2 ++ apps/spreadsheeteditor/main/app/controller/Main.js | 2 ++ apps/spreadsheeteditor/mobile/src/controller/Main.jsx | 2 ++ 7 files changed, 14 insertions(+) diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 27cde2c251..f966805ceb 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -730,6 +730,7 @@ define([ applyLicense: function() { if (!this.appOptions.isAnonymousSupport && !!this.appOptions.user.anonymous) { + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); Common.UI.warning({ title: this.notcriticalErrorTitle, @@ -752,6 +753,7 @@ define([ } if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) { + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 5009dfbaec..c4c8545f77 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1426,6 +1426,7 @@ define([ } } else if (!this.appOptions.isAnonymousSupport && !!this.appOptions.user.anonymous) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); Common.UI.warning({ title: this.notcriticalErrorTitle, @@ -1450,6 +1451,7 @@ define([ if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); } diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 755f6d8702..6b8b44d484 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -513,6 +513,7 @@ class MainController extends Component { } else if (!appOptions.isAnonymousSupport && !!appOptions.config.user.anonymous) { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); f7.dialog.create({ title: _t.notcriticalErrorTitle, @@ -551,6 +552,7 @@ class MainController extends Component { } else { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6adbc53c42..e48f649261 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1043,6 +1043,7 @@ define([ } } else if (!this.appOptions.isAnonymousSupport && !!this.appOptions.user.anonymous) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); Common.UI.warning({ title: this.notcriticalErrorTitle, @@ -1067,6 +1068,7 @@ define([ if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); } diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index bbff71a6f0..6cb00ccbc5 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -577,6 +577,7 @@ class MainController extends Component { } else if (!appOptions.isAnonymousSupport && !!appOptions.config.user.anonymous) { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); f7.dialog.create({ title: _t.notcriticalErrorTitle, @@ -615,6 +616,7 @@ class MainController extends Component { } else { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 7a2b115693..4399586a66 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1138,6 +1138,7 @@ define([ } } else if (!this.appOptions.isAnonymousSupport && !!this.appOptions.user.anonymous) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); Common.UI.warning({ title: this.notcriticalErrorTitle, @@ -1162,6 +1163,7 @@ define([ if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) { this.disableEditing(true); + this.api.asc_coAuthoringDisconnect(); Common.NotificationCenter.trigger('api:disconnect'); } diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index a5846b2597..d015dd4843 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -781,6 +781,7 @@ class MainController extends Component { } else if (!appOptions.isAnonymousSupport && !!appOptions.config.user.anonymous) { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); f7.dialog.create({ title: _t.notcriticalErrorTitle, @@ -819,6 +820,7 @@ class MainController extends Component { } else { Common.Notifications.trigger('toolbar:activatecontrols'); Common.Notifications.trigger('toolbar:deactivateeditcontrols'); + this.api.asc_coAuthoringDisconnect(); Common.Notifications.trigger('api:disconnect'); }