Commit ac9cce5b authored by Alexander.Trofimov's avatar Alexander.Trofimov

Добавил поддержку лицензии версии 1.5

Теперь users - это массив user_hash.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65586 954022d7-b5bf-4e40-9824-e11837661b57
parent 9c4a1fce
......@@ -49,7 +49,13 @@ function CheckUserInLicense(customerId, userId, userFirstName, userLastName, oLi
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 checkUserHash = false;
var version = parseFloat(oLicense['version']);
if (customerId === oLicense['customer_id'] || oLicense['customer_id'] === (sUserHash = superuser)) {
// users для новой версии - массив
checkUserHash = (1.4 < version) ? (-1 !== oLicense['users'].indexOf(sUserHash)) : oLicense['users'].hasOwnProperty(sUserHash);
}
if (checkUserHash) {
var endDate = new Date(oLicense['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