This commit is contained in:
2022-03-07 12:22:53 +00:00
parent 362aa31e15
commit 7271b54fba
39 changed files with 356 additions and 90 deletions
@@ -74,7 +74,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
keepLoggedIn = App.AppConfig.Security.SignIn.KeepLoggedIn.Allowed && keepLoggedIn;
// Log user in.
userAccount.KeepLoggedIn_Online = keepLoggedIn;
userAccount.KeepLoggedIn = keepLoggedIn;
userAccount.LastLoginAt = DateTime.Now;
userAccount.InvalidLoginCount = 0;
userAccount.LastInvalidLoginAt = DateTime.MinValue;
@@ -91,7 +91,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
RefreshSessionProfileSports();
// Send the 'Keep Logged In' cookie if requested.
if (userAccount.KeepLoggedIn_Online)
if (userAccount.KeepLoggedIn)
SetKeepLoggedInCookie();
return true;
@@ -12,7 +12,7 @@
<div class="sax-content">
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmChangePassword", @class = "sax-form" }))
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmChangePassword", @class = "sax-form", @onsubmit = "return false;" }))
{
@if (!Model.RequestPasswordMode)
@@ -11,7 +11,7 @@
<div class="sax-content">
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmRequestPassword", @class = "sax-form" }))
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmRequestPassword", @class = "sax-form", @onsubmit = "return false;" }))
{
<div class="spacer4"></div>
@@ -12,7 +12,7 @@
<div class="sax-content">
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmSignIn", @class = "sax-form" }))
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmSignIn", @class = "sax-form", @onsubmit = "return false;" }))
{
<div class="spacer4"></div>
@@ -46,7 +46,6 @@
<div class="row">
<div class="col-6">
@Html.CheckBoxFor(model => model.KeepMeSignedIn, new { @id = "chkKeepMeSignedIn" })
&nbsp;
<span class="sax-label pointer" onclick="$('#chkKeepMeSignedIn').click()">@Localiser["label.keep.signed.in"]</span>
</div>
<div class="col-6 right">
@@ -71,16 +71,19 @@
//--------------------------------------------------------------
$(function ()
{
sax.$frm.signIn = $('#frmSignIn');
$(':input:enabled:visible:first').focus();
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
$('#frmChangePassword #ifPassword').on('keyup', sax.doScorePassword);
sax.$prgPasswordStrength = $('#frmChangePassword #prgPasswordStrength').progressbar({ 'max': 5 });
$('#ifEmailAddress,#ifPassword', $('#frmSignIn')).on('keypress', function (e) { if (e.which == 13) sax.doSignin(); });
$('#frmSignIn #pbSignIn').on('click', function () { sax.doSignin(); });
$('#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', $('#frmChangePassword')).on('keypress', function (e) { if (e.which == 13) sax.doChangePassword(); });
$('#frmChangePassword #pbChangePassword').on('click', function () { sax.doChangePassword(); });
$('#ifEmailAddress', $('#frmRequestPassword')).on('keypress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
$('#frmRequestPassword #pbRequestPassword').on('click', function () { sax.doRequestPassword(); });
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
sax.$frm.signIn.on('click', '#pbSignIn', function () { sax.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sax.doSignin(); });
sax.$frm.changePassword = $('#frmChangePassword');
sax.$frm.changePassword.on('keypress', '#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.changePassword.on('keyup', '#ifPassword', sax.doScorePassword);
sax.$prgPasswordStrength = $('#prgPasswordStrength', sax.$frm.changePassword).progressbar({ 'max': 5 });
sax.$frm.changePassword.on('click', '#pbChangePassword', function () { sax.doChangePassword(); }).on('keypress', '#pbChangePassword', function (e) { if (e.which == 13) sax.doChangePassword(); });
sax.$frm.reqPword = $('#frmRequestPassword');
sax.$frm.reqPword.on('keypress', '#ifEmailAddress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
sax.$frm.reqPword.on('click', '#pbRequestPassword', function () { sax.doRequestPassword(); });
});
}(window, window.document));