Gets password resetting working and displaying the generated one in the UI.

This commit is contained in:
Shannon
2013-10-11 12:25:10 +11:00
parent b63135771e
commit b9975ad1f5
7 changed files with 69 additions and 32 deletions

View File

@@ -77,22 +77,27 @@ namespace Umbraco.Web.Models.Mapping
Label = ui.Text("login"),
Value = display.Username,
View = "textbox",
Config = new Dictionary<string, object> { { "IsRequired", true } }
Config = new Dictionary<string, object> {{"IsRequired", true}}
},
new ContentPropertyDisplay
{
Alias = string.Format("{0}password", Constants.PropertyEditors.InternalGenericPropertiesPrefix),
Label = ui.Text("password"),
Value = "",
View = "changepassword",//TODO: Hard coding this because the templatepicker doesn't necessarily need to be a resolvable (real) property editor
//NOTE: The value here is a json value - but the only property we care about is the generatedPassword one if it exists - this is the only value we'll ever supply to the front-end
Value = new Dictionary<string, object>
{
{"generatedPassword", member.AdditionalData.ContainsKey("GeneratedPassword") ? member.AdditionalData["GeneratedPassword"] : null}
},
//TODO: Hard coding this because the changepassword doesn't necessarily need to be a resolvable (real) property editor
View = "changepassword",
Config = new Dictionary<string, object>
{
//the password change toggle will only be displayed if there is already a password assigned.
{ "hasPassword", member.Password.IsNullOrWhiteSpace() == false },
{ "minPasswordLength", membershipProvider.MinRequiredPasswordLength },
{ "enableReset", membershipProvider.EnablePasswordReset },
{ "enablePasswordRetrieval" , membershipProvider.EnablePasswordRetrieval },
{ "requiresQuestionAnswer", membershipProvider.RequiresQuestionAndAnswer }
{"hasPassword", member.Password.IsNullOrWhiteSpace() == false},
{"minPasswordLength", membershipProvider.MinRequiredPasswordLength},
{"enableReset", membershipProvider.EnablePasswordReset},
{"enablePasswordRetrieval", membershipProvider.EnablePasswordRetrieval},
{"requiresQuestionAnswer", membershipProvider.RequiresQuestionAndAnswer}
//TODO: Inject the other parameters in here to change the behavior of this control - based on the membership provider settings.
}
},