[license] Branding

Branding now int. Check string and boolean for old versions
This commit is contained in:
Alexander.Trofimov
2018-09-06 15:31:09 +03:00
parent b53a4d24a3
commit e0bede2b69

View File

@ -91,7 +91,7 @@ exports.readLicense = function*() {
}
res.light = (true === oLicense['light'] || 'true' === oLicense['light']); // Someone who likes to put json string instead of bool
res.branding = (true === oLicense['branding'] || 'true' === oLicense['branding']); // Someone who likes to put json string instead of bool
res.branding = getBranding(oLicense['branding']);
if (oLicense.hasOwnProperty('connections')) {
res.connections = oLicense['connections'] >> 0;
}
@ -143,6 +143,10 @@ function getLicenseMode(mode) {
const c_LM = constants.LICENSE_MODE;
return 'developer' === mode ? c_LM.Developer : ('trial' === mode ? c_LM.Trial : c_LM.None);
}
function getBranding(mode) {
// Someone who likes to put json string instead of bool
return ((typeof mode === 'string') ? 'true' === mode : (mode || 0)) - 0;
}
function* _getFileState() {
const val = yield utils.promiseRedis(redisClient, redisClient.hget, redisKeyLicense, redisKeyLicense);