Commit b3f5ec4e authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65045 954022d7-b5bf-4e40-9824-e11837661b57
parent 6ad2fe01
...@@ -41,12 +41,14 @@ function CheckLicense(licenseUrl, userId, callback) { ...@@ -41,12 +41,14 @@ function CheckLicense(licenseUrl, userId, callback) {
*/ */
function CheckUserInLicense(userId, oLicense) { function CheckUserInLicense(userId, oLicense) {
var res = false; var res = false;
var superuser = 'onlyoffice';
try { try {
if ('onlyoffice' === oLicense['company_id']) { if (oLicense.users) {
res = true; if (oLicense.users.hasOwnProperty(userId) || (superuser === oLicense['company_id'] &&
} else if (oLicense.users && oLicense.users.hasOwnProperty(userId)) { oLicense.users.hasOwnProperty(userId = superuser))) {
var endDate = new Date(oLicense.users[userId]); var endDate = new Date(oLicense.users[userId]['end_date']);
res = endDate >= new Date(); res = endDate >= new Date();
}
} }
} catch(e) { } catch(e) {
res = false; res = false;
......
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