Improving lost password functionality

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-11-30 17:19:13 -08:00
parent 4a474fffac
commit 081a3dc53b
13 changed files with 168 additions and 29 deletions

View File

@@ -6,6 +6,11 @@
@using (Html.BeginFormAntiForgeryPost()) {
<fieldset>
<legend>@T("Account Information")</legend>
<div>
<label for="currentPassword">@T("Current password:")</label>
@Html.Password("currentPassword")
@Html.ValidationMessage("currentPassword")
</div>
<div>
<label for="newPassword">@T("New password:")</label>
@Html.Password("newPassword")

View File

@@ -3,13 +3,14 @@
@{
var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
var enableLostPassword = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().EnableLostPassword;
}
<h1 class="page-title">@Html.TitleForPage(Model.Title)</h1>
<p>
@T("Please enter your username and password.")
@if(userCanRegister) { @Html.ActionLink(T("Register").Text, "Register") @T(" if you don't have an account.") }
@Html.ActionLink(T("Lost your Password?").Text, "LostPassword")
@if(enableLostPassword) { @Html.ActionLink(T("Lost your Password?").Text, "RequestLostPassword") }
</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())

View File

@@ -1,15 +1,23 @@
<h1>@Html.TitleForPage(T("Lost Password").ToString())</h1>
<p>@T("Please enter your username or email address. You will receive a link to create a new password via email.")</p>
@model dynamic
<h1>@Html.TitleForPage(T("Change Password").ToString()) </h1>
<p>@T("Use the form below to change your password.")</p>
<p>@T("New passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"] as string) </p>
@Html.ValidationSummary(T("Password change was unsuccessful. Please correct the errors and try again.").ToString())
@using (Html.BeginFormAntiForgeryPost()) {
<fieldset>
<legend>@T("Account Information")</legend>
<div>
<label for="username">@T("Username or E-mail:")</label>
@Html.TextBox("username")
@Html.ValidationMessage("username")
<label for="newPassword">@T("New password:")</label>
@Html.Password("newPassword")
@Html.ValidationMessage("newPassword")
</div>
<div>
<button class="primaryAction" type="submit">@T("Send Request")</button>
<label for="confirmPassword">@T("Confirm new password:")</label>
@Html.Password("confirmPassword")
@Html.ValidationMessage("confirmPassword")
</div>
<div>
<button class="primaryAction" type="submit">@T("Change Password")</button>
</div>
</fieldset>
}

View File

@@ -0,0 +1,15 @@
<h1>@Html.TitleForPage(T("Lost Password").ToString())</h1>
<p>@T("Please enter your username or email address. You will receive a link to create a new password via email.")</p>
@using (Html.BeginFormAntiForgeryPost()) {
<fieldset>
<legend>@T("Account Information")</legend>
<div>
<label for="username">@T("Username or E-mail:")</label>
@Html.TextBox("username")
@Html.ValidationMessage("username")
</div>
<div>
<button class="primaryAction" type="submit">@T("Send Request")</button>
</div>
</fieldset>
}

View File

@@ -7,6 +7,11 @@
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.UsersCanRegister)">@T("Users can create new accounts on the site")</label>
@Html.ValidationMessage("UsersCanRegister", "*")
</div>
<div>
@Html.EditorFor(m => m.EnableLostPassword)
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.EnableLostPassword)">@T("Display a link to enable users to reset their email")</label>
@Html.ValidationMessage("EnableLostPassword", "*")
</div>
<div>
@Html.EditorFor(m => m.UsersMustValidateEmail)
<label class="forcheckbox" for="@Html.FieldIdFor( m => m.UsersMustValidateEmail)">@T("Users must verify their email address")</label>