Bug Fix #58: Fail to assign MacSecureEnrol devices

Various code-paths *assumed* valid domain account ids as long as an id
existed (simple null-check). Correct checks for valid domain account ids
has been implemented.
This commit is contained in:
Gary Sharp
2014-07-10 18:33:05 +10:00
parent 2274e2201d
commit 9bfa95e263
4 changed files with 72 additions and 74 deletions
@@ -180,7 +180,7 @@ namespace Disco.Web.Areas.API.Controllers
device.DeviceProfile = p;
// Update AD Account
if (!string.IsNullOrEmpty(device.DeviceDomainId) && device.DeviceDomainId.Length <= 24)
if (ActiveDirectory.IsValidDomainAccountId(device.DeviceDomainId))
{
var adMachineAccount = ActiveDirectory.RetrieveADMachineAccount(device.DeviceDomainId);
if (adMachineAccount != null)