License system enabled.
This commit is contained in:
parent
4762f1c8e9
commit
c58f11fb22
1 changed files with 5 additions and 8 deletions
|
@ -40,13 +40,10 @@ namespace Controller{
|
||||||
INFO_MSG("Verifying license against %llu: %s", now, currentLicense.toString().c_str());
|
INFO_MSG("Verifying license against %llu: %s", now, currentLicense.toString().c_str());
|
||||||
#endif
|
#endif
|
||||||
//The loop below is timechecker loop
|
//The loop below is timechecker loop
|
||||||
if (!currentLicense.isMember("valid_from") || !currentLicense.isMember("valid_till")){
|
if (!currentLicense.isMember("valid_from") || !currentLicense.isMember("valid_till") || now < currentLicense["valid_from"].asInt() || now > currentLicense["valid_till"].asInt()){
|
||||||
#if DEBUG >= DLVL_DEVEL
|
if (currentLicense.isMember("user_msg") && currentLicense["user_msg"].asStringRef().size()){
|
||||||
INFO_MSG("Accepting license despite lack of date range, because early build");
|
FAIL_MSG("%s", currentLicense["user_msg"].asStringRef().c_str());
|
||||||
#endif
|
|
||||||
return true;//temporary
|
|
||||||
}
|
}
|
||||||
if (now < currentLicense["valid_from"].asInt() || now > currentLicense["valid_till"].asInt()){
|
|
||||||
return false;//license is expired
|
return false;//license is expired
|
||||||
}
|
}
|
||||||
if (RELEASE != currentLicense["release"].asStringRef() || PACKAGE_VERSION != currentLicense["version"].asStringRef()){
|
if (RELEASE != currentLicense["release"].asStringRef() || PACKAGE_VERSION != currentLicense["version"].asStringRef()){
|
||||||
|
@ -63,7 +60,7 @@ namespace Controller{
|
||||||
}
|
}
|
||||||
INFO_MSG("Checking license time");
|
INFO_MSG("Checking license time");
|
||||||
if(!isLicensed()){
|
if(!isLicensed()){
|
||||||
FAIL_MSG("License expired, shutting down");
|
FAIL_MSG("Not licensed, shutting down");
|
||||||
kill(getpid(), SIGINT);
|
kill(getpid(), SIGINT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue