This commit is contained in:
2022-08-23 17:04:03 +00:00
parent 0016204582
commit ae3d576d40
2 changed files with 29 additions and 22 deletions

View File

@@ -37,26 +37,13 @@ todo: register domain name myayanova.com for hanging subscriber servers off of
todo: Update raven license code in subscription mode to check for total active User count instead of tech count todo: TEST subscription and perpetual license code
and business rules, like search for teh tech thing and parallel it to the User thing Does it prevent changing a user to active?
if ($("#perpetual").prop("checked")) { Does it prevent changing a user type? (direct db meddling)
features.push({ Does it prevent installing a new license when too few for existing active?
Feature: "ServiceTechs", <----------------- Does it communicate this well to the user?
Count: Number($("#techcount").val())
});
} else {
features.push({
Feature: "ActiveInternalUsers", <-----------------
Count: Number($("#subusercount").val())
});
features.push({
Feature: "ActiveCustomerUsers", <-----------------
Count: Number($("#subcustcount").val())
});
}
todo: update raven license check code to count active customer contact users as a business rule
mimic user/tech check
todo: update the test servers whichever are around, I've done my dev test.helloayanova.com, but should also do a261 and the eval ones todo: update the test servers whichever are around, I've done my dev test.helloayanova.com, but should also do a261 and the eval ones

View File

@@ -56,14 +56,34 @@ namespace AyaNova.Biz
dtDeleteCutoff = DateTime.UtcNow - INTERNAL_JOBS_LOGS_DELETE_AFTER_THIS_TIMESPAN; dtDeleteCutoff = DateTime.UtcNow - INTERNAL_JOBS_LOGS_DELETE_AFTER_THIS_TIMESPAN;
await SweepInternalJobsLogsAsync(ct, dtDeleteCutoff); await SweepInternalJobsLogsAsync(ct, dtDeleteCutoff);
//Stealthy check of user count exceeded
if (await UserBiz.ActiveTechUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveTechsCount) //In flight check of user count exceeded in case someone meddled in the DB Directly
#if (SUBSCRIPTION_BUILD)
if (await AyaNova.Biz.UserBiz.ActiveInternalUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveInternalUsersCount)
{
var msg = $"{AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR} (internal staff User count)";
AyaNova.Util.ServiceProviderProvider.ServerState.SetSystemLock(msg);
log.LogCritical(msg);
return;
}
if (await AyaNova.Biz.UserBiz.ActiveCustomerContactUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveCustomerContactUsersCount)
{
var msg = $"{AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR} (Customer Contact User count)";
AyaNova.Util.ServiceProviderProvider.ServerState.SetSystemLock(msg);
log.LogCritical(msg);
return;
}
#else
if (await UserBiz.ActiveTechUserCountAsync() > AyaNova.Core.License.ActiveKey.ActiveTechsCount)
{ {
//Warning: magic string, do not change this, triggers special login procedures to fix license issue //Warning: magic string, do not change this, triggers special login procedures to fix license issue
AyaNova.Util.ServiceProviderProvider.ServerState.SetSystemLock(AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR); AyaNova.Util.ServiceProviderProvider.ServerState.SetSystemLock(AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR);
log.LogCritical(AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR); log.LogCritical(AyaNova.Core.License.SERVER_STATE_LOCKOUT_DUE_TO_LICENSE_EXCEEDED_CAPACITY_ERROR);
return; return;
} }
#endif
} }
lastSweep = DateTime.UtcNow; lastSweep = DateTime.UtcNow;