diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index f16256763..58fe87d54 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -921,9 +921,20 @@ define([
},
onEditorPermissions: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (Asc.c_oLicenseResult.Expired === licType || Asc.c_oLicenseResult.Error === licType) {
+ Common.UI.warning({
+ title: this.titleLicenseExp,
+ msg: this.warnLicenseExp,
+ buttons: [],
+ closable: false
+ });
+ return;
+ }
+
this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
- this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
+ this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
@@ -949,7 +960,7 @@ define([
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
this.appOptions.canDownload = !this.appOptions.nativeApp && this.permissions.download !== false && (!type || typeof type[1] !== 'string');
- this._state.licenseWarning = !this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding) {
@@ -1863,7 +1874,9 @@ define([
textNoLicenseTitle: 'ONLYOFFICE open source version',
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
- errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.'
+ errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.',
+ warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
+ titleLicenseExp: 'License expired'
}
})(), DE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index ee9c6ad10..898e2bf73 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -277,6 +277,8 @@
"DE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"DE.Controllers.Main.warnNoLicense": "You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "DE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
+ "DE.Controllers.Main.titleLicenseExp": "License expired",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index 608db16df..2bdf1f503 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -712,8 +712,19 @@ define([
},
onEditorPermissions: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (Asc.c_oLicenseResult.Expired === licType || Asc.c_oLicenseResult.Error === licType) {
+ Common.UI.warning({
+ title: this.titleLicenseExp,
+ msg: this.warnLicenseExp,
+ buttons: [],
+ closable: false
+ });
+ return;
+ }
+
this.appOptions.isOffline = this.api.asc_isOffline();
- this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
+ this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
@@ -728,7 +739,7 @@ define([
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canPrint = (this.permissions.print !== false);
- this._state.licenseWarning = !this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
+ this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding) {
@@ -1666,7 +1677,9 @@ define([
textNoLicenseTitle: 'ONLYOFFICE open source version',
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
- errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.'
+ errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.',
+ warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
+ titleLicenseExp: 'License expired'
}
})(), PE.Controllers.Main || {}))
});
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index 617b80c8e..bed18a9a0 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -223,6 +223,8 @@
"PE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"PE.Controllers.Main.warnNoLicense": "You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "PE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
+ "PE.Controllers.Main.titleLicenseExp": "License expired",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?",
"PE.Controllers.Toolbar.textEmptyImgUrl": "You need to specify image URL.",
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 119882348..fcf944a69 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -733,12 +733,23 @@ define([
},
onEditorPermissions: function(params) {
+ var licType = params.asc_getLicenseType();
+ if (Asc.c_oLicenseResult.Expired === licType || Asc.c_oLicenseResult.Error === licType) {
+ Common.UI.warning({
+ title: this.titleLicenseExp,
+ msg: this.warnLicenseExp,
+ buttons: [],
+ closable: false
+ });
+ return;
+ }
+
if ( params && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge)) {
this.appOptions.canAutosave = true;
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
this.appOptions.isOffline = this.api.asc_isOffline();
- this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
+ this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
this.appOptions.isLightVersion = params.asc_getIsLight();
/** coauthoring begin **/
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
@@ -759,7 +770,7 @@ define([
this.appOptions.canDownload = !this.appOptions.nativeApp && (this.permissions.download !== false);
this.appOptions.canPrint = (this.permissions.print !== false);
- this._state.licenseWarning = !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && !this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
+ this._state.licenseWarning = !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && (licType===Asc.c_oLicenseResult.Connections) && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
this.applyModeCommonElements();
this.applyModeEditorElements();
@@ -1882,7 +1893,9 @@ define([
warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.',
textContactUs: 'Contact sales',
confirmPutMergeRange: 'The source data contains merged cells.
They will be unmerged before they are pasted into the table.',
- errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.'
+ errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.',
+ warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.',
+ titleLicenseExp: 'License expired'
}
})(), SSE.Controllers.Main || {}))
});
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 7cfa3161f..0c6aaa354 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -233,6 +233,8 @@
"SSE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"SSE.Controllers.Main.warnNoLicense": "You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).
If you need more please consider purchasing a commercial license.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "SSE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.",
+ "SSE.Controllers.Main.titleLicenseExp": "License expired",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textWarning": "Warning",
"SSE.Controllers.Print.warnCheckMargings": "Margins are incorrect",