This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -53,7 +53,7 @@
|
|||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "true",
|
"AYANOVA_SERVER_TEST_MODE": "false",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
|
|||||||
@@ -177,6 +177,30 @@ namespace AyaNova.Api.Controllers
|
|||||||
return Ok(ApiOkResponse.Response(l));
|
return Ok(ApiOkResponse.Response(l));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get subset of translation values for specific translation Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inObj">List of translation key strings</param>
|
||||||
|
/// <returns>A key value array of translation text values</returns>
|
||||||
|
[HttpPost("subset/{id}")]
|
||||||
|
public async Task<IActionResult> SubSet([FromRoute] long id, [FromBody] List<string> inObj)
|
||||||
|
{
|
||||||
|
if (serverState.IsClosed)
|
||||||
|
{
|
||||||
|
//Exception for SuperUser account to handle licensing issues
|
||||||
|
if (UserIdFromContext.Id(HttpContext.Items) != 1)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Instantiate the business object handler
|
||||||
|
|
||||||
|
//Instantiate the business object handler
|
||||||
|
// TranslationBiz biz = TranslationBiz.GetBiz(ct, HttpContext);
|
||||||
|
|
||||||
|
var l = await TranslationBiz.GetSubsetStaticAsync(inObj, id);
|
||||||
|
return Ok(ApiOkResponse.Response(l));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Get the keys for a list of keys provided, static format for calling from other internal classes
|
//Get the keys for a list of keys provided, static format for calling from other internal classes
|
||||||
|
//and remotely when fetching for things like Password reset where the user isn't logged in yet but we know their translation id
|
||||||
internal static async Task<Dictionary<string, string>> GetSubsetStaticAsync(List<string> param, long translationId)
|
internal static async Task<Dictionary<string, string>> GetSubsetStaticAsync(List<string> param, long translationId)
|
||||||
{
|
{
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
@@ -354,7 +355,7 @@ namespace AyaNova.Biz
|
|||||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Name must be unique
|
//Name must be unique
|
||||||
if (await ct.Translation.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
|
if (await ct.Translation.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
|
||||||
|
|||||||
@@ -356,9 +356,10 @@ namespace AyaNova.Biz
|
|||||||
var TransDict = await TranslationBiz.GetSubsetStaticAsync(TransKeysRequired, EffectiveTranslationId);
|
var TransDict = await TranslationBiz.GetSubsetStaticAsync(TransKeysRequired, EffectiveTranslationId);
|
||||||
var Title = TransDict["PasswordResetMessageTitle"];
|
var Title = TransDict["PasswordResetMessageTitle"];
|
||||||
var MessageBody = TransDict["PasswordResetMessageBody"];
|
var MessageBody = TransDict["PasswordResetMessageBody"];
|
||||||
|
var loginName=Uri.EscapeDataString(dbObject.Login);
|
||||||
|
|
||||||
//Hello {user_name},\n\nYour online account for service is available to you after you set your password.\nYou can use the following link for the next 48 hours to set your password.\n\nSet your password: {action_link}\n\nIf you did not request an account or password reset, please ignore this email.\n\nThanks,\n{registered_to}"
|
//Hello {user_name},\n\nYour online account for service is available to you after you set your password.\nYou can use the following link for the next 48 hours to set your password.\n\nSet your password: {action_link}\n\nIf you did not request an account or password reset, please ignore this email.\n\nThanks,\n{registered_to}"
|
||||||
MessageBody = MessageBody.Replace("{user_name}", dbObject.Name).Replace("{action_url}", $"{ServerUrl}/reset?{ResetCode}").Replace("{registered_to}", AyaNova.Core.License.ActiveKey.RegisteredTo);
|
MessageBody = MessageBody.Replace("{user_name}", dbObject.Name).Replace("{action_link}", $"{ServerUrl}/home-reset?{ResetCode}&tr={EffectiveTranslationId}&lg={loginName}").Replace("{registered_to}", AyaNova.Core.License.ActiveKey.RegisteredTo);
|
||||||
IMailer m = AyaNova.Util.ServiceProviderProvider.Mailer;
|
IMailer m = AyaNova.Util.ServiceProviderProvider.Mailer;
|
||||||
|
|
||||||
await m.SendEmailAsync(dbObject.UserOptions.EmailAddress, Title, MessageBody, ServerGlobalOpsSettingsCache.Notify);
|
await m.SendEmailAsync(dbObject.UserOptions.EmailAddress, Title, MessageBody, ServerGlobalOpsSettingsCache.Notify);
|
||||||
|
|||||||
Reference in New Issue
Block a user