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:
Renaud Paquay
2010-10-15 14:33:02 -07:00
parent 3b33fa9edf
commit 94fee29d1a
4 changed files with 16 additions and 4 deletions

View File

@@ -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);
}
}