Allow login checked properly for license in subscription customer contact count check
This commit is contained in:
@@ -266,6 +266,13 @@ America/Los_Angeles
|
||||
Note: for test win64 build just copy the empty db files generated above (before any access is done) into the C:\data\code\raven\dist\win-x64\data\database folder
|
||||
|
||||
|
||||
## How to find the postgres data directory
|
||||
sudo -u postgres psql -c "show data_directory;"
|
||||
|
||||
## PSQL to nose around ayanova database
|
||||
sudo -u postgres psql
|
||||
https://www.postgresqltutorial.com/postgresql-administration/psql-commands/
|
||||
|
||||
## How fast is ayanova across the internet
|
||||
TEST: TEST digitalocean, set up a server in every data center far away from here, test ayanvoa on each one and see how peformant it is perceptually, i.e. does it even matter which server we're locating people on??
|
||||
Bangalore - seems almost undetectably the same as sanfran
|
||||
|
||||
@@ -34,38 +34,11 @@ WIP >>>>>>>>>>>>>
|
||||
|
||||
|
||||
|
||||
Status: updated on devlops to 8.0.7, testing first subscription HUGE generation...
|
||||
Status: Test recent change to customer login license check making new user or setting to active or setting to allowlogin
|
||||
Also in between times fixup the additional fields in product pages for sale see item in parallel work section below (and see if can change price on subscription or do I need to make a new one?)
|
||||
|
||||
|
||||
|
||||
todo: TEST subscription and perpetual license code LOCALLY "yes" / then posted hosted "YASS"
|
||||
|
||||
Does a trial request for sbuscription work? YES YASS
|
||||
Correct date range? YES YASS
|
||||
Generate data? YES YASS
|
||||
v8migrate work? YES YASS
|
||||
Can generate HUGE data set on trial? YES
|
||||
Can generaet small data set right after HUGE one? (test of delete empty database timeout issue) YES
|
||||
Does a trial request for perpetual work? YES
|
||||
correct date range? YES
|
||||
Generate data? YES
|
||||
v8migratework? YES
|
||||
Can generate HUGE data set on trial? YES
|
||||
Can generaet small data set right after HUGE one? YES (test of delete empty database timeout issue)
|
||||
|
||||
Can I bump a trial subscription and / or perptual expiration date if a trialer needs more time!!! IMPORTANT, this way can keep it brief but allow for wiggle
|
||||
YES BUT it must not be a TRIAL key, it can be a full key that is time restricted but not flagged trial as raven prevents a trial key being used with a non empty db
|
||||
|
||||
Does new boot code still work when no database? YES
|
||||
Does new boot code work to prevent running if wrong build or maint date expired vs build date?
|
||||
Does it prevent changing a user to active?
|
||||
Does it prevent changing a user type? (direct db meddling)
|
||||
Does it prevent installing a new license when too few for existing active?
|
||||
Does it communicate this well to the user?
|
||||
Test the living fuck out of this from the NEXT deployment before any hint of live posting as there are so many changes it's necessary
|
||||
|
||||
REBUILD POST TO NEXT TEST ALL OF ABOVE AGAIN ON HOSTED SERVER
|
||||
todo: Test how to revoke a license, I'm wondering if new code at license.cs is now preventing installing the revoke license
|
||||
|
||||
|
||||
NOTE: NOT RELEASABLE, MANUAL NEEDS TO BE UPDATED FIRST THEN CAN REBUILD AND POST
|
||||
|
||||
@@ -37,7 +37,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 as they consume resources if they can login
|
||||
internal static async Task<long> ActiveInternalUserCountAsync()
|
||||
{
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
@@ -51,6 +51,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
//This is where SUBSCRIPTION active CUSTOMER CONTACT license consumers are accounted for
|
||||
//NOTE: AllowLogin is checked here in addition to Active because we only care about potential LOGIN users here as they consume rental / subscription server resources
|
||||
internal static async Task<long> ActiveCustomerContactUserCountAsync()
|
||||
{
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
@@ -759,6 +760,7 @@ namespace AyaNova.Biz
|
||||
//Check the SUBSCRIPTION license allows this
|
||||
|
||||
//INTERNAL USERS
|
||||
//ACTIVE internal users consume a license in subscription mode
|
||||
if (!proposedObj.IsOutsideCustomerContactTypeUser && proposedObj.Active)
|
||||
{
|
||||
//Yes, it might be affected depending on things
|
||||
@@ -768,7 +770,7 @@ namespace AyaNova.Biz
|
||||
if (isNew)
|
||||
{
|
||||
//This operation is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveInternalUserCount, LicensedInternalUserCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveInternalUserCount, LicensedInternalUserCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -777,13 +779,14 @@ namespace AyaNova.Biz
|
||||
{
|
||||
//going from non inside to inside and/or to active
|
||||
//Yes, this is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveInternalUserCount, LicensedInternalUserCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveInternalUserCount, LicensedInternalUserCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//CUSTOMERS
|
||||
if (proposedObj.IsOutsideCustomerContactTypeUser && proposedObj.Active)
|
||||
//ACTIVE AND ALLOWLOGIN customer users consume a customer login license in subscription mode
|
||||
if (proposedObj.IsOutsideCustomerContactTypeUser && proposedObj.Active && proposedObj.AllowLogin)
|
||||
{
|
||||
//Yes, it might be affected depending on things
|
||||
long CurrentActiveCustomerContactUserCount = await UserBiz.ActiveCustomerContactUserCountAsync();
|
||||
@@ -792,16 +795,16 @@ namespace AyaNova.Biz
|
||||
if (isNew)
|
||||
{
|
||||
//This operation is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveCustomerContactUserCount, LicensedCustomerContactCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveCustomerContactUserCount, LicensedCustomerContactCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
//did anything that might affect licensing change?
|
||||
if (!currentObj.IsOutsideCustomerContactTypeUser || (!currentObj.Active))//currently not a customer contact user or if it is it's not active
|
||||
if (!currentObj.IsOutsideCustomerContactTypeUser || (!currentObj.Active)|| (!currentObj.AllowLogin))//currently not a customer contact user or if it is it's not active or wasn't set to allow login
|
||||
{
|
||||
//going from non customer contact to customer contact and or active (may not happen but better safe than sorry down the road some day)
|
||||
//going from non customer contact to customer contact and or active and or login (may not happen but better safe than sorry down the road some day)
|
||||
//Yes, this is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveCustomerContactUserCount, LicensedCustomerContactCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveCustomerContactUserCount, LicensedCustomerContactCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -817,7 +820,7 @@ namespace AyaNova.Biz
|
||||
if (isNew)
|
||||
{
|
||||
//This operation is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveTechCount, LicensedTechCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveTechCount, LicensedTechCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -826,7 +829,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
//going from non tech to tech and active
|
||||
//Yes, this is about to consume one more license, check that we are not at the limit already
|
||||
await AddErrorIfExcessUsersAnyBuildType(CurrentActiveTechCount, LicensedTechCount);
|
||||
await AddErrorIfAtLicenseLimitAnyBuildType(CurrentActiveTechCount, LicensedTechCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -957,7 +960,7 @@ namespace AyaNova.Biz
|
||||
return;
|
||||
}
|
||||
|
||||
private async Task AddErrorIfExcessUsersAnyBuildType(long CurrentActiveCount, long LicensedUserCount)
|
||||
private async Task AddErrorIfAtLicenseLimitAnyBuildType(long CurrentActiveCount, long LicensedUserCount)
|
||||
{
|
||||
if (CurrentActiveCount >= LicensedUserCount)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user