qol: simplify calls

This commit is contained in:
Gary Sharp
2025-07-20 15:20:22 +10:00
parent 1add4ee0f5
commit 9656c15c4b
61 changed files with 214 additions and 214 deletions
@@ -414,7 +414,7 @@ namespace Disco.Services.Interop.ActiveDirectory
if (System.IO.File.Exists(tempFileName))
{
DJoinResult = System.Convert.ToBase64String(System.IO.File.ReadAllBytes(tempFileName));
DJoinResult = Convert.ToBase64String(System.IO.File.ReadAllBytes(tempFileName));
System.IO.File.Delete(tempFileName);
}
if (string.IsNullOrWhiteSpace(DJoinResult))
@@ -388,7 +388,7 @@ namespace Disco.Services.Interop.ActiveDirectory
netbootGUID = NetbootGUIDFromMACAddress(MACAddress);
}
if (netbootGUID != System.Guid.Empty && netbootGUID != NetbootGUID)
if (netbootGUID != Guid.Empty && netbootGUID != NetbootGUID)
{
SetNetbootGUID(WritableDomainController, netbootGUID);
return true;
@@ -418,7 +418,7 @@ namespace Disco.Services.Interop.ActiveDirectory
}
else
{
NetbootGUIDFromMACAddress = System.Guid.Empty;
NetbootGUIDFromMACAddress = Guid.Empty;
}
return NetbootGUIDFromMACAddress;
}
@@ -74,7 +74,7 @@ namespace Disco.Services.Interop.ActiveDirectory
return domain.GetAvailableDomainController().RetrieveADUserAccount(User.UserId, AdditionalProperties);
}
public static IEnumerable<ADUserAccount> SearchADUserAccounts(string Term, bool Quick, int? ResultLimit = ActiveDirectory.DefaultSearchResultLimit, params string[] AdditionalProperties)
public static IEnumerable<ADUserAccount> SearchADUserAccounts(string Term, bool Quick, int? ResultLimit = DefaultSearchResultLimit, params string[] AdditionalProperties)
{
if (string.IsNullOrWhiteSpace(Term))
throw new ArgumentNullException("Term");
@@ -133,7 +133,7 @@ namespace Disco.Services.Interop.ActiveDirectory
return domain.GetAvailableDomainController().RetrieveADGroupWithSecurityIdentifier(SecurityIdentifier, AdditionalProperties);
}
public static IEnumerable<ADGroup> SearchADGroups(string Term, int? ResultLimit = ActiveDirectory.DefaultSearchResultLimit, params string[] AdditionalProperties)
public static IEnumerable<ADGroup> SearchADGroups(string Term, int? ResultLimit = DefaultSearchResultLimit, params string[] AdditionalProperties)
{
if (string.IsNullOrWhiteSpace(Term))
throw new ArgumentNullException("Term");
@@ -279,7 +279,7 @@ namespace Disco.Services.Interop.ActiveDirectory
else
{
AccountUsername = AccountId.Substring(slashIndex + 1);
return ActiveDirectory.Context.TryGetDomainByNetBiosName(AccountId.Substring(0, slashIndex), out Domain);
return Context.TryGetDomainByNetBiosName(AccountId.Substring(0, slashIndex), out Domain);
}
}
@@ -291,7 +291,7 @@ namespace Disco.Services.Interop.ActiveDirectory
{
var slashIndex = AccountId.IndexOf('\\');
if (slashIndex > 0 && AccountId.Substring(0, slashIndex).Equals(ActiveDirectory.Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase))
if (slashIndex > 0 && AccountId.Substring(0, slashIndex).Equals(Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase))
return AccountId.Substring(slashIndex + 1);
else
return AccountId;