ensures the UsersController raises the appropriate event when an admin user changes another user's password

This commit is contained in:
Shannon
2017-09-18 19:42:49 +10:00
parent e8e0664129
commit a5581ba13e

View File

@@ -562,6 +562,15 @@ namespace Umbraco.Web.Editors
var passwordChangeResult = await passwordChanger.ChangePasswordWithIdentityAsync(Security.CurrentUser, found, userSave.ChangePassword, UserManager);
if (passwordChangeResult.Success)
{
var userMgr = this.TryGetOwinContext().Result.GetBackOfficeUserManager();
//raise the event - NOTE that the ChangePassword.Reset value here doesn't mean it's been 'reset', it means
//it's been changed by a back office user
if (userSave.ChangePassword.Reset.HasValue && userSave.ChangePassword.Reset.Value)
{
userMgr.RaisePasswordChangedEvent(intId.Result);
}
//need to re-get the user
found = Services.UserService.GetUserById(intId.Result);
}