--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-07-11 15:57:58 -07:00
9 changed files with 19 additions and 18 deletions

View File

@@ -26,10 +26,7 @@ namespace Orchard.Tests.Modules.Settings.Blueprint {
public string LastMessageName { get; set; }
public IDictionary<string, object> LastEventData { get; set; }
public void Notify_Obsolete(string messageName, IDictionary<string, string> eventData) {
}
public IEnumerable Notify(string messageName, Dictionary<string, object> eventData) {
public IEnumerable Notify(string messageName, IDictionary<string, object> eventData) {
LastMessageName = messageName;
LastEventData = eventData;
return new object[0];

View File

@@ -9,6 +9,7 @@ namespace Orchard.Users.Models {
public virtual string Password { get; set; }
public virtual MembershipPasswordFormat PasswordFormat { get; set; }
public virtual string HashAlgorithm { get; set; }
public virtual string PasswordSalt { get; set; }
}
}

View File

@@ -39,6 +39,7 @@ namespace Orchard.Users.Services {
init.Record.UserName = createUserParams.Username;
init.Record.Email = createUserParams.Email;
init.Record.NormalizedUserName = createUserParams.Username.ToLower();
init.Record.HashAlgorithm = "SHA1";
SetPassword(init.Record, createUserParams.Password);
});
}
@@ -128,7 +129,7 @@ namespace Orchard.Users.Services {
var combinedBytes = saltBytes.Concat(passwordBytes).ToArray();
var hashAlgorithm = HashAlgorithm.Create("SHA1");
var hashAlgorithm = HashAlgorithm.Create(record.HashAlgorithm);
var hashBytes = hashAlgorithm.ComputeHash(combinedBytes);
record.PasswordFormat = MembershipPasswordFormat.Hashed;
@@ -144,7 +145,7 @@ namespace Orchard.Users.Services {
var combinedBytes = saltBytes.Concat(passwordBytes).ToArray();
var hashAlgorithm = HashAlgorithm.Create("SHA1");
var hashAlgorithm = HashAlgorithm.Create(record.HashAlgorithm);
var hashBytes = hashAlgorithm.ComputeHash(combinedBytes);
return record.Password == Convert.ToBase64String(hashBytes);

View File

@@ -172,9 +172,10 @@ caption { background: #eee; }
-------------------------------------------------------------- */
label { font-weight: normal; }
fieldset { padding:0em; margin: 0 0 0em 0; border: 0px solid #ccc; }
legend { font-weight: bold; font-size:1.2em; }
label { font-weight: normal; display:block; }
label.forcheckbox { margin:0 0 0 4px; display:inline; }
fieldset { padding:0em; margin: 0 0 0em 0; border: 0px solid #ccc; }
legend { font-weight: bold; font-size:1.2em; }
/* Form fields

View File

@@ -9,7 +9,7 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
<fieldset class="login-form">
<legend><%: T("Account Information")%></legend>
<div class="group">
<label for="username"><%: T("Username:")%></label>
<label for="userNameOrEmail"><%: T("Username:")%></label>
<%: Html.TextBox("userNameOrEmail", "", new { autofocus = "autofocus" })%>
<%: Html.ValidationMessage("userNameOrEmail")%>
</div>

View File

@@ -170,9 +170,10 @@ caption { background: #eee; }
-------------------------------------------------------------- */
label { font-weight: normal; }
fieldset { padding:0em; margin: 0 0 0em 0; border: 0px solid #ccc; }
legend { font-weight: bold; font-size:1.2em; }
label { font-weight: normal; display:block; }
label.forcheckbox { margin:0 0 0 4px; display:inline; }
fieldset { padding:0em; margin: 0 0 0em 0; border: 0px solid #ccc; }
legend { font-weight: bold; font-size:1.2em; }
/* Form fields

View File

@@ -9,7 +9,7 @@ using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Reques
<fieldset class="login-form">
<legend><%: T("Account Information")%></legend>
<div class="group">
<label for="username"><%: T("Username:")%></label>
<label for="userNameOrEmail"><%: T("Username:")%></label>
<%: Html.TextBox("userNameOrEmail", "", new { autofocus = "autofocus" })%>
<%: Html.ValidationMessage("userNameOrEmail")%>
</div>

View File

@@ -20,12 +20,12 @@ namespace Orchard.Events {
public Localizer T { get; set; }
public IEnumerable Notify(string messageName, Dictionary<string, object> eventData) {
public IEnumerable Notify(string messageName, IDictionary<string, object> eventData) {
// call ToArray to ensure evaluation has taken place
return NotifyHandlers(messageName, eventData).ToArray();
}
private IEnumerable<object> NotifyHandlers(string messageName, Dictionary<string, object> eventData) {
private IEnumerable<object> NotifyHandlers(string messageName, IDictionary<string, object> eventData) {
string[] parameters = messageName.Split('.');
if (parameters.Length != 2) {
throw new ArgumentException(messageName + T(" is not formatted correctly"));
@@ -46,7 +46,7 @@ namespace Orchard.Events {
}
}
private bool TryNotifyHandler(IEventHandler eventHandler, string messageName, string interfaceName, string methodName, Dictionary<string, object> eventData, out IEnumerable returnValue) {
private bool TryNotifyHandler(IEventHandler eventHandler, string messageName, string interfaceName, string methodName, IDictionary<string, object> eventData, out IEnumerable returnValue) {
try {
return TryInvoke(eventHandler, interfaceName, methodName, eventData, out returnValue);
}

View File

@@ -3,6 +3,6 @@ using System.Collections.Generic;
namespace Orchard.Events {
public interface IEventBus : IDependency {
IEnumerable Notify(string messageName, Dictionary<string, object> eventData);
IEnumerable Notify(string messageName, IDictionary<string, object> eventData);
}
}