Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/9623-external-login-token-store

# Conflicts:
#	src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs
This commit is contained in:
Bjarke Berg
2021-03-16 09:14:05 +01:00
212 changed files with 3698 additions and 2238 deletions

View File

@@ -391,7 +391,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
await _emailSender.SendAsync(mailMessage);
_userManager.RaiseForgotPasswordRequestedEvent(User, user.Id.ToString());
_userManager.NotifyForgotPasswordRequested(User, user.Id.ToString());
}
}
@@ -555,7 +555,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
}
}
_userManager.RaiseForgotPasswordChangedSuccessEvent(User, model.UserId.ToString());
_userManager.NotifyForgotPasswordChanged(User, model.UserId.ToString());
return Ok();
}
@@ -579,7 +579,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
_logger.LogInformation("User {UserName} from IP address {RemoteIpAddress} has logged out", User.Identity == null ? "UNKNOWN" : User.Identity.Name, HttpContext.Connection.RemoteIpAddress);
var userId = result.Principal.Identity.GetUserId();
var args = _userManager.RaiseLogoutSuccessEvent(User, userId);
var args = _userManager.NotifyLogoutSuccess(User, userId);
if (!args.SignOutRedirectUrl.IsNullOrWhiteSpace())
{
return new ObjectResult(new

View File

@@ -443,7 +443,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return new ValidationErrorResult(new SimpleValidationModel(ModelState.ToErrorDictionary()));
}
if (!_emailSender.CanSendRequiredEmail() && !_userManager.HasSendingUserInviteEventHandler)
if (!_emailSender.CanSendRequiredEmail())
{
return new ValidationErrorResult("No Email server is configured");
}
@@ -482,39 +482,8 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
_userService.Save(user);
var display = _umbracoMapper.Map<UserDisplay>(user);
UserInviteEventArgs inviteArgs;
try
{
inviteArgs = _userManager.RaiseSendingUserInvite(User, userSave, user);
}
catch (Exception ex)
{
_logger.LogError(ex, "An error occurred in a custom event handler while inviting the user");
return ValidationErrorResult.CreateNotificationValidationErrorResult($"An error occurred inviting the user (check logs for more info): {ex.Message}");
}
// If the event is handled then no need to send the email
if (inviteArgs.InviteHandled)
{
// if no user result was created then map the minimum args manually for the UI
if (!inviteArgs.ShowUserResult)
{
display = new UserDisplay
{
Name = userSave.Name,
Email = userSave.Email,
Username = userSave.Username
};
}
}
else
{
//send the email
await SendUserInviteEmailAsync(display, _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser.Name, _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser.Email, user, userSave.Message);
}
//send the email
await SendUserInviteEmailAsync(display, _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser.Name, _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser.Email, user, userSave.Message);
display.AddSuccessNotification(_localizedTextService.Localize("speechBubbles/resendInviteHeader"), _localizedTextService.Localize("speechBubbles/resendInviteSuccess", new[] { user.Name }));
return display;