This commit is contained in:
2021-06-25 11:20:18 +01:00
parent e40ff8a7f2
commit 03873bbdf4
126 changed files with 3836 additions and 175 deletions
@@ -26,8 +26,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Sign-in request.
//-------------------------------------------------------------------
public class AjaxResponse_Signin : AjaxResponse_Data
private class AjaxResponse_Signin : AjaxResponse_Data
{
// Construction.
public AjaxResponse_Signin(SaxModel_Admin model) : base(model) { }
}
// Ajax request.
[HttpPost]
@@ -35,7 +37,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
public IActionResult Ajax_Signin(Model_Security model)
{
String fn = GetType().Name + ".Ajax_Signin";
AjaxResponse_Signin responseData = new AjaxResponse_Signin();
AjaxResponse_Signin responseData = new AjaxResponse_Signin(model);
String messageTitle = Localiser["signin.caption"];
// Validate Sign-in data.
@@ -63,7 +65,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Keep Logged In.
//-------------------------------------------------------------------
public class AjaxResponse_KeepLoggedIn : AjaxResponse_Base
private class AjaxResponse_KeepLoggedIn : AjaxResponse_Base
{
}
// Ajax request.
@@ -147,8 +149,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Sign-out request.
//-------------------------------------------------------------------
public class AjaxResponse_SignOut : AjaxResponse_Data
private class AjaxResponse_SignOut : AjaxResponse_Data
{
// Construction.
public AjaxResponse_SignOut(SaxModel_Admin model) : base(model) { }
}
// Ajax request.
[HttpPost]
@@ -156,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
public ActionResult Ajax_SignOut(Model_Security model)
{
String fn = GetType().Name + ".Ajax_SignOut";
AjaxResponse_SignOut responseData = new AjaxResponse_SignOut();
AjaxResponse_SignOut responseData = new AjaxResponse_SignOut(model);
String messageTitle = Localiser["signin.caption.signout"];
// User must have a valid session.
@@ -187,7 +191,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Password complexity request.
//-------------------------------------------------------------------
public class AjaxResponse_PasswordScore : AjaxResponse_Data
private class AjaxResponse_PasswordScore : AjaxResponse_Base
{
public int Score { get; set; }
}
@@ -209,8 +213,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Change Password request.
//-------------------------------------------------------------------
public class AjaxResponse_ChangePassword : AjaxResponse_Data
private class AjaxResponse_ChangePassword : AjaxResponse_Data
{
// Construction.
public AjaxResponse_ChangePassword(SaxModel_Admin model) : base(model) { }
}
// Ajax request.
[HttpPost]
@@ -218,7 +224,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
public ActionResult Ajax_StorePassword(Model_Security model)
{
String fn = GetType().Name + ".Ajax_StorePassword";
AjaxResponse_ChangePassword responseData = new AjaxResponse_ChangePassword();
AjaxResponse_ChangePassword responseData = new AjaxResponse_ChangePassword(model);
String messageTitle = Localiser["security.caption.change.password"];
// If 'Request Password' encrypted params (from email link) are present,
@@ -300,8 +306,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
//-------------------------------------------------------------------
// Request Password request.
//-------------------------------------------------------------------
public class AjaxResponse_RequestPassword : AjaxResponse_Data
private class AjaxResponse_RequestPassword : AjaxResponse_Data
{
// Construction.
public AjaxResponse_RequestPassword(SaxModel_Admin model) : base(model) { }
/// <summary>Message to be displayed for the user to 'OK' before returning to the Sign-in page.</summary>
public String SuccessMsg { get; set; }
}
@@ -311,7 +319,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
public ActionResult Ajax_RequestNewPassword(Model_Security model)
{
String fn = GetType().Name + ".Ajax_RequestNewPassword";
AjaxResponse_RequestPassword responseData = new AjaxResponse_RequestPassword();
AjaxResponse_RequestPassword responseData = new AjaxResponse_RequestPassword(model);
String messageTitle = Localiser["security.caption.request.password"];
// Validate data.
@@ -391,7 +399,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
int expiresMinutes_Max = Sax.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Max;
return Math.Max(expiresMinutes_Min, Math.Min(expiresMinutes_Max, expiresMinutes));
}
public class RequestPasswordParams
private class RequestPasswordParams
{
public SysId UserAccountId { get; set; }
public String EmailAddress { get; set; }