mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 03:14:10 +08:00
Adding LoginFailed event. [Core Module Change]
This commit is contained in:
@@ -346,6 +346,7 @@ namespace Orchard.Users.Controllers {
|
||||
|
||||
var user = _membershipService.ValidateUser(userNameOrEmail, password);
|
||||
if (user == null) {
|
||||
_userEventHandler.LogInFailed(userNameOrEmail, password);
|
||||
ModelState.AddModelError("_FORM", T("The username or e-mail or password provided is incorrect."));
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,11 @@ namespace Orchard.Users.Events {
|
||||
/// </summary>
|
||||
void LoggedIn(IUser user);
|
||||
|
||||
/// <summary>
|
||||
/// Called when a login attempt failed
|
||||
/// </summary>
|
||||
void LogInFailed(string userNameOrEmail, string password);
|
||||
|
||||
/// <summary>
|
||||
/// Called when a user explicitly logs out (as opposed to one whose session cookie simply expires)
|
||||
/// </summary>
|
||||
|
@@ -36,6 +36,12 @@ namespace Orchard.Users.Handlers {
|
||||
() => new Dictionary<string, object> {{"User", user}});
|
||||
}
|
||||
|
||||
public void LogInFailed(string userNameOrEmail, string password) {
|
||||
_workflowManager.TriggerEvent("UserLogInFailed",
|
||||
null,
|
||||
() => new Dictionary<string, object> { { "UserNameOrEmail", userNameOrEmail }, { "Password", password } });
|
||||
}
|
||||
|
||||
public void LoggedOut(Security.IUser user) {
|
||||
_workflowManager.TriggerEvent("UserLoggedOut",
|
||||
user,
|
||||
|
Reference in New Issue
Block a user