Commit 17fbe62e authored by Alexander.Trofimov's avatar Alexander.Trofimov

Поправил проверку лицензии для минимизации

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65441 954022d7-b5bf-4e40-9824-e11837661b57
parent 97d272ad
......@@ -21,8 +21,8 @@ function CheckLicense(licenseUrl, customerId, userId, userFirstName, userLastNam
var sJson = decrypted.toString(CryptoJS.enc.Utf8);
var oLicense = JSON.parse(sJson);
var hSig = oLicense.signature;
delete oLicense.signature;
var hSig = oLicense['signature'];
delete oLicense['signature'];
var x509 = new X509();
x509.readCertPEM(g_sPublicRSAKey);
......@@ -46,11 +46,11 @@ function CheckUserInLicense(customerId, userId, userFirstName, userLastName, oLi
var res = false;
var superuser = 'onlyoffice';
try {
if (oLicense.users) {
if (oLicense['users']) {
var userName = (null == userFirstName ? '' : userFirstName) + (null == userLastName ? '' : userLastName);
var sUserHash = CryptoJS.SHA256(userId + userName).toString(CryptoJS.enc.Hex).toLowerCase();
if ((customerId === oLicense['customer_id'] && oLicense.users.hasOwnProperty(sUserHash)) || (superuser === oLicense['customer_id'] && oLicense.users.hasOwnProperty(sUserHash = superuser))) {
var endDate = new Date(oLicense.users[sUserHash]['end_date']);
if ((customerId === oLicense['customer_id'] && oLicense['users'].hasOwnProperty(sUserHash)) || (superuser === oLicense['customer_id'] && oLicense['users'].hasOwnProperty(sUserHash = superuser))) {
var endDate = new Date(oLicense['users'][sUserHash]['end_date']);
res = endDate >= new Date();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment