1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-15 15:53:41 +00:00

base path for deleted objects

This commit is contained in:
Kyle Spearrin
2017-05-18 08:39:27 -04:00
parent a3904712d4
commit cacb1704f1
2 changed files with 7 additions and 1 deletions

View File

@@ -39,6 +39,12 @@ namespace Bit.Core.Models
return GetDirectoryEntry(path);
}
public DirectoryEntry GetBasePathDirectoryEntry()
{
var path = Path.Substring(Path.IndexOf("dc=", StringComparison.InvariantCultureIgnoreCase));
return GetDirectoryEntry(path);
}
public DirectoryEntry GetDirectoryEntry(string path = null)
{
if(Password == null && string.IsNullOrWhiteSpace(Username))

View File

@@ -259,7 +259,7 @@ namespace Bit.Core.Services
// Deleted users
if(SettingsService.Instance.Server.Type == DirectoryType.ActiveDirectory)
{
var deletedEntry = SettingsService.Instance.Server.Ldap.GetDirectoryEntry();
var deletedEntry = SettingsService.Instance.Server.Ldap.GetBasePathDirectoryEntry();
var deletedFilter = BuildBaseFilter(SettingsService.Instance.Sync.Ldap.UserObjectClass, "(isDeleted=TRUE)");
deletedFilter = BuildRevisionFilter(deletedFilter, force, SettingsService.Instance.LastUserSyncDate);