Update to properly handle revoke licenses

This commit is contained in:
2022-08-29 15:26:30 +00:00
parent 9b7508afe3
commit da4255a531
3 changed files with 36 additions and 29 deletions

2
.vscode/launch.json vendored
View File

@@ -121,7 +121,7 @@
"AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_USE_URLS": "http://*:7575;",
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", //"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
//"AYANOVA_REMOVE_LICENSE_FROM_DB":"true", //"AYANOVA_REMOVE_LICENSE_FROM_DB":"true",
"AYANOVA_SERVER_TEST_MODE": "true", //"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin" "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin"

View File

@@ -34,12 +34,14 @@ WIP >>>>>>>>>>>>>
Status: Test recent change to customer login license check making new user or setting to active or setting to allowlogin Status:
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?) 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 how to revoke a license, I'm wondering if new code at license.cs is now preventing installing the revoke license todo: Test how to revoke a license, I'm wondering if new code at license.cs is now preventing installing the revoke license
todo: expired license does it stop notifying and jobs??
I think all jobs should stop and not be processed except for the license fetching job
NOTE: NOT RELEASABLE, MANUAL NEEDS TO BE UPDATED FIRST THEN CAN REBUILD AND POST NOTE: NOT RELEASABLE, MANUAL NEEDS TO BE UPDATED FIRST THEN CAN REBUILD AND POST

View File

@@ -901,6 +901,10 @@ namespace AyaNova.Core
throw new ApplicationException("E1020 - Can't install a trial key into a non empty AyaNova database. Erase the database first."); throw new ApplicationException("E1020 - Can't install a trial key into a non empty AyaNova database. Erase the database first.");
} }
//Only check quantities if it's not a revoke token which should always pass through
if (ParsedNewKey.RegisteredTo != REVOKED_TOKEN)
{
#if (SUBSCRIPTION_BUILD) #if (SUBSCRIPTION_BUILD)
//SUBSCRIPTION USER COUNTS - new license causes exceeding counts? //SUBSCRIPTION USER COUNTS - new license causes exceeding counts?
@@ -939,7 +943,7 @@ namespace AyaNova.Core
throw new ApplicationException("E1020 - Can't install key, too many active techs and / or subcontractors in database. Deactivate enough to install key."); throw new ApplicationException("E1020 - Can't install key, too many active techs and / or subcontractors in database. Deactivate enough to install key.");
} }
#endif #endif
}
//Update current license //Update current license
@@ -1063,7 +1067,8 @@ EQIDAQAB
#endregion get values #endregion get values
if (key.RegisteredTo != REVOKED_TOKEN)
{
//Check if attempting to use a build of AyaNova that is newer than maintenance subscription expiry //Check if attempting to use a build of AyaNova that is newer than maintenance subscription expiry
if (MExBB(Util.FileUtil.GetLinkerTimestampUtc(System.Reflection.Assembly.GetExecutingAssembly()), key)) if (MExBB(Util.FileUtil.GetLinkerTimestampUtc(System.Reflection.Assembly.GetExecutingAssembly()), key))
{ {
@@ -1091,7 +1096,7 @@ EQIDAQAB
} }
#endif #endif
}
//All is well return key //All is well return key
return key; return key;