Merge remote-tracking branch 'origin/v9/dev' into v9/task/package-refactor

# Conflicts:
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
#	src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
This commit is contained in:
Bjarke Berg
2021-06-18 13:19:48 +02:00
57 changed files with 866 additions and 498 deletions

View File

@@ -17,6 +17,7 @@ using Umbraco.Cms.Core.Mail;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Models.Email;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Net;
using Umbraco.Cms.Core.Security;

View File

@@ -366,6 +366,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
contentItem.Username,
contentItem.Email,
memberType.Alias,
contentItem.IsApproved,
contentItem.Name);
IdentityResult created = await _memberManager.CreateAsync(identityMember, contentItem.Password.NewPassword);

View File

@@ -26,6 +26,7 @@ using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Media;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Models.Email;
using Umbraco.Cms.Core.Models.Membership;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
@@ -683,12 +684,12 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
// if it's the current user, the current user cannot reset their own password without providing their old password
if (currentUser.Username == found.Username && string.IsNullOrEmpty(changingPasswordModel.OldPassword))
{
return new ValidationErrorResult("Password reset is not allowed without providing old password");
return ValidationErrorResult.CreateNotificationValidationErrorResult("Password reset is not allowed without providing old password");
}
if (!currentUser.IsAdmin() && found.IsAdmin())
{
return new ValidationErrorResult("The current user cannot change the password for the specified user");
return ValidationErrorResult.CreateNotificationValidationErrorResult("The current user cannot change the password for the specified user");
}
Attempt<PasswordChangedModel> passwordChangeResult = await _passwordChanger.ChangePasswordWithIdentityAsync(changingPasswordModel, _userManager);