This commit is contained in:
@@ -38,7 +38,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
//This is where SUBSCRIPTION active internal (non customer) license consumers are accounted for
|
//This is where SUBSCRIPTION active internal (non customer) license consumers are accounted for
|
||||||
internal static async Task<long> ActiveInsideUserCountAsync()
|
internal static async Task<long> ActiveInternalUserCountAsync()
|
||||||
{
|
{
|
||||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||||
{
|
{
|
||||||
@@ -757,7 +757,7 @@ namespace AyaNova.Biz
|
|||||||
//Yes, it might be affected depending on things
|
//Yes, it might be affected depending on things
|
||||||
long CurrentActiveCount = await UserBiz.ActiveTechUserCountAsync();
|
long CurrentActiveCount = await UserBiz.ActiveTechUserCountAsync();
|
||||||
HERE
|
HERE
|
||||||
long LicensedUserCount = AyaNova.Core.License.ActiveKey.ActiveNumber;
|
long LicensedUserCount = AyaNova.Core.License.ActiveKey.ActiveTechsCount;
|
||||||
|
|
||||||
if (isNew)
|
if (isNew)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace AyaNova.Biz
|
|||||||
await SweepInternalJobsLogsAsync(ct, dtDeleteCutoff);
|
await SweepInternalJobsLogsAsync(ct, dtDeleteCutoff);
|
||||||
|
|
||||||
//Stealthy check of user count exceeded
|
//Stealthy check of user count exceeded
|
||||||
if (await UserBiz.ActiveTechUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveNumber)
|
if (await UserBiz.ActiveTechUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveTechsCount)
|
||||||
{
|
{
|
||||||
HERE
|
HERE
|
||||||
//WARNING: DO not change the text of this message without also
|
//WARNING: DO not change the text of this message without also
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace AyaNova.Core
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long ActiveNumber
|
public long ActiveTechsCount
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -146,6 +146,22 @@ namespace AyaNova.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long ActiveInternalUsersCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GetLicenseFeature(ACTIVE_INTERNAL_USERS_FEATURE_NAME).Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public long ActiveCustomerContactUsersCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GetLicenseFeature(ACTIVE_CUSTOMER_USERS_FEATURE_NAME).Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check for the existance of license feature
|
/// Check for the existance of license feature
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -758,8 +774,27 @@ namespace AyaNova.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HERE
|
#if (SUBSCRIPTION_BUILD)
|
||||||
//Has someone been trying funny business with the active techs in the db?
|
|
||||||
|
if (await AyaNova.Biz.UserBiz.ActiveInternalUserCountAsync() > _ActiveLicense.ActiveInternalUsersCount)
|
||||||
|
{
|
||||||
|
var msg = $"E1020 - Active internal staff User count exceeded licensed capacity";
|
||||||
|
apiServerState.SetSystemLock(msg);
|
||||||
|
log.LogCritical(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (await AyaNova.Biz.UserBiz.ActiveCustomerContactUserCountAsync() > _ActiveLicense.ActiveCustomerContactUsersCount)
|
||||||
|
{
|
||||||
|
var msg = $"E1020 - Active Customer Contact User count exceeded licensed capacity";
|
||||||
|
apiServerState.SetSystemLock(msg);
|
||||||
|
log.LogCritical(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#else
|
||||||
if (await AyaNova.Biz.UserBiz.ActiveTechUserCountAsync() > _ActiveLicense.ActiveNumber)
|
if (await AyaNova.Biz.UserBiz.ActiveTechUserCountAsync() > _ActiveLicense.ActiveNumber)
|
||||||
{
|
{
|
||||||
var msg = $"E1020 - Active count exceeded capacity";
|
var msg = $"E1020 - Active count exceeded capacity";
|
||||||
@@ -767,6 +802,9 @@ HERE
|
|||||||
log.LogCritical(msg);
|
log.LogCritical(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
//Has someone been trying funny business with the active techs in the db?
|
||||||
|
|
||||||
|
|
||||||
//Key is ok, might not have been on first boot so check and clear if locked
|
//Key is ok, might not have been on first boot so check and clear if locked
|
||||||
//This works for now because system lock only means license lock
|
//This works for now because system lock only means license lock
|
||||||
|
|||||||
Reference in New Issue
Block a user