mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-20 18:23:13 +00:00
sync with user external ids
This commit is contained in:
@@ -684,7 +684,7 @@ namespace Bit.Console
|
||||
Con.WriteLine("Users:");
|
||||
foreach(var user in result.Users)
|
||||
{
|
||||
Con.WriteLine(" {0}{1}", user.Email, user.Disabled ? " (disabled)" : null);
|
||||
Con.WriteLine(" {0}{1}", user.Email ?? user.Id, user.Disabled ? " (disabled)" : null);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,8 +34,10 @@ namespace Bit.Core.Models
|
||||
{
|
||||
Email = entry.Email;
|
||||
Disabled = entry.Disabled;
|
||||
ExternalId = entry.Id;
|
||||
}
|
||||
|
||||
public string ExternalId { get; set; }
|
||||
public string Email { get; set; }
|
||||
public bool Disabled { get; set; }
|
||||
}
|
||||
|
||||
@@ -209,7 +209,12 @@ namespace Bit.Core.Services
|
||||
Disabled = !user.AccountEnabled.GetValueOrDefault(true)
|
||||
};
|
||||
|
||||
if(entry?.Email?.Contains("#") ?? true)
|
||||
object deleted;
|
||||
if(user.AdditionalData.TryGetValue("@removed", out deleted) && deleted.ToString().Contains("changed"))
|
||||
{
|
||||
entry.Disabled = true;
|
||||
}
|
||||
else if(!entry.Disabled && (entry?.Email?.Contains("#") ?? true))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@ namespace Bit.Core.Utilities
|
||||
|
||||
foreach(var user in usersInThisGroup)
|
||||
{
|
||||
if(!group.Users.Contains(user.Email))
|
||||
if(!group.Users.Contains(user.Id))
|
||||
{
|
||||
group.Users.Add(user.Email);
|
||||
group.Users.Add(user.Id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,9 @@ namespace Bit.Core.Utilities
|
||||
{
|
||||
foreach(var user in currentGroupsUsers)
|
||||
{
|
||||
if(!group.Users.Contains(user.Email))
|
||||
if(!group.Users.Contains(user.Id))
|
||||
{
|
||||
group.Users.Add(user.Email);
|
||||
group.Users.Add(user.Id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user