mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added config to disable password resets.
This commit is contained in:
parent
ca3b2089ae
commit
e66d2fcd06
@ -20,7 +20,10 @@
|
||||
<input id="loginRememberMe" type="checkbox" value="true" name="Login.RememberMe" data-val-required="The Remember Me field is required." data-val="true" /><input name="Login.RememberMe" type="hidden" value="false"> Remember Me
|
||||
</label>
|
||||
</div>
|
||||
<p class="text-center"><a href="@Url.SubRouteUrl("user", "User.ResetPassword")">Forgotten Password?</a></p>
|
||||
@if (Model.Config.UserConfig.PasswordResetEnabled)
|
||||
{
|
||||
<p class="text-center"><a href="@Url.SubRouteUrl("user", "User.ResetPassword")">Forgotten Password?</a></p>
|
||||
}
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-primary" id="loginSubmit" type="submit" name="Login.Submit">Sign In</button>
|
||||
</div>
|
||||
|
@ -6,19 +6,26 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="text-center">
|
||||
<h1>Reset Password</h1>
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<form role="form" id="reset_pass_send" action="@Url.SubRouteUrl("user", "User.Action", new { action = "SendResetPasswordVerification" })" method="post" accept-charset="UTF-8">
|
||||
<div class="form-group">
|
||||
<label for="reset_username">Username</label>
|
||||
<input type="text" class="form-control" id="reset_username" value="@Model.Username" placeholder="Username" name="reset_username" />
|
||||
<span id="helpBlock" class="help-block">Send a temporary link to your recovery email to reset your password.</span>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-primary" id="reset_pass_send_submit" type="submit" name="reset_pass_send_submit">Send Reset Link</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@if (Model.Config.UserConfig.PasswordResetEnabled)
|
||||
{
|
||||
<h1>Reset Password</h1>
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<form role="form" id="reset_pass_send" action="@Url.SubRouteUrl("user", "User.Action", new { action = "SendResetPasswordVerification" })" method="post" accept-charset="UTF-8">
|
||||
<div class="form-group">
|
||||
<label for="reset_username">Username</label>
|
||||
<input type="text" class="form-control" id="reset_username" value="@Model.Username" placeholder="Username" name="reset_username" />
|
||||
<span id="helpBlock" class="help-block">Send a temporary link to your recovery email to reset your password.</span>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-primary" id="reset_pass_send_submit" type="submit" name="reset_pass_send_submit">Send Reset Link</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h3>Password Resets are Disabled</h3>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,27 +6,34 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="text-center">
|
||||
<h1>@(Model.Success ? "Reset Your Password" : "Invalid Password Reset Verification")</h1>
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
@if (Model.Success)
|
||||
{
|
||||
<form role="form" id="setNewPass" action="@Url.SubRouteUrl("user", "User.Action", new { action = "SetUserPassword" })" method="post" accept-charset="UTF-8">
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="setNewPass_Password" value="" placeholder="Password" name="setNewPass_Password" data-val-required="The Password field is required." data-val="true" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="setNewPass_ConfirmPassword" value="" placeholder="Confirm Password" name="setNewPass_ConfirmPassword" data-val-required="The Confirm Password field is required." data-val="true" />
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-primary" id="setNewPass_submit" type="submit" name="setNewPass_submit">Reset Password</button>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>The verification you provided is not valid. Please check the URL and try again.</p>
|
||||
}
|
||||
</div>
|
||||
@if (Model.Config.UserConfig.PasswordResetEnabled)
|
||||
{
|
||||
<h1>@(Model.Success ? "Reset Your Password" : "Invalid Password Reset Verification")</h1>
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
@if (Model.Success)
|
||||
{
|
||||
<form role="form" id="setNewPass" action="@Url.SubRouteUrl("user", "User.Action", new { action = "SetUserPassword" })" method="post" accept-charset="UTF-8">
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="setNewPass_Password" value="" placeholder="Password" name="setNewPass_Password" data-val-required="The Password field is required." data-val="true" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="setNewPass_ConfirmPassword" value="" placeholder="Confirm Password" name="setNewPass_ConfirmPassword" data-val-required="The Confirm Password field is required." data-val="true" />
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-primary" id="setNewPass_submit" type="submit" name="setNewPass_submit">Reset Password</button>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>The verification you provided is not valid. Please check the URL and try again.</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h3>Password Resets are Disabled</h3>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,6 +10,7 @@ namespace Teknik.Configuration
|
||||
{
|
||||
public bool RegistrationEnabled { get; set; }
|
||||
public bool LoginEnabled { get; set; }
|
||||
public bool PasswordResetEnabled { get; set; }
|
||||
public string UsernameFilter { get; set; }
|
||||
public string UsernameFilterLabel { get; set; }
|
||||
public int MinUsernameLength { get; set; }
|
||||
@ -20,6 +21,7 @@ namespace Teknik.Configuration
|
||||
{
|
||||
RegistrationEnabled = true;
|
||||
LoginEnabled = true;
|
||||
PasswordResetEnabled = true;
|
||||
UsernameFilter = "^[a-zA-Z0-9_-]+(?:\\.[a-zA-Z0-9_-]+)*$";
|
||||
UsernameFilterLabel = "AlphaNumeric Characters with Dashes, Underlines, and 0-1 Periods not in the beginning or end.";
|
||||
MinUsernameLength = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user