This commit is contained in:
@@ -151,7 +151,7 @@ namespace Sockeye.Biz
|
||||
|
||||
|
||||
// Extra info to display about key at top of key message
|
||||
private static string LicenseInfo(License l)
|
||||
public static string LicenseInfo(License l)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("LICENSE DETAILS\r\n");
|
||||
|
||||
@@ -43,9 +43,9 @@ namespace Sockeye.Biz
|
||||
//
|
||||
internal async Task<License> CreateAsync(License newObject, bool importedWithKeyDoNotGenerate = false)
|
||||
{
|
||||
//client can send a non expiring license key but internally it MUST have a date so the
|
||||
//client can send a non expiring license key but internally it MUST have a date if it's RAVEN so the
|
||||
//raven default for non expiring keys is this
|
||||
if (newObject.LicenseExpire == null && !newObject.TrialMode)
|
||||
if (newObject.LicenseExpire == null && !newObject.TrialMode && newObject.PGroup != ProductGroup.AyaNova7)
|
||||
{
|
||||
newObject.LicenseExpire = DateUtil.EmptyDateValueForLicenseGeneration;
|
||||
}
|
||||
@@ -112,16 +112,16 @@ namespace Sockeye.Biz
|
||||
}
|
||||
|
||||
putObject.Tags = TagBiz.NormalizeTags(putObject.Tags);
|
||||
//client can send a non expiring license key but internally it MUST have a date so the
|
||||
//client can send a non expiring license key but internally it MUST have a date (RAVEN ONLY) so the
|
||||
//raven default for non expiring keys is this
|
||||
if (putObject.LicenseExpire == null && !putObject.TrialMode)
|
||||
if (putObject.LicenseExpire == null && !putObject.TrialMode && putObject.PGroup != ProductGroup.AyaNova7)
|
||||
{
|
||||
putObject.LicenseExpire = DateUtil.EmptyDateValueForLicenseGeneration;
|
||||
}
|
||||
await ValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
|
||||
if(putObject.Active)
|
||||
|
||||
if (putObject.Active)
|
||||
await GenerateKey(putObject);
|
||||
if (HasErrors) return null;
|
||||
|
||||
@@ -166,23 +166,23 @@ namespace Sockeye.Biz
|
||||
//## ------------------ DEFAULT NOTIFICATIONS TO CUSTOMER ON LICENSE AVAILABLE ----------------
|
||||
|
||||
string body = string.Empty;
|
||||
|
||||
var licenseInfo = KeyFactory.LicenseInfo(l);
|
||||
switch (l.PGroup)
|
||||
{
|
||||
case ProductGroup.AyaNova7:
|
||||
if (l.TrialMode)
|
||||
{
|
||||
body = ServerGlobalBizSettings.Cache.V7TemporaryTrial;
|
||||
body = ServerGlobalBizSettings.Cache.V7TemporaryTrial.Replace("{LicenseDescription}", licenseInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (l.Renewal)
|
||||
{
|
||||
body = ServerGlobalBizSettings.Cache.V7AddOnKey;
|
||||
body = ServerGlobalBizSettings.Cache.V7AddOnKey.Replace("{LicenseDescription}", licenseInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
body = ServerGlobalBizSettings.Cache.V7NewKey;
|
||||
body = ServerGlobalBizSettings.Cache.V7NewKey.Replace("{LicenseDescription}", licenseInfo);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -202,8 +202,8 @@ namespace Sockeye.Biz
|
||||
ActiveInternalUsers: 3
|
||||
*/
|
||||
|
||||
var licenseInfo = $"Registered to: {l.RegTo}\nDatabase Id: {l.DbId}\nType: Perpetual\nSupport and updates until: {l.MaintenanceExpire.ToLongDateString()}\nUsers:{l.Users}";
|
||||
body = ServerGlobalBizSettings.Cache.RavenNewKeyAvailable.Replace("{newLicense}", licenseInfo);
|
||||
var RavLicenseInfo = $"Registered to: {l.RegTo}\nDatabase Id: {l.DbId}\nType: Perpetual\nSupport and updates until: {l.MaintenanceExpire.ToLongDateString()}\nUsers:{l.Users}";
|
||||
body = ServerGlobalBizSettings.Cache.RavenNewKeyAvailable.Replace("{newLicense}", RavLicenseInfo);
|
||||
}
|
||||
break;
|
||||
case ProductGroup.RavenSubscription:
|
||||
@@ -224,8 +224,8 @@ ActiveCustomerUsers: 250
|
||||
MaximumDataGB: 20
|
||||
*/
|
||||
|
||||
var licenseInfo = $"Registered to: {l.RegTo}\nDatabase Id: {l.DbId}\nType: Subscription\nAvailable for use until: {((DateTime)l.LicenseExpire).ToLongDateString()}\nUsers:{l.Users}\nCustomer login Users:{l.CustomerUsers}\nMaximum data GB:{l.MaxDataGB}";
|
||||
body = ServerGlobalBizSettings.Cache.RavenNewKeyAvailable.Replace("{newLicense}", licenseInfo);
|
||||
var RavLicenseInfo = $"Registered to: {l.RegTo}\nDatabase Id: {l.DbId}\nType: Subscription\nAvailable for use until: {((DateTime)l.LicenseExpire).ToLongDateString()}\nUsers:{l.Users}\nCustomer login Users:{l.CustomerUsers}\nMaximum data GB:{l.MaxDataGB}";
|
||||
body = ServerGlobalBizSettings.Cache.RavenNewKeyAvailable.Replace("{newLicense}", RavLicenseInfo);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -829,6 +829,11 @@ MaximumDataGB: 20
|
||||
}
|
||||
|
||||
|
||||
if (proposedObj.LicenseExpire == null && proposedObj.TrialMode)
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "LicenseExpire", "TRIAL MODE REQUIRES EXPIRY");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Active state rules for each product group
|
||||
@@ -863,7 +868,7 @@ MaximumDataGB: 20
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//RAVEN keys *always* expire
|
||||
|
||||
Reference in New Issue
Block a user