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) {
*/
function CheckUserInLicense(userId, oLicense) {
var res = false;
var superuser = 'onlyoffice';
try {
if ('onlyoffice' === oLicense['company_id']) {
res = true;
} else if (oLicense.users && oLicense.users.hasOwnProperty(userId)) {
var endDate = new Date(oLicense.users[userId]);
res = endDate >= new Date();
if (oLicense.users) {
if (oLicense.users.hasOwnProperty(userId) || (superuser === oLicense['company_id'] &&
oLicense.users.hasOwnProperty(userId = superuser))) {
var endDate = new Date(oLicense.users[userId]['end_date']);
res = endDate >= new Date();
}
}
} catch(e) {
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