mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Authenticate admin user during setup phase
This is so that we don't need code all over the place to set the Owner of the CommonPart. The CommonPart will have direct access to the user. --HG-- branch : dev
This commit is contained in:
@@ -170,6 +170,10 @@ namespace Orchard.Setup.Services {
|
||||
String.Empty, String.Empty, String.Empty,
|
||||
true));
|
||||
|
||||
|
||||
var authenticationService = environment.Resolve<IAuthenticationService>();
|
||||
authenticationService.SetAuthenticatedUserForRequest(user);
|
||||
|
||||
// set site name and settings
|
||||
var siteService = environment.Resolve<ISiteService>();
|
||||
var siteSettings = siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||
@@ -265,9 +269,8 @@ namespace Orchard.Setup.Services {
|
||||
menuItem.As<MenuPart>().OnMainMenu = true;
|
||||
menuItem.As<MenuItemPart>().Url = "";
|
||||
|
||||
//Temporary fix for running setup on command line
|
||||
//null check: temporary fix for running setup in command line
|
||||
if (HttpContext.Current != null) {
|
||||
var authenticationService = environment.Resolve<IAuthenticationService>();
|
||||
authenticationService.SignIn(user, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user