mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-21 02:33:14 +00:00
sync with user external ids
This commit is contained in:
@@ -684,7 +684,7 @@ namespace Bit.Console
|
|||||||
Con.WriteLine("Users:");
|
Con.WriteLine("Users:");
|
||||||
foreach(var user in result.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
|
else
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ namespace Bit.Core.Models
|
|||||||
{
|
{
|
||||||
Email = entry.Email;
|
Email = entry.Email;
|
||||||
Disabled = entry.Disabled;
|
Disabled = entry.Disabled;
|
||||||
|
ExternalId = entry.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ExternalId { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public bool Disabled { get; set; }
|
public bool Disabled { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,7 +209,12 @@ namespace Bit.Core.Services
|
|||||||
Disabled = !user.AccountEnabled.GetValueOrDefault(true)
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,9 +91,9 @@ namespace Bit.Core.Utilities
|
|||||||
|
|
||||||
foreach(var user in usersInThisGroup)
|
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)
|
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