diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs index db0611a5a43..b0cdbfbd5e8 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs @@ -292,6 +292,10 @@ protected void cmdUpdate_Click(object sender, EventArgs e) // Clear the Portal Cache DataCache.ClearPortalCache(this.UserPortalID, true); } + else + { + DataCache.ClearUserCache(this.PortalId, this.User.Username); + } try { @@ -308,6 +312,14 @@ protected void cmdUpdate_Click(object sender, EventArgs e) } } + var prevUserEmail = UserController.Instance.GetUserById(this.PortalId, this.UserId)?.Email; + + if (!string.IsNullOrWhiteSpace(prevUserEmail) && !prevUserEmail.Equals(this.User.Email, StringComparison.OrdinalIgnoreCase)) + { + // on email address change need to invalidate existing 'reset password' link + this.User.PasswordResetExpiration = Null.NullDate; + } + UserController.UpdateUser(this.UserPortalID, this.User); // make sure username matches possibly changed email address