adds invited date to back office user
This commit is contained in:
@@ -18,6 +18,7 @@ namespace Umbraco.Cms.Core.Security
|
||||
private string[] _allowedSections;
|
||||
private int[] _startMediaIds;
|
||||
private int[] _startContentIds;
|
||||
private DateTime? _inviteDateUtc;
|
||||
|
||||
private static readonly DelegateEqualityComparer<int[]> s_startIdsComparer = new DelegateEqualityComparer<int[]>(
|
||||
(groups, enumerable) => groups.UnsortedSequenceEqual(enumerable),
|
||||
@@ -75,6 +76,15 @@ namespace Umbraco.Cms.Core.Security
|
||||
public int[] CalculatedMediaStartNodeIds { get; set; }
|
||||
public int[] CalculatedContentStartNodeIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets invite date
|
||||
/// </summary>
|
||||
public DateTime? InviteDateUtc
|
||||
{
|
||||
get => _inviteDateUtc;
|
||||
set => BeingDirty.SetPropertyValueAndDetectChanges(value, ref _inviteDateUtc, nameof(InviteDateUtc));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets content start nodes assigned to the User (not ones assigned to the user's groups)
|
||||
/// </summary>
|
||||
|
||||
@@ -438,6 +438,13 @@ namespace Umbraco.Cms.Core.Security
|
||||
user.LastLoginDate = dt;
|
||||
}
|
||||
|
||||
if (identityUser.IsPropertyDirty(nameof(BackOfficeIdentityUser.InviteDateUtc))
|
||||
|| (user.InvitedDate?.ToUniversalTime() != identityUser.InviteDateUtc))
|
||||
{
|
||||
anythingChanged = true;
|
||||
user.InvitedDate = identityUser.InviteDateUtc?.ToLocalTime();
|
||||
}
|
||||
|
||||
if (identityUser.IsPropertyDirty(nameof(BackOfficeIdentityUser.LastPasswordChangeDateUtc))
|
||||
|| (user.LastPasswordChangeDate != default && identityUser.LastPasswordChangeDateUtc.HasValue == false)
|
||||
|| (identityUser.LastPasswordChangeDateUtc.HasValue && user.LastPasswordChangeDate.ToUniversalTime() != identityUser.LastPasswordChangeDateUtc.Value))
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace Umbraco.Cms.Core.Security
|
||||
target.UserName = source.Username;
|
||||
target.LastPasswordChangeDateUtc = source.LastPasswordChangeDate.ToUniversalTime();
|
||||
target.LastLoginDateUtc = source.LastLoginDate.ToUniversalTime();
|
||||
target.InviteDateUtc = source.InvitedDate?.ToUniversalTime();
|
||||
target.EmailConfirmed = source.EmailConfirmedDate.HasValue;
|
||||
target.Name = source.Name;
|
||||
target.AccessFailedCount = source.FailedPasswordAttempts;
|
||||
@@ -87,7 +88,7 @@ namespace Umbraco.Cms.Core.Security
|
||||
target.LockoutEnd = source.IsLockedOut ? DateTime.MaxValue.ToUniversalTime() : (DateTime?)null;
|
||||
}
|
||||
|
||||
// TODO: We need to validate this mapping is OK, we need to get Umbraco.Code working
|
||||
// Umbraco.Code.MapAll -Id -LockoutEnabled -PhoneNumber -PhoneNumberConfirmed -TwoFactorEnabled -ConcurrencyStamp -NormalizedEmail -NormalizedUserName -Roles
|
||||
private void Map(IMember source, MemberIdentityUser target)
|
||||
{
|
||||
target.Email = source.Email;
|
||||
|
||||
Reference in New Issue
Block a user