From a5581ba13e61644319ec16feed69e30c6bbd517f Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 18 Sep 2017 19:42:49 +1000 Subject: [PATCH] ensures the UsersController raises the appropriate event when an admin user changes another user's password --- src/Umbraco.Web/Editors/UsersController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs index 665d86c5e2..5e45851108 100644 --- a/src/Umbraco.Web/Editors/UsersController.cs +++ b/src/Umbraco.Web/Editors/UsersController.cs @@ -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); }