#19760: Propagating the suppression of IEnumerable<> and loops for IUserEventHandlers

Work Item: 19760
This commit is contained in:
christian@AlteredCarbon
2013-05-31 08:03:08 +02:00
committed by Nicholas Mayne
parent 4b4f673c36
commit 8e6a7486ce
2 changed files with 9 additions and 15 deletions

View File

@@ -25,7 +25,7 @@ namespace Orchard.Users.Controllers {
public class AdminController : Controller, IUpdateModel {
private readonly IMembershipService _membershipService;
private readonly IUserService _userService;
private readonly IEnumerable<IUserEventHandler> _userEventHandlers;
private readonly IUserEventHandler _userEventHandlers;
private readonly ISiteService _siteService;
public AdminController(
@@ -33,7 +33,7 @@ namespace Orchard.Users.Controllers {
IMembershipService membershipService,
IUserService userService,
IShapeFactory shapeFactory,
IEnumerable<IUserEventHandler> userEventHandlers,
IUserEventHandler userEventHandlers,
ISiteService siteService) {
Services = services;
_membershipService = membershipService;
@@ -318,9 +318,7 @@ namespace Orchard.Users.Controllers {
if ( user != null ) {
user.As<UserPart>().RegistrationStatus = UserStatus.Approved;
Services.Notifier.Information(T("User {0} approved", user.UserName));
foreach (var userEventHandler in _userEventHandlers) {
userEventHandler.Approved(user);
}
_userEventHandlers.Approved(user);
}
return RedirectToAction("Index");