Fixing Setup

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-08-29 11:55:57 -07:00
parent 159e94c286
commit 89ed115260
2 changed files with 7 additions and 1 deletions

View File

@@ -18,10 +18,12 @@ namespace Orchard.Pages.Commands {
private readonly ISiteService _siteService;
private readonly IMenuService _menuService;
private readonly INavigationManager _navigationManager;
private readonly IAuthenticationService _authenticationService;
public PageCommands(
IContentManager contentManager,
IMembershipService membershipService,
IAuthenticationService authenticationService,
ISiteService siteService,
IMenuService menuService,
INavigationManager navigationManager) {
@@ -30,6 +32,7 @@ namespace Orchard.Pages.Commands {
_siteService = siteService;
_menuService = menuService;
_navigationManager = navigationManager;
_authenticationService = authenticationService;
}
[OrchardSwitch]
@@ -71,7 +74,10 @@ namespace Orchard.Pages.Commands {
if (String.IsNullOrEmpty(Owner)) {
Owner = _siteService.GetSiteSettings().SuperUser;
}
var owner = _membershipService.GetUser(Owner);
_authenticationService.SetAuthenticatedUserForRequest(owner);
var page = _contentManager.Create("Page", VersionOptions.Draft);
page.As<TitlePart>().Title = Title;
page.As<ICommonPart>().Owner = owner;

View File

@@ -84,7 +84,7 @@ namespace Orchard.Security.Providers {
Logger.Fatal("User id not a parsable integer");
return null;
}
return _contentManager.Get(userId).As<IUser>();
return _signedInUser = _contentManager.Get(userId).As<IUser>();
}
}
}