Password reset
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
@Html.EditorFor(m => m.Name)
|
||||
@Html.EditorFor(m => m.Email)
|
||||
@Html.EditorFor(m => m.Message)
|
||||
<input type="submit" id="submit-form" class="hidden"/>}
|
||||
<input type="submit" id="submit-form" class="d-none"/>}
|
||||
<label for="submit-form" class="btn btn-primary pull-right">Send</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
@using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
|
||||
{
|
||||
@Html.EditorFor(m => loginModel.Username)
|
||||
@Html.EditorFor(m => loginModel.Password, "Password")
|
||||
|
||||
@Html.EditorFor(m => loginModel.Password, "PasswordWithForgotLink")
|
||||
@Html.ValidationSummary("loginModel", true)
|
||||
|
||||
<button class="btn btn-primary pull-right">Login</button>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Html.RenderAction("PasswordReset", "Membership");
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Html.RenderAction("PasswordResetRequest", "Membership");
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using Umbraco.Web.Controllers
|
||||
<!-- https://24days.in/umbraco-cms/2015/membership-apis-investigation/ -->
|
||||
<!-- https://our.umbraco.com/forum/templates-partial-views-and-macros/93133-membership-provider-registration-form -->
|
||||
@{
|
||||
// https://24days.in/umbraco-cms/2015/membership-apis-investigation/
|
||||
// https://our.umbraco.com/forum/templates-partial-views-and-macros/93133-membership-provider-registration-form
|
||||
|
||||
var membershipHelper = new Umbraco.Web.Security.MembershipHelper(UmbracoContext.Current);
|
||||
var registerModel = membershipHelper.CreateRegistrationModel();
|
||||
|
||||
@@ -28,7 +29,7 @@
|
||||
}
|
||||
else if (user != null)
|
||||
{
|
||||
<p>No need to register - you are already logged withe email @user.Email</p>
|
||||
<p>No need to register - you are already logged with email @user.Email</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@model PasswordResetForm
|
||||
@{
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2);
|
||||
}
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 ">
|
||||
<p>Resetting password for @Model.Email</p>
|
||||
@Html.Partial("_ValidationSummary")
|
||||
|
||||
@using (Html.BeginUmbracoForm<MembershipController>("PasswordReset"))
|
||||
{
|
||||
@Html.HiddenFor(m => m.Email)
|
||||
@Html.HiddenFor(m => m.PasswordResetToken)
|
||||
@Html.EditorFor(m => m.Password)
|
||||
@Html.EditorFor(m => m.PasswordVerify)
|
||||
<input type="submit" id="submit-form" class="d-none"/>
|
||||
}
|
||||
<label for="submit-form" class="btn btn-primary pull-right">Reset</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@model PasswordResetRequestForm
|
||||
@{
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2);
|
||||
}
|
||||
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 ">
|
||||
@Html.Partial("_ValidationSummary")
|
||||
|
||||
@using (Html.BeginUmbracoForm<MembershipController>("PasswordResetRequest"))
|
||||
{
|
||||
@Html.EditorFor(m => m.Email)
|
||||
<input type="submit" id="submit-form" class="d-none"/>
|
||||
}
|
||||
<label for="submit-form" class="btn btn-primary pull-right">Send</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
@model object
|
||||
@{
|
||||
Layout = "_FieldLayout.cshtml";
|
||||
}
|
||||
@{
|
||||
var htmlAttributes = new RouteValueDictionary();
|
||||
|
||||
var controlClass = "form-control mb-0";
|
||||
|
||||
if (ViewBag.@class != null)
|
||||
{
|
||||
controlClass = string.Concat(controlClass, " ", ViewBag.@class);
|
||||
}
|
||||
|
||||
if (ViewData.ModelState.ContainsKey(ViewData.TemplateInfo.HtmlFieldPrefix) &&
|
||||
ViewData.ModelState[ViewData.TemplateInfo.HtmlFieldPrefix].Errors.Any())
|
||||
{
|
||||
controlClass = string.Concat(controlClass, " ", "is-invalid");
|
||||
}
|
||||
htmlAttributes.Add("class", controlClass);
|
||||
}
|
||||
|
||||
@Html.Password("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
|
||||
<p class="text-right pt-0 small">Forgot password? <a href="/membership/password-reset-request" class="small">Reset here</a></p>
|
||||
Reference in New Issue
Block a user