feature: enrol devices bound to another domain
This commit is contained in:
@@ -34,6 +34,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
private const string pEnforceComputerNameConvention = "enforcecomputernameconvention";
|
||||
private const string pEnforceOrganisationalUnit = "enforceorganisationalunit";
|
||||
private const string pProvisionADAccount = "provisionadaccount";
|
||||
private const string pProvisionFromOtherDomain = "provisionfromotherdomain";
|
||||
private const string pAssignedUserLocalAdmin = "assigneduserlocaladmin";
|
||||
private const string pSetAssignedUserForLogon = "setassigneduserforlogon";
|
||||
private const string pAllowUntrustedReimageJobEnrolment = "allowuntrustedreimagejobrnrolment";
|
||||
@@ -93,6 +94,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
case pProvisionADAccount:
|
||||
UpdateProvisionADAccount(deviceProfile, value);
|
||||
break;
|
||||
case pProvisionFromOtherDomain:
|
||||
UpdateProvisionFromOtherDomain(deviceProfile, value);
|
||||
break;
|
||||
case pAssignedUserLocalAdmin:
|
||||
UpdateAssignedUserLocalAdmin(deviceProfile, value);
|
||||
break;
|
||||
@@ -351,6 +355,13 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return Update(id, pProvisionADAccount, ProvisionADAccount, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateProvisionFromOtherDomain(int id, string ProvisionFromOtherDomain = null, bool? redirect = null)
|
||||
{
|
||||
return Update(id, pProvisionFromOtherDomain, ProvisionFromOtherDomain, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateSetAssignedUserForLogon(int id, string setAssignedUserForLogon = null, bool? redirect = null)
|
||||
@@ -666,6 +677,18 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
throw new Exception("Invalid Boolean Value");
|
||||
}
|
||||
|
||||
private void UpdateProvisionFromOtherDomain(DeviceProfile deviceProfile, string provisionFromOtherDomain)
|
||||
{
|
||||
if (bool.TryParse(provisionFromOtherDomain, out var bValue))
|
||||
{
|
||||
deviceProfile.ProvisionFromOtherDomain = bValue;
|
||||
|
||||
Database.SaveChanges();
|
||||
return;
|
||||
}
|
||||
throw new Exception("Invalid Boolean Value");
|
||||
}
|
||||
|
||||
private void UpdateAssignedUserLocalAdmin(DeviceProfile deviceProfile, string assignedUserLocalAdmin)
|
||||
{
|
||||
if (bool.TryParse(assignedUserLocalAdmin, out var bValue))
|
||||
|
||||
Reference in New Issue
Block a user