This commit is contained in:
@@ -33,6 +33,11 @@ namespace AyaNova.Core
|
|||||||
//Unlicensed token
|
//Unlicensed token
|
||||||
private const string UNLICENSED_TOKEN = "UNLICENSED";
|
private const string UNLICENSED_TOKEN = "UNLICENSED";
|
||||||
|
|
||||||
|
//REVOKED token
|
||||||
|
private const string REVOKED_TOKEN = "REVOKED";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Scheduleable users
|
//Scheduleable users
|
||||||
private const string SERVICE_TECHS_FEATURE_NAME = "ServiceTechs";
|
private const string SERVICE_TECHS_FEATURE_NAME = "ServiceTechs";
|
||||||
|
|
||||||
@@ -80,7 +85,8 @@ namespace AyaNova.Core
|
|||||||
ActiveTrial = 1,
|
ActiveTrial = 1,
|
||||||
ExpiredTrial = 2,
|
ExpiredTrial = 2,
|
||||||
ActivePurchased = 3,
|
ActivePurchased = 3,
|
||||||
ExpiredPurchased = 4
|
ExpiredPurchased = 4,
|
||||||
|
Revoked = 5
|
||||||
}
|
}
|
||||||
|
|
||||||
public AyaNovaLicenseKey()
|
public AyaNovaLicenseKey()
|
||||||
@@ -147,8 +153,12 @@ namespace AyaNova.Core
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
return LicenseStatus.Revoked;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(RegisteredTo) || RegisteredTo == UNLICENSED_TOKEN)
|
if (string.IsNullOrWhiteSpace(RegisteredTo) || RegisteredTo == UNLICENSED_TOKEN)
|
||||||
return LicenseStatus.NONE;
|
return LicenseStatus.NONE;
|
||||||
|
if (RegisteredTo == REVOKED_TOKEN)
|
||||||
|
return LicenseStatus.Revoked;
|
||||||
if (TrialLicense && !LicenseExpired)
|
if (TrialLicense && !LicenseExpired)
|
||||||
return LicenseStatus.ActiveTrial;
|
return LicenseStatus.ActiveTrial;
|
||||||
if (TrialLicense && LicenseExpired)
|
if (TrialLicense && LicenseExpired)
|
||||||
@@ -157,6 +167,7 @@ namespace AyaNova.Core
|
|||||||
return LicenseStatus.ActivePurchased;
|
return LicenseStatus.ActivePurchased;
|
||||||
if (!TrialLicense && LicenseExpired)
|
if (!TrialLicense && LicenseExpired)
|
||||||
return LicenseStatus.ExpiredPurchased;
|
return LicenseStatus.ExpiredPurchased;
|
||||||
|
|
||||||
throw new System.Exception("License::Status - unable to determine license status");
|
throw new System.Exception("License::Status - unable to determine license status");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,7 +253,7 @@ namespace AyaNova.Core
|
|||||||
// ""Key"": {
|
// ""Key"": {
|
||||||
// ""LicenseFormat"": ""2018"",
|
// ""LicenseFormat"": ""2018"",
|
||||||
// ""Id"": ""34-1516288681"", <----Customer id followed by key serial id
|
// ""Id"": ""34-1516288681"", <----Customer id followed by key serial id
|
||||||
// ""RegisteredTo"": ""Super TestCo"",
|
// ""RegisteredTo"": ""Super TestCo"", or "REVOKED" if revoked
|
||||||
// ""DBID"": ""df558559-7f8a-4c7b-955c-959ebcdf71f3"",
|
// ""DBID"": ""df558559-7f8a-4c7b-955c-959ebcdf71f3"",
|
||||||
// ""LicenseExpiration"": ""2019-01-18T07:18:01.2329138-08:00"", <--- UTC, DateTime if perpetual license 1/1/5555 indicates not expiring
|
// ""LicenseExpiration"": ""2019-01-18T07:18:01.2329138-08:00"", <--- UTC, DateTime if perpetual license 1/1/5555 indicates not expiring
|
||||||
// ""MaintenanceExpiration"": ""2019-01-18T07:18:01.2329138-08:00"", <-- UTC, DateTime support and updates subscription runs out, applies to all features
|
// ""MaintenanceExpiration"": ""2019-01-18T07:18:01.2329138-08:00"", <-- UTC, DateTime support and updates subscription runs out, applies to all features
|
||||||
@@ -573,6 +584,14 @@ namespace AyaNova.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_ActiveLicense.Status == AyaNovaLicenseKey.LicenseStatus.Revoked)
|
||||||
|
{
|
||||||
|
var msg = $"E1020 - License key revoked";
|
||||||
|
apiServerState.SetSystemLock(msg);
|
||||||
|
log.LogCritical(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Has someone been trying funny business with the active techs in the db?
|
//Has someone been trying funny business with the active techs in the db?
|
||||||
if (await AyaNova.Biz.UserBiz.ActiveCountAsync() > _ActiveLicense.ActiveNumber)
|
if (await AyaNova.Biz.UserBiz.ActiveCountAsync() > _ActiveLicense.ActiveNumber)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user