1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-28 06:36:15 -05:00
This commit is contained in:
Brandon 2025-05-15 16:07:23 -04:00
parent be23fe6420
commit 3ae9fbd114
No known key found for this signature in database
GPG Key ID: A0E0EF0B207BA40D

View File

@ -88,19 +88,21 @@ public class ImportOrganizationUserCommand : IImportOrganizationUserCommand
var events = new List<(OrganizationUserUserDetails ou, EventType e, DateTime? d)>();
// Users
await RemoveExistingExternalUsers(removeUserExternalIds, events, importUserData);
if (overwriteExisting)
{
await OverwriteExisting(events, importUserData);
}
await RemoveExistingUsers(existingUsers, newUsers, organization, importUserData);
await AddNewUsers(organization, newUsers, eventSystemUser, importUserData);
// Groups
await ImportGroups(organization, groups, eventSystemUser, importUserData);
await _eventService.LogOrganizationUserEventsAsync(events.Select(e => (e.ou, e.e, eventSystemUser, e.d)));
await _referenceEventService.RaiseEventAsync(
new ReferenceEvent(ReferenceEventType.DirectorySynced, organization, _currentContext));
}
@ -164,7 +166,6 @@ public class ImportOrganizationUserCommand : IImportOrganizationUserCommand
foreach (var user in usersToAttach)
{
var orgUserDetails = existingUsersEmailsDict[user];
var orgUser = orgUsers[existingUsersEmailsDict[user].Id];
if (orgUser != null)
{