mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 09:42:29 +08:00
committed by
Sébastien Ros
parent
4a9c4c5019
commit
f7425f871d
@@ -5,6 +5,7 @@ using Orchard.ContentManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.Users.Events;
|
||||
using Orchard.Users.Models;
|
||||
using Orchard.Workflows.Models;
|
||||
using Orchard.Workflows.Services;
|
||||
@@ -14,10 +15,12 @@ namespace Orchard.Users.Activities {
|
||||
public class SignInUserActivity : Task {
|
||||
private readonly IMembershipService _membershipService;
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
private readonly IUserEventHandler _userEventHandler;
|
||||
|
||||
public SignInUserActivity(IMembershipService membershipService, IAuthenticationService authenticationService) {
|
||||
public SignInUserActivity(IMembershipService membershipService, IAuthenticationService authenticationService, IUserEventHandler userEventHandler) {
|
||||
_membershipService = membershipService;
|
||||
_authenticationService = authenticationService;
|
||||
_userEventHandler = userEventHandler;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
@@ -66,7 +69,9 @@ namespace Orchard.Users.Activities {
|
||||
yield break;
|
||||
}
|
||||
|
||||
_userEventHandler.LoggingIn(userNameOrEmail, password);
|
||||
_authenticationService.SignIn(user, createPersistentCookie);
|
||||
_userEventHandler.LoggedIn(user);
|
||||
|
||||
yield return T("Done");
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ namespace Orchard.Security.Providers {
|
||||
httpContext.Response.Cookies.Add(cookie);
|
||||
|
||||
_isAuthenticated = true;
|
||||
_isNonOrchardUser = false;
|
||||
_signedInUser = user;
|
||||
}
|
||||
|
||||
@@ -117,6 +118,7 @@ namespace Orchard.Security.Providers {
|
||||
public void SetAuthenticatedUserForRequest(IUser user) {
|
||||
_signedInUser = user;
|
||||
_isAuthenticated = true;
|
||||
_isNonOrchardUser = false;
|
||||
}
|
||||
|
||||
public IUser GetAuthenticatedUser() {
|
||||
|
||||
Reference in New Issue
Block a user