maintenance expiration vs build date checking code
This commit is contained in:
@@ -799,7 +799,7 @@ namespace AyaNova.Core
|
||||
throw new ApplicationException("E1020 - Can't install a trial key into a non empty AyaNova database. Erase the database first.");
|
||||
}
|
||||
|
||||
//TODO: TECHCOUNT - new license causes exceeding count?
|
||||
//TECHCOUNT - new license causes exceeding count?
|
||||
long NewTechCount = ParsedNewKey.GetLicenseFeature(SERVICE_TECHS_FEATURE_NAME).Count;
|
||||
if (await AyaNova.Biz.UserBiz.ActiveCountAsync() > NewTechCount)
|
||||
{
|
||||
@@ -925,6 +925,15 @@ EQIDAQAB
|
||||
|
||||
|
||||
#endregion get values
|
||||
|
||||
//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))
|
||||
{
|
||||
Console.WriteLine("E1020 - Not licensed for this version of AyaNova. Fix: downgrade back to previous version in use or contact technical support for options.");
|
||||
|
||||
//NOTE: VERSION-TOO-NEW bit below is checked for in startup.cs DO NOT remove this without fixing the side effects
|
||||
throw new ApplicationException("E1020 VERSION-TOO-NEW - Not licensed for this version of AyaNova. Fix: downgrade back to previous version in use or contact technical support for options.");
|
||||
}
|
||||
//All is well return key
|
||||
return key;
|
||||
|
||||
@@ -942,6 +951,12 @@ EQIDAQAB
|
||||
|
||||
|
||||
|
||||
#region Validate Build date against maintenance date in license
|
||||
//MaintenanceExpirationBeforeBuild?
|
||||
internal static bool MExBB(DateTime dtB, AyaNovaLicenseKey k) => k.MaintenanceExpiration < dtB;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user