Update #42: AD Migration

Refactor to target specific Domain Controllers, with failover.
This commit is contained in:
Gary Sharp
2014-04-21 21:43:13 +10:00
parent 43fc622121
commit 09c2a24222
98 changed files with 3808 additions and 3271 deletions
@@ -1,5 +1,4 @@
using Disco.BI.Extensions;
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Authorization.Roles;
@@ -16,7 +15,6 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.DiscoAdminAccount)]
public partial class AuthorizationRoleController : AuthorizedDatabaseController
{
#region Properties
const string pName = "name";
@@ -111,14 +109,15 @@ namespace Disco.Web.Areas.API.Controllers
var subjects = Subjects
.Where(s => !string.IsNullOrWhiteSpace(s))
.Select(s => s.Trim())
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveObject(s, Quick: true)))
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveADObject(s, Quick: true)))
.Where(s => s.Item2 is ADUserAccount || s.Item2 is ADGroup)
.ToList();
var invalidSubjects = subjects.Where(s => s.Item2 == null).ToList();
if (invalidSubjects.Count > 0)
throw new ArgumentException(string.Format("Subjects not found: {0}", string.Join(", ", invalidSubjects)), "Subjects");
var proposedSubjects = subjects.Select(s => s.Item2.NetBiosId).OrderBy(s => s).ToArray();
var proposedSubjects = subjects.Select(s => s.Item2.Id).OrderBy(s => s).ToArray();
var currentSubjects = AuthorizationRole.SubjectIds == null ? new string[0] : AuthorizationRole.SubjectIds.Split(',');
removedSubjects = currentSubjects.Except(proposedSubjects).ToArray();
addedSubjects = proposedSubjects.Except(currentSubjects).ToArray();
@@ -249,14 +248,15 @@ namespace Disco.Web.Areas.API.Controllers
var subjects = Subjects
.Where(s => !string.IsNullOrWhiteSpace(s))
.Select(s => s.Trim())
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveObject(s, Quick: true)))
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveADObject(s, Quick: true)))
.Where(s => s.Item2 is ADUserAccount || s.Item2 is ADGroup)
.ToList();
var invalidSubjects = subjects.Where(s => s.Item2 == null).ToList();
if (invalidSubjects.Count > 0)
throw new ArgumentException(string.Format("Subjects not found: {0}", string.Join(", ", invalidSubjects)), "Subjects");
proposedSubjects = subjects.Select(s => s.Item2.NetBiosId).OrderBy(s => s).ToArray();
proposedSubjects = subjects.Select(s => s.Item2.Id).OrderBy(s => s).ToArray();
var currentSubjects = UserService.AdministratorSubjectIds;
removedSubjects = currentSubjects.Except(proposedSubjects).ToArray();
addedSubjects = proposedSubjects.Except(currentSubjects).ToArray();
@@ -275,31 +275,5 @@ namespace Disco.Web.Areas.API.Controllers
}
#endregion
public virtual ActionResult SearchSubjects(string term)
{
var groupResults = ActiveDirectory.SearchGroups(term).Cast<IActiveDirectoryObject>();
var userResults = ActiveDirectory.SearchUserAccounts(term).Cast<IActiveDirectoryObject>();
var results = groupResults.Concat(userResults).OrderBy(r => r.SamAccountName)
.Select(r => Models.AuthorizationRole.SubjectItem.FromActiveDirectoryObject(r)).ToList();
return Json(results, JsonRequestBehavior.AllowGet);
}
public virtual ActionResult Subject(string Id)
{
if (string.IsNullOrWhiteSpace(Id))
return Json(null, JsonRequestBehavior.AllowGet);
else if (!Id.Contains(@"\"))
Id = string.Format(@"{0}\{1}", ActiveDirectory.PrimaryDomain.NetBiosName, Id);
var subject = ActiveDirectory.RetrieveObject(Id, Quick: true);
if (subject == null || !(subject is ActiveDirectoryUserAccount || subject is ActiveDirectoryGroup))
return Json(null, JsonRequestBehavior.AllowGet);
else
return Json(Models.AuthorizationRole.SubjectItem.FromActiveDirectoryObject(subject), JsonRequestBehavior.AllowGet);
}
}
}
@@ -150,7 +150,7 @@ namespace Disco.Web.Areas.API.Controllers
// Update AD Account
if (!string.IsNullOrEmpty(device.DeviceDomainId) && device.DeviceDomainId.Length <= 24)
{
var adMachineAccount = ActiveDirectory.RetrieveMachineAccount(device.DeviceDomainId);
var adMachineAccount = ActiveDirectory.RetrieveADMachineAccount(device.DeviceDomainId);
if (adMachineAccount != null)
adMachineAccount.SetDescription(device);
}
@@ -410,7 +410,7 @@ namespace Disco.Web.Areas.API.Controllers
var thumbPath = da.RepositoryThumbnailFilename(Database);
if (System.IO.File.Exists(thumbPath))
{
if (thumbPath.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase))
if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
return File(thumbPath, "image/png");
else
return File(thumbPath, "image/jpg");
@@ -433,7 +433,7 @@ namespace Disco.Web.Areas.API.Controllers
if (file.ContentLength > 0)
{
var contentType = file.ContentType;
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.InvariantCultureIgnoreCase))
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = BI.Interop.MimeTypes.ResolveMimeType(file.FileName);
var da = new Disco.Models.Repository.DeviceAttachment()
@@ -501,7 +501,7 @@ namespace Disco.Web.Areas.API.Controllers
var da = Database.DeviceAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (da != null)
{
if (da.TechUserId.Equals(CurrentUser.UserId, StringComparison.InvariantCultureIgnoreCase))
if (da.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase))
Authorization.RequireAny(Claims.Device.Actions.RemoveAnyAttachments, Claims.Device.Actions.RemoveOwnAttachments);
else
Authorization.Require(Claims.Device.Actions.RemoveAnyAttachments);
@@ -246,7 +246,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateOrganisationalUnit(Disco.Models.Repository.DeviceProfile deviceProfile, string OrganisationalUnit)
{
if (string.IsNullOrWhiteSpace(OrganisationalUnit))
OrganisationalUnit = ActiveDirectory.PrimaryDomain.GetDefaultComputerContainer();
OrganisationalUnit = ActiveDirectory.Context.PrimaryDomain.DefaultComputerContainer;
if (OrganisationalUnit != deviceProfile.OrganisationalUnit)
{
@@ -531,7 +531,7 @@ namespace Disco.Web.Areas.API.Controllers
// Enforce Restricted List Mode
var value = DeviceHeldLocation.Trim();
if (!Database.DiscoConfiguration.JobPreferences.LocationList.Contains(value, StringComparer.InvariantCultureIgnoreCase))
if (!Database.DiscoConfiguration.JobPreferences.LocationList.Contains(value, StringComparer.OrdinalIgnoreCase))
throw new ArgumentException("The location was not found in the list (Mode: Restricted List)");
}
@@ -545,7 +545,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateFlags(Job job, string Flags)
{
// Only User Management Job Supports Flags at the moment
if (!job.JobTypeId.Equals(JobType.JobTypeIds.UMgmt, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.UMgmt, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for User Management Jobs");
}
@@ -602,7 +602,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateNonWarrantyIsInsuranceClaim(Job job, string IsInsuranceClaim)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -641,7 +641,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargeRequired(Job job, string AccountingChargeRequiredDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -675,7 +675,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargeAdded(Job job, string AccountingChargeAddedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -709,7 +709,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargePaid(Job job, string AccountingChargePaidDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -743,7 +743,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyPurchaseOrderRaised(Job job, string PurchaseOrderRaisedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -786,7 +786,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyPurchaseOrderSent(Job job, string PurchaseOrderSentDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -820,7 +820,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateNonWarrantyInvoiceReceived(Job job, string InvoiceReceivedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -855,7 +855,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateNonWarrantyRepairerName(Job job, string RepairerName)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -873,7 +873,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateNonWarrantyRepairerLoggedDate(Job job, string RepairerLoggedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -884,7 +884,7 @@ namespace Disco.Web.Areas.API.Controllers
}
else
{
if (RepairerLoggedDate.Equals("Now", StringComparison.InvariantCultureIgnoreCase))
if (RepairerLoggedDate.Equals("Now", StringComparison.OrdinalIgnoreCase))
{
job.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now;
}
@@ -906,7 +906,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateNonWarrantyRepairerReference(Job job, string RepairerReference)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -924,7 +924,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateNonWarrantyRepairerCompletedDate(Job job, string RepairerCompletedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -935,7 +935,7 @@ namespace Disco.Web.Areas.API.Controllers
}
else
{
if (RepairerCompletedDate.Equals("Now", StringComparison.InvariantCultureIgnoreCase))
if (RepairerCompletedDate.Equals("Now", StringComparison.OrdinalIgnoreCase))
{
job.JobMetaNonWarranty.RepairerCompletedDate = DateTime.Now;
}
@@ -962,7 +962,7 @@ namespace Disco.Web.Areas.API.Controllers
private Models.Job._DateChangeModel UpdateInsuranceClaimFormSentDate(Job job, string ClaimFormSentDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -973,7 +973,7 @@ namespace Disco.Web.Areas.API.Controllers
}
else
{
if (ClaimFormSentDate.Equals("Now", StringComparison.InvariantCultureIgnoreCase))
if (ClaimFormSentDate.Equals("Now", StringComparison.OrdinalIgnoreCase))
{
job.JobMetaInsurance.ClaimFormSentDate = DateTime.Now;
}
@@ -1004,7 +1004,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceDateOfPurchase(Job job, string DateOfPurchase)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1028,7 +1028,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceOtherInterestedParties(Job job, string OtherInterestedParties)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1047,7 +1047,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceRecoverReduceAction(Job job, string RecoverReduceAction)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1066,7 +1066,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsurancePoliceNotifiedCrimeReportNo(Job job, string PoliceNotifiedCrimeReportNo)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1085,7 +1085,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsurancePoliceNotifiedDate(Job job, string PoliceNotifiedDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1109,7 +1109,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsurancePoliceNotifiedStation(Job job, string PoliceNotifiedStation)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1128,7 +1128,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsurancePoliceNotified(Job job, string PoliceNotified)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1146,7 +1146,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsurancePropertyLastSeenDate(Job job, string PropertyLastSeenDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1173,7 +1173,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceBurglaryTheftMethodOfEntry(Job job, string BurglaryTheftMethodOfEntry)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1192,7 +1192,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceWitnessesNamesAddresses(Job job, string WitnessesNamesAddresses)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1211,7 +1211,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceThirdPartyCausedWhy(Job job, string ThirdPartyCausedWhy)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1230,7 +1230,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceThirdPartyCausedName(Job job, string ThirdPartyCausedName)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1249,7 +1249,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceThirdPartyCaused(Job job, string ThirdPartyCaused)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1267,7 +1267,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceDescription(Job job, string Description)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1286,7 +1286,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceEventLocation(Job job, string EventLocation)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1305,7 +1305,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateInsuranceLossOrDamageDate(Job job, string LossOrDamageDate)
{
// Validate Is NonWarranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HNWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware NonWarranty Jobs");
}
@@ -1334,7 +1334,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateWarrantyExternalName(Job job, string ExternalName)
{
// Validate Is Warranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware Warranty Jobs");
}
@@ -1353,7 +1353,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateWarrantyExternalLoggedDate(Job job, string ExternalLoggedDate)
{
// Validate Is Warranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware Warranty Jobs");
}
@@ -1380,7 +1380,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateWarrantyExternalReference(Job job, string ExternalReference)
{
// Validate Is Warranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware Warranty Jobs");
}
@@ -1399,7 +1399,7 @@ namespace Disco.Web.Areas.API.Controllers
private void UpdateWarrantyExternalCompletedDate(Job job, string ExternalCompletedDate)
{
// Validate Is Warranty Job
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.InvariantCultureIgnoreCase))
if (!job.JobTypeId.Equals(JobType.JobTypeIds.HWar, StringComparison.OrdinalIgnoreCase))
{
throw new Exception("This property can only be set for Hardware Warranty Jobs");
}
@@ -1410,7 +1410,7 @@ namespace Disco.Web.Areas.API.Controllers
}
else
{
if (ExternalCompletedDate.Equals("Now", StringComparison.InvariantCultureIgnoreCase))
if (ExternalCompletedDate.Equals("Now", StringComparison.OrdinalIgnoreCase))
{
job.JobMetaWarranty.ExternalCompletedDate = DateTime.Now;
}
@@ -1876,7 +1876,7 @@ namespace Disco.Web.Areas.API.Controllers
var jl = Database.JobLogs.Find(id);
if (jl != null)
{
if (jl.TechUserId.Equals(CurrentUser.UserId, StringComparison.InvariantCultureIgnoreCase))
if (jl.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase))
Authorization.RequireAny(Claims.Job.Actions.RemoveAnyLogs, Claims.Job.Actions.RemoveOwnLogs);
else
Authorization.Require(Claims.Job.Actions.RemoveAnyLogs);
@@ -1921,7 +1921,7 @@ namespace Disco.Web.Areas.API.Controllers
var thumbFileInfo = new FileInfo(thumbPath);
if (thumbFileInfo.Exists && thumbFileInfo.Length > 0)
{
if (thumbPath.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase))
if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
return File(thumbPath, "image/png");
else
return File(thumbPath, "image/jpg");
@@ -1944,7 +1944,7 @@ namespace Disco.Web.Areas.API.Controllers
if (file.ContentLength > 0)
{
var contentType = file.ContentType;
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.InvariantCultureIgnoreCase))
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = BI.Interop.MimeTypes.ResolveMimeType(file.FileName);
var ja = new Disco.Models.Repository.JobAttachment()
@@ -2012,7 +2012,7 @@ namespace Disco.Web.Areas.API.Controllers
var ja = Database.JobAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (ja != null)
{
if (ja.TechUserId.Equals(CurrentUser.UserId, StringComparison.InvariantCultureIgnoreCase))
if (ja.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase))
Authorization.RequireAny(Claims.Job.Actions.RemoveAnyAttachments, Claims.Job.Actions.RemoveOwnAttachments);
else
Authorization.Require(Claims.Job.Actions.RemoveAnyAttachments);
@@ -2148,7 +2148,7 @@ namespace Disco.Web.Areas.API.Controllers
{
case Disco.Models.BI.Job.LocationModes.Unrestricted:
var jobDateThreshold = DateTime.Now.AddYears(-1);
locations = Database.Jobs.Where(j => (j.OpenedDate > jobDateThreshold || !j.ClosedDate.HasValue) && j.DeviceHeldLocation != null).Select(j => j.DeviceHeldLocation).Distinct().OrderBy(l => l).ToList().Where(l => !string.IsNullOrWhiteSpace(l)).Select(l => l.Trim()).Distinct(StringComparer.InvariantCultureIgnoreCase).OrderBy(l => l).ToList();
locations = Database.Jobs.Where(j => (j.OpenedDate > jobDateThreshold || !j.ClosedDate.HasValue) && j.DeviceHeldLocation != null).Select(j => j.DeviceHeldLocation).Distinct().OrderBy(l => l).ToList().Where(l => !string.IsNullOrWhiteSpace(l)).Select(l => l.Trim()).Distinct(StringComparer.OrdinalIgnoreCase).OrderBy(l => l).ToList();
break;
case Disco.Models.BI.Job.LocationModes.OptionalList:
case Disco.Models.BI.Job.LocationModes.RestrictedList:
@@ -53,7 +53,7 @@ namespace Disco.Web.Areas.API.Controllers
var list = LocationList
.Where(i => !string.IsNullOrWhiteSpace(i))
.Select(i => i.Trim())
.Distinct(StringComparer.InvariantCultureIgnoreCase)
.Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(i => i);
Database.DiscoConfiguration.JobPreferences.LocationList = list.ToList();
@@ -93,7 +93,7 @@ namespace Disco.Web.Areas.API.Controllers
list = list
.Where(l => !string.IsNullOrWhiteSpace(l))
.Select(l => l.Trim())
.Distinct(StringComparer.InvariantCultureIgnoreCase)
.Distinct(StringComparer.OrdinalIgnoreCase)
.OrderBy(i => i);
Database.DiscoConfiguration.JobPreferences.LocationList = list.ToList();
@@ -1,5 +1,4 @@
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.Repository;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Jobs.JobQueues;
using Disco.Services.Web;
@@ -291,14 +290,15 @@ namespace Disco.Web.Areas.API.Controllers
var subjects = Subjects
.Where(s => !string.IsNullOrWhiteSpace(s))
.Select(s => s.Trim())
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveObject(s, Quick: true)))
.Select(s => Tuple.Create(s, ActiveDirectory.RetrieveADObject(s, Quick: true)))
.Where(s => s.Item2 is ADUserAccount || s.Item2 is ADGroup)
.ToList();
var invalidSubjects = subjects.Where(s => s.Item2 == null).ToList();
if (invalidSubjects.Count > 0)
throw new ArgumentException(string.Format("Subjects not found: {0}", string.Join(", ", invalidSubjects)), "Subjects");
var proposedSubjects = subjects.Select(s => s.Item2.NetBiosId).OrderBy(s => s).ToArray();
var proposedSubjects = subjects.Select(s => s.Item2.Id).OrderBy(s => s).ToArray();
subjectIds = string.Join(",", proposedSubjects);
@@ -370,28 +370,5 @@ namespace Disco.Web.Areas.API.Controllers
}
}
#endregion
[DiscoAuthorize(Claims.Config.JobQueue.Configure)]
public virtual ActionResult SearchSubjects(string term)
{
var groupResults = ActiveDirectory.SearchGroups(term).Cast<IActiveDirectoryObject>();
var userResults = ActiveDirectory.SearchUserAccounts(term).Cast<IActiveDirectoryObject>();
var results = groupResults.Concat(userResults).OrderBy(r => r.SamAccountName)
.Select(r => Models.JobQueue.SubjectItem.FromActiveDirectoryObject(r)).ToList();
return Json(results, JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Config.JobQueue.Configure)]
public virtual ActionResult Subject(string Id)
{
var subject = ActiveDirectory.RetrieveObject(Id, Quick: true);
if (subject == null || !(subject is ActiveDirectoryUserAccount || subject is ActiveDirectoryGroup))
return Json(null, JsonRequestBehavior.AllowGet);
else
return Json(Models.JobQueue.SubjectItem.FromActiveDirectoryObject(subject), JsonRequestBehavior.AllowGet);
}
}
}
@@ -1,6 +1,5 @@
using Disco.BI.Extensions;
using Disco.Data.Configuration;
using Disco.Models.Interop.ActiveDirectory;
using Disco.Services.Authorization;
using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Web;
@@ -20,7 +19,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Config.System.Show)]
public virtual ActionResult UpdateLastNetworkLogonDates()
{
var taskStatus = Disco.Services.Interop.ActiveDirectory.Internal.ADUpdateLastNetworkLogonDateJob.ScheduleImmediately();
var taskStatus = Disco.Services.Interop.ActiveDirectory.ADTaskUpdateNetworkLogonDates.ScheduleImmediately();
return RedirectToAction(MVC.Config.Logging.TaskStatus(taskStatus.SessionId));
}
@@ -126,7 +125,7 @@ namespace Disco.Web.Areas.API.Controllers
if (Image != null && Image.ContentLength > 0)
{
if (Image.ContentType.StartsWith("image/", StringComparison.InvariantCultureIgnoreCase))
if (Image.ContentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase))
{
Database.DiscoConfiguration.OrganisationLogo = Image.InputStream;
@@ -227,7 +226,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Config.System.ConfigureActiveDirectory)]
public virtual ActionResult UpdateActiveDirectorySearchScope(List<string> Containers, bool redirect = false)
{
ActiveDirectory.UpdateSearchContainers(Database, Containers);
ActiveDirectory.Context.UpdateSearchContainers(Database, Containers);
Database.SaveChanges();
if (redirect)
@@ -237,17 +236,17 @@ namespace Disco.Web.Areas.API.Controllers
}
[DiscoAuthorize(Claims.Config.System.ConfigureActiveDirectory)]
public virtual ActionResult UpdateActiveDirectorySearchEntireForest(bool SearchEntireForest, bool redirect = false)
public virtual ActionResult UpdateActiveDirectorySearchAllForestServers(bool SearchAllForestServers, bool redirect = false)
{
try
{
var result = ActiveDirectory.UpdateSearchEntireForest(Database, SearchEntireForest);
var result = ActiveDirectory.Context.UpdateSearchAllForestServers(Database, SearchAllForestServers);
Database.SaveChanges();
if (!result)
{
var forestServers = ActiveDirectory.LoadForestServers();
var forestServers = ActiveDirectory.Context.ForestServers;
if (forestServers.Count > ActiveDirectory.MaxForestServerSearch)
throw new InvalidOperationException(string.Format("This forest contains more than the Max Forest Server Search restriction ({0})", ActiveDirectory.MaxForestServerSearch));
else
@@ -271,8 +270,8 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorizeAny(Claims.Config.System.ConfigureActiveDirectory, Claims.Config.DeviceProfile.Configure)]
public virtual ActionResult DomainOrganisationalUnits()
{
var domainOUs = ActiveDirectory.Domains
.Select(d => new Models.System.DomainOrganisationalUnitsModel() { Domain = d, OrganisationalUnits = ActiveDirectory.RetrieveOrganisationalUnitStructure(d) })
var domainOUs = ActiveDirectory.RetrieveADOrganisationalUnitStructure()
.Select(d => new Models.System.DomainOrganisationalUnitsModel() { Domain = d.Item1, OrganisationalUnits = d.Item2})
.Select(ous => ous.ToFancyTreeNode()).ToList();
return new JsonResult()
@@ -283,6 +282,29 @@ namespace Disco.Web.Areas.API.Controllers
};
}
[DiscoAuthorizeAny(Claims.DiscoAdminAccount, Claims.Config.JobQueue.Configure)]
public virtual ActionResult SearchSubjects(string term)
{
var groupResults = ActiveDirectory.SearchADGroups(term).Cast<IADObject>();
var userResults = ActiveDirectory.SearchADUserAccounts(term, true).Cast<IADObject>();
var results = groupResults.Concat(userResults).OrderBy(r => r.SamAccountName)
.Select(r => Models.Shared.SubjectDescriptorModel.FromActiveDirectoryObject(r)).ToList();
return Json(results, JsonRequestBehavior.AllowGet);
}
[DiscoAuthorizeAny(Claims.DiscoAdminAccount, Claims.Config.JobQueue.Configure)]
public virtual ActionResult Subject(string Id)
{
var subject = ActiveDirectory.RetrieveADObject(Id, Quick: true);
if (subject == null)
return Json(null, JsonRequestBehavior.AllowGet);
else
return Json(Models.Shared.SubjectDescriptorModel.FromActiveDirectoryObject(subject), JsonRequestBehavior.AllowGet);
}
#endregion
#region Proxy Settings
@@ -50,7 +50,7 @@ namespace Disco.Web.Areas.API.Controllers
var thumbPath = ua.RepositoryThumbnailFilename(Database);
if (System.IO.File.Exists(thumbPath))
{
if (thumbPath.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase))
if (thumbPath.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
return File(thumbPath, "image/png");
else
return File(thumbPath, "image/jpg");
@@ -65,7 +65,7 @@ namespace Disco.Web.Areas.API.Controllers
public virtual ActionResult AttachmentUpload(string id, string Domain, string Comments)
{
if (string.IsNullOrEmpty(Domain))
id = ActiveDirectory.PrimaryDomain.NetBiosName + @"\" + id;
id = ActiveDirectory.Context.PrimaryDomain.NetBiosName + @"\" + id;
else
id = Domain + @"\" + id;
@@ -78,7 +78,7 @@ namespace Disco.Web.Areas.API.Controllers
if (file.ContentLength > 0)
{
var contentType = file.ContentType;
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.InvariantCultureIgnoreCase))
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = BI.Interop.MimeTypes.ResolveMimeType(file.FileName);
var ua = new Disco.Models.Repository.UserAttachment()
@@ -127,7 +127,7 @@ namespace Disco.Web.Areas.API.Controllers
public virtual ActionResult Attachments(string id, string Domain)
{
if (string.IsNullOrEmpty(Domain))
id = ActiveDirectory.PrimaryDomain.NetBiosName + @"\" + id;
id = ActiveDirectory.Context.PrimaryDomain.NetBiosName + @"\" + id;
else
id = Domain + @"\" + id;
@@ -151,7 +151,7 @@ namespace Disco.Web.Areas.API.Controllers
var ua = Database.UserAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (ua != null)
{
if (ua.TechUserId.Equals(CurrentUser.UserId, StringComparison.InvariantCultureIgnoreCase))
if (ua.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase))
Authorization.RequireAny(Claims.User.Actions.RemoveAnyAttachments, Claims.User.Actions.RemoveOwnAttachments);
else
Authorization.Require(Claims.User.Actions.RemoveAnyAttachments);
@@ -174,7 +174,7 @@ namespace Disco.Web.Areas.API.Controllers
throw new ArgumentNullException("AttachmentTypeId");
if (string.IsNullOrEmpty(Domain))
id = ActiveDirectory.PrimaryDomain.NetBiosName + @"\" + id;
id = ActiveDirectory.Context.PrimaryDomain.NetBiosName + @"\" + id;
else
id = Domain + @"\" + id;
@@ -1,25 +0,0 @@
using Disco.Models.Interop.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.API.Models.AuthorizationRole
{
public class SubjectItem
{
public string Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public static SubjectItem FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
{
return new Models.AuthorizationRole.SubjectItem()
{
Id = ADObject.NetBiosId,
Name = ADObject.DisplayName,
Type = ADObject is ActiveDirectoryGroup ? "group" : "user"
};
}
}
}
@@ -1,25 +0,0 @@
using Disco.Models.Interop.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.API.Models.JobQueue
{
public class SubjectItem
{
public string Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public static SubjectItem FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
{
return new Models.JobQueue.SubjectItem()
{
Id = ADObject.NetBiosId,
Name = ADObject.DisplayName,
Type = ADObject is ActiveDirectoryGroup ? "group" : "user"
};
}
}
}
@@ -0,0 +1,51 @@
using Disco.Services.Interop.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.API.Models.Shared
{
public class SubjectDescriptorModel
{
public string Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public bool IsGroup { get; set; }
public bool IsUserAccount { get; set; }
public bool IsMachineAccount { get; set; }
public static SubjectDescriptorModel FromActiveDirectoryObject(IADObject ADObject)
{
var item = new SubjectDescriptorModel()
{
Id = ADObject.Id,
Name = ADObject.DisplayName
};
if (ADObject is ADUserAccount)
{
item.IsUserAccount = true;
item.Type = "user";
}
else if (ADObject is ADGroup)
{
item.IsGroup = true;
item.Type = "group";
}
else if (ADObject is ADMachineAccount)
{
item.IsMachineAccount = true;
item.Type = "machine";
}
else
{
item.Type = "unknown";
}
return item;
}
}
}
@@ -1,16 +1,14 @@
using Disco.Models.Interop.ActiveDirectory;
using Disco.Services.Interop.ActiveDirectory;
using Disco.Web.Models.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.API.Models.System
{
public class DomainOrganisationalUnitsModel
{
public ActiveDirectoryDomain Domain { get; set; }
public List<ActiveDirectoryOrganisationalUnit> OrganisationalUnits { get; set; }
public ADDomain Domain { get; set; }
public List<ADOrganisationalUnit> OrganisationalUnits { get; set; }
public FancyTreeNode ToFancyTreeNode()
{
@@ -21,13 +19,13 @@ namespace Disco.Web.Areas.API.Models.System
key = Domain.DistinguishedName,
title = Domain.NetBiosName,
folder = true,
tooltip = Domain.DnsName,
tooltip = Domain.Name,
children = children,
unselectable = false,
expanded = true
};
}
private FancyTreeNode OrganisationalUnitToFancyTreeNode(ActiveDirectoryOrganisationalUnit OrganisationalUnit)
private FancyTreeNode OrganisationalUnitToFancyTreeNode(ADOrganisationalUnit OrganisationalUnit)
{
FancyTreeNode[] children = OrganisationalUnit.Children == null
? null
@@ -6,6 +6,7 @@ using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Users;
using Disco.Services.Web;
using Disco.Web.Areas.API.Models.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -27,10 +28,10 @@ namespace Disco.Web.Areas.Config.Controllers
throw new ArgumentException("Invalid Authorization Role Id");
var token = RoleToken.FromAuthorizationRole(ar);
var subjects = token.SubjectIds == null ? new List<Models.AuthorizationRole.SubjectDescriptorModel>() :
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveObject(subjectId, Quick: true))
var subjects = token.SubjectIds == null ? new List<SubjectDescriptorModel>() :
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveADObject(subjectId, Quick: true))
.Where(item => item != null)
.Select(item => Models.AuthorizationRole.SubjectDescriptorModel.FromActiveDirectoryObject(item))
.Select(item => SubjectDescriptorModel.FromActiveDirectoryObject(item))
.OrderBy(item => item.Name).ToList();
var m = new Models.AuthorizationRole.ShowModel()
@@ -53,9 +54,9 @@ namespace Disco.Web.Areas.Config.Controllers
.Select(ar => RoleToken.FromAuthorizationRole(ar)).Cast<IRoleToken>().ToList();
var administratorSubjects = UserService.AdministratorSubjectIds
.Select(subjectId => ActiveDirectory.RetrieveObject(subjectId, Quick: true))
.Select(subjectId => ActiveDirectory.RetrieveADObject(subjectId, Quick: true))
.Where(item => item != null)
.Select(item => Models.AuthorizationRole.SubjectDescriptorModel.FromActiveDirectoryObject(item))
.Select(item => SubjectDescriptorModel.FromActiveDirectoryObject(item))
.OrderBy(item => item.Name).ToList();
var m = new Models.AuthorizationRole.IndexModel()
@@ -77,7 +77,7 @@ namespace Disco.Web.Areas.Config.Controllers
ComputerNameTemplate = DeviceProfile.DefaultComputerNameTemplate,
ProvisionADAccount = true,
DistributionType = DeviceProfile.DistributionTypes.OneToMany,
OrganisationalUnit = ActiveDirectory.PrimaryDomain.GetDefaultComputerContainer()
OrganisationalUnit = ActiveDirectory.Context.PrimaryDomain.DefaultComputerContainer
}
};
@@ -6,6 +6,7 @@ using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Jobs.JobQueues;
using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Web;
using Disco.Web.Areas.API.Models.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -28,10 +29,10 @@ namespace Disco.Web.Areas.Config.Controllers
throw new ArgumentException("Invalid Job Queue Id");
var token = JobQueueToken.FromJobQueue(jq);
var subjects = token.SubjectIds == null ? new List<Models.JobQueue.ShowModel.SubjectDescriptor>() :
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveObject(subjectId, Quick: true))
var subjects = token.SubjectIds == null ? new List<SubjectDescriptorModel>() :
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveADObject(subjectId, Quick: true))
.Where(item => item != null)
.Select(item => Models.JobQueue.ShowModel.SubjectDescriptor.FromActiveDirectoryObject(item))
.Select(item => SubjectDescriptorModel.FromActiveDirectoryObject(item))
.OrderBy(item => item.Name).ToList();
var totalJobCount = Database.JobQueueJobs.Where(jqj => jqj.JobQueueId == id.Value).Select(jqj => jqj.Job).Distinct().Count();
@@ -5,6 +5,7 @@ using System.Web;
using Disco.Data.Repository;
using Disco.Models.UI.Config.AuthorizationRole;
using Disco.Models.Services.Authorization;
using Disco.Web.Areas.API.Models.Shared;
namespace Disco.Web.Areas.Config.Models.AuthorizationRole
{
@@ -1,6 +1,6 @@
using Disco.Models.Services.Authorization;
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.UI.Config.AuthorizationRole;
using Disco.Web.Areas.API.Models.Shared;
using Disco.Web.Models.Shared;
using System;
using System.Collections.Generic;
@@ -1,25 +0,0 @@
using Disco.Models.Interop.ActiveDirectory;
namespace Disco.Web.Areas.Config.Models.AuthorizationRole
{
public class SubjectDescriptorModel
{
public bool IsGroup { get; set; }
public string Name { get; set; }
public string Id { get; set; }
public static SubjectDescriptorModel FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
{
var item = new SubjectDescriptorModel()
{
Id = ADObject.NetBiosId,
Name = ADObject.DisplayName
};
if (ADObject is ActiveDirectoryGroup)
item.IsGroup = true;
return item;
}
}
}
@@ -5,6 +5,7 @@ using System.Web;
using System.Web.Mvc;
using Disco.Services.Plugins;
using Disco.Models.UI.Config.DeviceProfile;
using Disco.Services.Interop.ActiveDirectory;
namespace Disco.Web.Areas.Config.Models.DeviceProfile
{
@@ -15,6 +16,23 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
public Disco.Models.BI.Config.OrganisationAddress DefaultOrganisationAddress { get; set; }
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
public string FriendlyOrganisationalUnitName
{
get
{
if (string.IsNullOrEmpty(this.DeviceProfile.OrganisationalUnit))
{
var domain = ActiveDirectory.Context.PrimaryDomain;
return domain.FriendlyDistinguishedNamePath(domain.DefaultComputerContainer);
}
else
{
var domain = ActiveDirectory.Context.GetDomainFromDistinguishedName(this.DeviceProfile.OrganisationalUnit);
return domain.FriendlyDistinguishedNamePath(this.DeviceProfile.OrganisationalUnit);
}
}
}
public List<PluginFeatureManifest> CertificateProviders { get; set; }
public int DeviceCount { get; set; }
@@ -1,10 +1,7 @@
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.Services.Jobs.JobQueues;
using Disco.Models.Services.Jobs.JobQueues;
using Disco.Models.UI.Config.JobQueue;
using System;
using Disco.Web.Areas.API.Models.Shared;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.JobQueue
{
@@ -12,28 +9,7 @@ namespace Disco.Web.Areas.Config.Models.JobQueue
{
public IJobQueueToken Token { get; set; }
public List<SubjectDescriptor> Subjects { get; set; }
public class SubjectDescriptor
{
public bool IsGroup { get; set; }
public string Name { get; set; }
public string Id { get; set; }
public static SubjectDescriptor FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
{
var item = new SubjectDescriptor()
{
Id = ADObject.NetBiosId,
Name = ADObject.DisplayName
};
if (ADObject is ActiveDirectoryGroup)
item.IsGroup = true;
return item;
}
}
public List<SubjectDescriptorModel> Subjects { get; set; }
public int OpenJobCount { get; set; }
public int TotalJobCount { get; set; }
@@ -41,6 +17,5 @@ namespace Disco.Web.Areas.Config.Models.JobQueue
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public bool CanDelete { get; set; }
}
}
@@ -8,7 +8,6 @@ using System.Data.SqlClient;
using Disco.Data.Repository;
using Disco.Models.BI.Interop.Community;
using Disco.Services.Tasks;
using Disco.Models.Interop.ActiveDirectory;
using System.DirectoryServices.ActiveDirectory;
using Disco.Services.Interop.ActiveDirectory;
@@ -77,14 +76,14 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
#region Active Directory
[Display(Name="Search Entire Forest")]
public bool ADSearchEntireForest { get; set; }
[Display(Name="Search All Forest Servers")]
public bool ADSearchAllForestServers { get; set; }
public ActiveDirectoryDomain ADPrimaryDomain { get; set; }
public List<ActiveDirectoryDomain> ADAdditionalDomains { get; set; }
public ActiveDirectorySite ADSite { get; set; }
public List<Tuple<DirectoryServer, bool>> ADSiteServers { get; set; }
public List<Tuple<string, ActiveDirectoryDomain, string>> ADSearchContainers { get; set; }
public List<ADDomain> ADDomains { get; set; }
public ADDomain ADPrimaryDomain { get; set; }
public ADSite ADSite { get; set; }
public List<ADDomainController> ADServers { get; set; }
public List<Tuple<string, ADDomain, string>> ADSearchContainers { get; set; }
public List<string> ADForestServers { get; set; }
#endregion
@@ -119,28 +118,28 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
};
// AD
m.ADPrimaryDomain = ActiveDirectory.PrimaryDomain;
m.ADAdditionalDomains = ActiveDirectory.Domains.Where(d => d != m.ADPrimaryDomain).ToList();
m.ADSite = ActiveDirectory.Site;
m.ADSiteServers = m.ADSite.Servers.Cast<DirectoryServer>().Select(s => Tuple.Create(s, s.Reachable())).ToList();
m.ADDomains = ActiveDirectory.Context.Domains.ToList();
m.ADPrimaryDomain = ActiveDirectory.Context.PrimaryDomain;
m.ADSite = ActiveDirectory.Context.Site;
m.ADServers = ActiveDirectory.Context.Domains.SelectMany(d => d.DomainControllers).ToList();
var configSearchContainers = config.ActiveDirectory.SearchContainers;
m.ADSearchContainers = configSearchContainers == null ? null : configSearchContainers.SelectMany(d => d.Value, (k, c) =>
{
var domain = ActiveDirectory.GetDomainByDnsName(k.Key);
return Tuple.Create(c, domain, domain.GetFriendlyOrganisationalUnitName(c));
var domain = ActiveDirectory.Context.GetDomainByName(k.Key);
return Tuple.Create(c, domain, domain.FriendlyDistinguishedNamePath(c));
}).ToList();
var loadForestServersTask = ActiveDirectory.LoadForestServersAsync();
var loadForestServersTask = ADDiscoverForestServers.LoadForestServersAsync();
if (loadForestServersTask.Wait(TimeSpan.FromSeconds(1)))
{
m.ADForestServers = loadForestServersTask.Result;
var configValue = config.ActiveDirectory.SearchEntireForest ?? true;
m.ADSearchEntireForest = configValue && m.ADForestServers.Count <= ActiveDirectory.MaxForestServerSearch;
var configValue = config.ActiveDirectory.SearchAllForestServers ?? true;
m.ADSearchAllForestServers = configValue && m.ADForestServers.Count <= ActiveDirectory.MaxForestServerSearch;
}
else
{
m.ADForestServers = null;
m.ADSearchEntireForest = config.ActiveDirectory.SearchEntireForest ?? true;
m.ADSearchAllForestServers = config.ActiveDirectory.SearchAllForestServers ?? true;
}
return m;
@@ -90,7 +90,7 @@ else
textAdd.watermark('Search Subjects')
.autocomplete({
source: '@(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()))',
source: '@(Url.Action(MVC.API.System.SearchSubjects()))',
minLength: 2,
focus: function (e, ui) {
textAdd.val(ui.item.Id);
@@ -148,32 +148,37 @@ else
var id = textAdd.val();
$.ajax({
url: '@Url.Action(MVC.API.AuthorizationRole.Subject())',
url: '@Url.Action(MVC.API.System.Subject())',
method: 'post',
data: { Id: id }
}).done(function (response) {
if (response) {
if (list.find('li[data-subjectid="' + response.Id.replace('\\', '\\\\') + '"]').length == 0) {
if (response.IsGroup || response.IsUserAccount) {
if (list.find('li[data-subjectid="' + response.Id.replace('\\', '\\\\') + '"]').length == 0) {
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
list.append(li);
list.append(li);
updateNoSubjects();
} else {
alert('That subject has already been added');
updateNoSubjects();
} else {
alert('That subject has already been added');
}
}
else {
alert(response.Name + ' ['+response.Id+'] is a ' + response.Type + '. Only users and groups can be added.');
}
} else {
alert('Unknown Id');
@@ -385,7 +385,7 @@ WriteLiteral(@"></form>
#line 93 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()));
Write(Url.Action(MVC.API.System.SearchSubjects()));
#line default
@@ -417,42 +417,47 @@ WriteLiteral("\',\r\n minLength: 2,\r\n
#line 151 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.Subject()));
Write(Url.Action(MVC.API.System.Subject()));
#line default
#line hidden
WriteLiteral("\',\r\n method: \'post\',\r\n data: { Id: id }\r\n " +
" }).done(function (response) {\r\n if (response) {\r\n " +
" if (list.find(\'li[data-subjectid=\"\' + response.Id.replace(\'\\\\\', \'\\\\\\\\\') + " +
"\'\"]\').length == 0) {\r\n\r\n var liIcon = $(\'<i>\').addClass(\'" +
"fa fa-lg\');\r\n if (response.Type === \'user\')\r\n " +
" liIcon.addClass(\'fa-user\');\r\n else\r\n " +
" liIcon.addClass(\'fa-users\');\r\n\r\n v" +
"ar li = $(\'<li>\')\r\n .append(liIcon)\r\n " +
" .append($(\'<span>\').text(response.Id == response.Name ? response.Id " +
": response.Name + \' [\' + response.Id + \']\'))\r\n .appen" +
"d($(\'<i>\').addClass(\'fa fa-times-circle remove\'))\r\n ." +
"addClass(response.Type)\r\n .attr(\'data-subjectid\', res" +
"ponse.Id)\r\n .attr(\'data-subjectstatus\', \'new\');\r\n\r\n " +
" list.append(li);\r\n\r\n updateNoSubjec" +
"ts();\r\n } else {\r\n alert(\'That subject" +
" has already been added\');\r\n }\r\n } else {\r\n " +
" alert(\'Unknown Id\');\r\n }\r\n }).fail(fu" +
"nction (jqXHR, textStatus, errorThrown) {\r\n alert(\'Error: \' + err" +
"orThrown);\r\n });\r\n return false;\r\n }\r\n\r\n " +
" function updateNoSubjects() {\r\n if (list.find(\'li:visible\').leng" +
"th > 0)\r\n noSubjects.hide();\r\n else\r\n n" +
"oSubjects.show();\r\n }\r\n\r\n function saveChanges() {\r\n va" +
"r form = $(\'#Config_AuthRoles_Subjects_Update_Dialog_Form\').empty();\r\n\r\n " +
" list.find(\'li[data-subjectstatus!=\"removed\"]\').each(function () {\r\n " +
" var subjectId = $(this).attr(\'data-subjectid\');\r\n\r\n form.a" +
"ppend($(\'<input>\').attr({\r\n \'name\': \'Subjects\',\r\n " +
" \'type\': \'hidden\'\r\n }).val(subjectId));\r\n\r\n })." +
"get();\r\n\r\n form.submit();\r\n\r\n dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n }\r\n\r\n $(fun" +
"ction () {\r\n $(\'#Config_AuthRoles_UpdateAdministrators\').click(showDi" +
"alog);\r\n });\r\n\r\n })();\r\n</script>\r\n<!-- #endregion -->\r\n<div");
" if (response.IsGroup || response.IsUserAccount) {\r\n " +
" if (list.find(\'li[data-subjectid=\"\' + response.Id.replace(\'\\\\\', \'\\\\\\\\\') + \'\"]\')" +
".length == 0) {\r\n\r\n var liIcon = $(\'<i>\').addClass(\'f" +
"a fa-lg\');\r\n if (response.Type === \'user\')\r\n " +
" liIcon.addClass(\'fa-user\');\r\n " +
"else\r\n liIcon.addClass(\'fa-users\');\r\n\r\n " +
" var li = $(\'<li>\')\r\n .append(li" +
"Icon)\r\n .append($(\'<span>\').text(response.Id == r" +
"esponse.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r\n " +
" .append($(\'<i>\').addClass(\'fa fa-times-circle remove\'))" +
"\r\n .addClass(response.Type)\r\n " +
" .attr(\'data-subjectid\', response.Id)\r\n " +
" .attr(\'data-subjectstatus\', \'new\');\r\n\r\n list.append" +
"(li);\r\n\r\n updateNoSubjects();\r\n " +
" } else {\r\n alert(\'That subject has already been add" +
"ed\');\r\n }\r\n }\r\n els" +
"e {\r\n alert(response.Name + \' [\'+response.Id+\'] is a \' + " +
"response.Type + \'. Only users and groups can be added.\');\r\n }" +
"\r\n } else {\r\n alert(\'Unknown Id\');\r\n " +
" }\r\n }).fail(function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Error: \' + errorThrown);\r\n });\r\n retu" +
"rn false;\r\n }\r\n\r\n function updateNoSubjects() {\r\n i" +
"f (list.find(\'li:visible\').length > 0)\r\n noSubjects.hide();\r\n " +
" else\r\n noSubjects.show();\r\n }\r\n\r\n function " +
"saveChanges() {\r\n var form = $(\'#Config_AuthRoles_Subjects_Update_Dia" +
"log_Form\').empty();\r\n\r\n list.find(\'li[data-subjectstatus!=\"removed\"]\'" +
").each(function () {\r\n var subjectId = $(this).attr(\'data-subject" +
"id\');\r\n\r\n form.append($(\'<input>\').attr({\r\n \'n" +
"ame\': \'Subjects\',\r\n \'type\': \'hidden\'\r\n }).val(" +
"subjectId));\r\n\r\n }).get();\r\n\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n dialog.dialog(\"option\", \"buttons\", nul" +
"l);\r\n }\r\n\r\n $(function () {\r\n $(\'#Config_AuthRoles_Upda" +
"teAdministrators\').click(showDialog);\r\n });\r\n\r\n })();\r\n</script>\r\n<!--" +
" #endregion -->\r\n<div");
WriteLiteral(" class=\"actionBar\"");
@@ -467,7 +472,7 @@ WriteLiteral(" class=\"button\"");
WriteLiteral(">Update Disco Administrators [");
#line 221 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
#line 226 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Model.AdministratorSubjects.Count);
@@ -478,7 +483,7 @@ WriteLiteral("]</a>\r\n");
WriteLiteral(" ");
#line 222 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
#line 227 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Html.ActionLinkButton("Create Authorization Role", MVC.Config.AuthorizationRole.Create()));
@@ -112,7 +112,7 @@
textAdd.watermark('Search Subjects')
.autocomplete({
source: '@(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()))',
source: '@(Url.Action(MVC.API.System.SearchSubjects()))',
minLength: 2,
focus: function (e, ui) {
textAdd.val(ui.item.Id);
@@ -169,32 +169,36 @@
var id = textAdd.val();
$.ajax({
url: '@Url.Action(MVC.API.AuthorizationRole.Subject())',
url: '@Url.Action(MVC.API.System.Subject())',
method: 'post',
data: { Id: id }
}).done(function(response){
if (response){
if (list.find('li[data-subjectid="'+response.Id.replace('\\', '\\\\')+'"]').length == 0){
if (response.IsGroup || response.IsUserAccount) {
if (list.find('li[data-subjectid="'+response.Id.replace('\\', '\\\\')+'"]').length == 0){
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
list.append(li);
list.append(li);
updateNoSubjects();
updateNoSubjects();
}else{
alert('That subject has already been added');
}
}else{
alert('That subject has already been added');
alert(response.Name + ' ['+response.Id+'] is a ' + response.Type + '. Only users and groups can be added.');
}
}else{
alert('Unknown Id');
@@ -500,7 +500,7 @@ WriteLiteral("></form>\r\n </div>\r\n <scr
#line 115 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()));
Write(Url.Action(MVC.API.System.SearchSubjects()));
#line default
@@ -544,7 +544,7 @@ WriteLiteral("\',\r\n minLength: 2,\r
#line 172 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.Subject()));
Write(Url.Action(MVC.API.System.Subject()));
#line default
@@ -552,49 +552,54 @@ WriteLiteral("\',\r\n minLength: 2,\r
WriteLiteral("\',\r\n method: \'post\',\r\n " +
" data: { Id: id }\r\n }).done(function(r" +
"esponse){\r\n if (response){\r\n " +
" if (list.find(\'li[data-subjectid=\"\'+response.Id.replace(\'" +
"\\\\\', \'\\\\\\\\\')+\'\"]\').length == 0){\r\n \r\n" +
" var liIcon = $(\'<i>\').addClass(\'fa f" +
"a-lg\');\r\n if (response.Type === \'user" +
"\')\r\n liIcon.addClass(\'fa-user\');\r" +
"\n else\r\n " +
" liIcon.addClass(\'fa-users\');\r\n\r\n " +
" var li = $(\'<li>\')\r\n " +
" .append(liIcon)\r\n .append($(\'<" +
"span>\').text(response.Id == response.Name ? response.Id : response.Name + \' [\' " +
"+ response.Id + \']\'))\r\n .append($" +
"(\'<i>\').addClass(\'fa fa-times-circle remove\'))\r\n " +
" .addClass(response.Type)\r\n " +
" .attr(\'data-subjectid\', response.Id)\r\n " +
" .attr(\'data-subjectstatus\', \'new\');\r\n\r\n " +
" list.append(li);\r\n\r\n " +
" updateNoSubjects(); \r\n " +
" }else{\r\n aler" +
"t(\'That subject has already been added\');\r\n " +
" }\r\n }else{\r\n " +
" alert(\'Unknown Id\');\r\n }\r\n " +
" }).fail(function(jqXHR, textStatus, errorThrown){\r\n " +
" alert(\'Error: \' + errorThrown);\r\n " +
" });\r\n }\r\n\r\n " +
" function updateNoSubjects(){\r\n if (list.find" +
"(\'li:visible\').length > 0)\r\n noSubjects.hide(" +
");\r\n else\r\n no" +
"Subjects.show();\r\n }\r\n\r\n f" +
"unction saveChanges(){\r\n var form = $(\'#Config_Au" +
"thRoles_Subjects_Update_Dialog_Form\').empty();\r\n\r\n " +
" list.find(\'li[data-subjectstatus!=\"removed\"]\').each(function(){\r\n " +
" var subjectId = $(this).attr(\'data-subjectid\');\r\n " +
" \r\n form.append($(" +
"\'<input>\').attr({\r\n \'name\': \'Subjects\',\r\n" +
" \'type\': \'hidden\'\r\n " +
" }).val(subjectId));\r\n\r\n }).get();\r\n" +
"\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n dialog.dialog(\"op" +
"tion\", \"buttons\", null);\r\n }\r\n\r\n " +
" $(function(){\r\n $(\'#Config_AuthRoles_Subje" +
"cts_Update\').click(showDialog);\r\n });\r\n\r\n " +
" })();\r\n </script>\r\n </div>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <td");
" if (response.IsGroup || response.IsUserAccount) {\r\n " +
" if (list.find(\'li[data-subjectid=\"\'+respon" +
"se.Id.replace(\'\\\\\', \'\\\\\\\\\')+\'\"]\').length == 0){\r\n " +
" \r\n var liIcon = $(\'<" +
"i>\').addClass(\'fa fa-lg\');\r\n if (" +
"response.Type === \'user\')\r\n l" +
"iIcon.addClass(\'fa-user\');\r\n else" +
"\r\n liIcon.addClass(\'fa-users\'" +
");\r\n\r\n var li = $(\'<li>\')\r\n " +
" .append(liIcon)\r\n " +
" .append($(\'<span>\').text(response.Id == respo" +
"nse.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r\n " +
" .append($(\'<i>\').addClass(\'fa fa-times" +
"-circle remove\'))\r\n .addClass" +
"(response.Type)\r\n .attr(\'data" +
"-subjectid\', response.Id)\r\n ." +
"attr(\'data-subjectstatus\', \'new\');\r\n\r\n " +
" list.append(li);\r\n\r\n update" +
"NoSubjects(); \r\n " +
" }else{\r\n alert" +
"(\'That subject has already been added\');\r\n " +
" }\r\n }else{\r\n " +
" alert(response.Name + \' [\'+response.Id+\'] is a \' + response" +
".Type + \'. Only users and groups can be added.\');\r\n " +
" }\r\n }else{\r\n " +
" alert(\'Unknown Id\');\r\n }\r\n " +
" }).fail(function(jqXHR, textStatus, errorThrown){" +
"\r\n alert(\'Error: \' + errorThrown);\r\n " +
" });\r\n }\r\n\r\n " +
" function updateNoSubjects(){\r\n if (l" +
"ist.find(\'li:visible\').length > 0)\r\n noSubjec" +
"ts.hide();\r\n else\r\n " +
" noSubjects.show();\r\n }\r\n\r\n " +
" function saveChanges(){\r\n var form = $(\'#C" +
"onfig_AuthRoles_Subjects_Update_Dialog_Form\').empty();\r\n\r\n " +
" list.find(\'li[data-subjectstatus!=\"removed\"]\').each(function(){\r\n " +
" var subjectId = $(this).attr(\'data-subjectid\');\r\n" +
" \r\n form.a" +
"ppend($(\'<input>\').attr({\r\n \'name\': \'Subj" +
"ects\',\r\n \'type\': \'hidden\'\r\n " +
" }).val(subjectId));\r\n\r\n })." +
"get();\r\n\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n dialog.di" +
"alog(\"option\", \"buttons\", null);\r\n }\r\n\r\n " +
" $(function(){\r\n $(\'#Config_AuthRol" +
"es_Subjects_Update\').click(showDialog);\r\n });\r\n\r\n " +
" })();\r\n </script>\r\n </div>" +
"\r\n </td>\r\n </tr>\r\n <tr>\r\n <td");
WriteLiteral(" colspan=\"2\"");
@@ -613,7 +618,7 @@ WriteLiteral(" class=\"button small disabled\"");
WriteLiteral(">Save Changes</a>");
#line 247 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 251 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -623,7 +628,7 @@ WriteLiteral("\r\n </div>\r\n <script>\r\n
"(){\r\n var claimNodes = ");
#line 251 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 255 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
@@ -662,7 +667,7 @@ WriteLiteral(@";
url: '");
#line 281 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 285 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.UpdateClaims(Model.Token.Role.Id)));
@@ -702,7 +707,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 307 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 311 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.AuthorizationRole.Delete(Model.Token.Role.Id, true), "Config_AuthRoles_Actions_Delete_Button"));
@@ -523,24 +523,15 @@
<td>@if (canConfig)
{
<div id="DeviceProfile_OrganisationalUnit" class="code" data-value="@Model.DeviceProfile.OrganisationalUnit">
@if (string.IsNullOrEmpty(Model.DeviceProfile.OrganisationalUnit))
{
<span>{Default Computers Container}</span>
}
else
{
var domain = Disco.Services.Interop.ActiveDirectory.ActiveDirectory.GetDomainByDistinguishedName(Model.DeviceProfile.OrganisationalUnit);
<span>
@Disco.Services.Interop.ActiveDirectory.ActiveDirectoryExtensions.GetFriendlyOrganisationalUnitName(domain, Model.DeviceProfile.OrganisationalUnit)
</span>
}
<span>
@Model.FriendlyOrganisationalUnitName
</span>
</div>
<a id="changeOrganisationalUnit" href="#" class="button small">Change</a>@AjaxHelpers.AjaxLoader()
<div id="dialogOrganisationalUnit" title="Organisational Unit" class="dialog">
<div id="dialogOrganisationalUnit_Loading">
@AjaxHelpers.AjaxLoader() Loading Organisational Units
</div>
@AjaxHelpers.AjaxLoader() Loading Organisational Units
</div>
<div id="treeOrganisationalUnit" class="organisationalUnitTree">
</div>
</div>
@@ -660,18 +651,9 @@
else
{
<div id="displayOrganisationalUnit" class="code">
@if (string.IsNullOrEmpty(Model.DeviceProfile.OrganisationalUnit))
{
<span>{Default Computers Container}</span>
}
else
{
var domain = Disco.Services.Interop.ActiveDirectory.ActiveDirectory.GetDomainByDistinguishedName(Model.DeviceProfile.OrganisationalUnit);
<span>
@Disco.Services.Interop.ActiveDirectory.ActiveDirectoryExtensions.GetFriendlyOrganisationalUnitName(domain, Model.DeviceProfile.OrganisationalUnit)
</span>
}
<span>
@Model.FriendlyOrganisationalUnitName
</span>
</div>
}
<div style="margin-top: 8px;">
@@ -1597,56 +1597,18 @@ WriteLiteral(" data-value=\"");
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(">\r\n <span>\r\n");
WriteLiteral(" ");
#line 526 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line default
#line hidden
#line 526 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (string.IsNullOrEmpty(Model.DeviceProfile.OrganisationalUnit))
{
#line 527 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Model.FriendlyOrganisationalUnitName);
#line default
#line hidden
WriteLiteral(" <span>{Default Computers Container}</span>\r\n");
#line 529 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
else
{
var domain = Disco.Services.Interop.ActiveDirectory.ActiveDirectory.GetDomainByDistinguishedName(Model.DeviceProfile.OrganisationalUnit);
#line default
#line hidden
WriteLiteral(" <span>\r\n");
WriteLiteral(" ");
#line 535 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Disco.Services.Interop.ActiveDirectory.ActiveDirectoryExtensions.GetFriendlyOrganisationalUnitName(domain, Model.DeviceProfile.OrganisationalUnit));
#line default
#line hidden
WriteLiteral("\r\n </span>\r\n");
#line 537 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral("\r\n </span>\r\n </div>\r\n");
WriteLiteral(" <a");
@@ -1659,20 +1621,20 @@ WriteLiteral(" class=\"button small\"");
WriteLiteral(">Change</a>");
#line 539 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 530 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line default
#line hidden
#line 539 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 530 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 539 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 530 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
@@ -1692,17 +1654,17 @@ WriteLiteral(" id=\"dialogOrganisationalUnit_Loading\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 542 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 533 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral(" Loading Organisational Units\r\n </div>\r\n " +
" <div");
WriteLiteral(" Loading Organisational Units\r\n </div>\r\n <d" +
"iv");
WriteLiteral(" id=\"treeOrganisationalUnit\"");
@@ -1717,7 +1679,7 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var ouSetUrl = \'");
#line 549 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 540 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.UpdateOrganisationalUnit(Model.DeviceProfile.Id, null, true)));
@@ -1759,7 +1721,7 @@ WriteLiteral("\';\r\n var ouValue = $(\'#DeviceProfile_Or
" $ouTree.css(\'height\', \'100%\');\r\n\r\n $.getJSON(\'");
#line 599 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 590 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Url.Action(MVC.API.System.DomainOrganisationalUnits()));
@@ -1806,7 +1768,7 @@ WriteLiteral("\', null, function (data) {\r\n
" </script>\r\n");
#line 659 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 650 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
else
{
@@ -1820,59 +1782,21 @@ WriteLiteral(" id=\"displayOrganisationalUnit\"");
WriteLiteral(" class=\"code\"");
WriteLiteral(">\r\n");
WriteLiteral(">\r\n <span>\r\n");
WriteLiteral(" ");
#line 663 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line default
#line hidden
#line 663 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (string.IsNullOrEmpty(Model.DeviceProfile.OrganisationalUnit))
{
#line 655 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Model.FriendlyOrganisationalUnitName);
#line default
#line hidden
WriteLiteral(" <span>{Default Computers Container}</span>\r\n");
WriteLiteral("\r\n </span>\r\n </div>\r\n");
#line 666 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
else
{
var domain = Disco.Services.Interop.ActiveDirectory.ActiveDirectory.GetDomainByDistinguishedName(Model.DeviceProfile.OrganisationalUnit);
#line default
#line hidden
WriteLiteral(" <span>\r\n");
WriteLiteral(" ");
#line 672 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Disco.Services.Interop.ActiveDirectory.ActiveDirectoryExtensions.GetFriendlyOrganisationalUnitName(domain, Model.DeviceProfile.OrganisationalUnit));
#line default
#line hidden
WriteLiteral("\r\n </span>\r\n");
#line 674 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 676 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 658 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -1885,13 +1809,13 @@ WriteLiteral(" style=\"margin-top: 8px;\"");
WriteLiteral(">\r\n");
#line 678 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 660 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line default
#line hidden
#line 678 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 660 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (canConfig)
{
@@ -1907,7 +1831,7 @@ WriteLiteral(" type=\"checkbox\"");
WriteLiteral(" ");
#line 680 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 662 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));
@@ -1928,7 +1852,7 @@ WriteLiteral(@">
$.getJSON('");
#line 687 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 669 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id)));
@@ -1948,7 +1872,7 @@ WriteLiteral(@"', data, function (response, result) {
");
#line 698 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 680 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
else
{
@@ -1965,7 +1889,7 @@ WriteLiteral(" type=\"checkbox\"");
WriteLiteral(" ");
#line 701 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 683 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));
@@ -1974,7 +1898,7 @@ WriteLiteral(" ");
WriteLiteral(" disabled=\"disabled\" />\r\n");
#line 702 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 684 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -1990,7 +1914,7 @@ WriteLiteral(">\r\n Enforce Organisational Unit\r\n
WriteLiteral(" ");
#line 706 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 688 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -2000,7 +1924,7 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r
"\n");
#line 712 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 694 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (canDelete)
{
@@ -2055,7 +1979,7 @@ WriteLiteral(@">
");
#line 748 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 730 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -2068,13 +1992,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 750 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 732 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line default
#line hidden
#line 750 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 732 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (canDelete)
{
@@ -2082,14 +2006,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 752 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 734 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete"));
#line default
#line hidden
#line 752 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 734 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -2099,7 +2023,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 754 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 736 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (Authorization.Has(Claims.Device.Actions.Export))
{
@@ -2107,14 +2031,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 756 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 738 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Html.ActionLinkButton("Export Devices", MVC.API.DeviceProfile.ExportDevices(Model.DeviceProfile.Id)));
#line default
#line hidden
#line 756 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 738 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -2124,7 +2048,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 758 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 740 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
if (Authorization.Has(Claims.Device.Search))
{
@@ -2132,14 +2056,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 760 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 742 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile")));
#line default
#line hidden
#line 760 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
#line 742 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml"
}
@@ -369,7 +369,7 @@
textAdd.watermark('Search Subjects')
.autocomplete({
source: '@(Url.Action(MVC.API.JobQueue.SearchSubjects()))',
source: '@(Url.Action(MVC.API.System.SearchSubjects()))',
minLength: 2,
focus: function (e, ui) {
textAdd.val(ui.item.Id);
@@ -428,32 +428,36 @@
var id = textAdd.val();
$.ajax({
url: '@Url.Action(MVC.API.JobQueue.Subject())',
url: '@Url.Action(MVC.API.System.Subject())',
method: 'post',
data: { Id: id }
}).done(function (response) {
if (response) {
if (list.find('li[data-subjectid="' + response.Id + '"]').filter('[data-status!="removed"]').length == 0) {
if (response.IsGroup || response.IsUserAccount) {
if (list.find('li[data-subjectid="' + response.Id + '"]').filter('[data-status!="removed"]').length == 0) {
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
list.append(li);
list.append(li);
updateNoSubjects();
updateNoSubjects();
} else {
alert('That subject has already been added');
}
} else {
alert('That subject has already been added');
alert(response.Name + ' [' + response.Id + '] is a ' + response.Type + '. Only users and groups can be added.');
}
} else {
alert('Unknown Id');
@@ -1321,7 +1321,7 @@ WriteLiteral("></form>\r\n </div>\r\n
#line 372 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(Url.Action(MVC.API.JobQueue.SearchSubjects()));
Write(Url.Action(MVC.API.System.SearchSubjects()));
#line default
@@ -1368,7 +1368,7 @@ WriteLiteral("\',\r\n minLength:
#line 431 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(Url.Action(MVC.API.JobQueue.Subject()));
Write(Url.Action(MVC.API.System.Subject()));
#line default
@@ -1376,53 +1376,58 @@ WriteLiteral("\',\r\n minLength:
WriteLiteral("\',\r\n method: \'post\',\r\n " +
" data: { Id: id }\r\n }).don" +
"e(function (response) {\r\n if (response) {" +
"\r\n if (list.find(\'li[data-subjectid=\"" +
"\' + response.Id + \'\"]\').filter(\'[data-status!=\"removed\"]\').length == 0) {\r\n\r\n " +
" var liIcon = $(\'<i>\').addClass(\'fa " +
"fa-lg\');\r\n if (response.Type === " +
"\'user\')\r\n liIcon.addClass(\'fa" +
"-user\');\r\n else\r\n " +
" liIcon.addClass(\'fa-users\');\r\n\r\n " +
" var li = $(\'<li>\')\r\n " +
" .append(liIcon)\r\n " +
" .append($(\'<span>\').text(response.Id == response.Name ? respons" +
"e.Id : response.Name + \' [\' + response.Id + \']\'))\r\n " +
" .append($(\'<i>\').addClass(\'fa fa-times-circle remove\'))\r\n" +
" .addClass(response.Type)\r\n " +
" .attr(\'data-subjectid\', respon" +
"se.Id)\r\n .attr(\'data-subjects" +
"tatus\', \'new\');\r\n\r\n list.append(l" +
"i);\r\n\r\n updateNoSubjects();\r\n " +
" } else {\r\n " +
" alert(\'That subject has already been added\');\r\n " +
" }\r\n } else {" +
"\r\n alert(\'Unknown Id\');\r\n " +
" }\r\n }).fail(funct" +
"ion (jqXHR, textStatus, errorThrown) {\r\n " +
"alert(\'Error: \' + errorThrown);\r\n });\r\n " +
" }\r\n\r\n function upda" +
"teNoSubjects() {\r\n if (list.find(\'li:visible\'" +
").length > 0)\r\n noSubjects.hide();\r\n " +
" else\r\n noS" +
"ubjects.show();\r\n }\r\n\r\n " +
" function saveChanges() {\r\n var form = $" +
"(\'#Config_JobQueues_Subjects_Update_Dialog_Form\').empty();\r\n\r\n " +
" list.find(\'li[data-subjectstatus!=\"removed\"]\').each(function (" +
") {\r\n var subjectId = $(this).attr(\'data-" +
"subjectid\');\r\n\r\n form.append($(\'<input>\')" +
".attr({\r\n \'name\': \'Subjects\',\r\n " +
" \'type\': \'hidden\'\r\n " +
" }).val(subjectId));\r\n\r\n }).ge" +
"t();\r\n\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n }\r\n\r" +
"\n $(function () {\r\n " +
" $(\'#Config_JobQueues_Subjects_Update\').click(showDialog);\r\n " +
" });\r\n\r\n })();\r\n " +
" </script>\r\n </div>\r\n");
"\r\n if (response.IsGroup || response.I" +
"sUserAccount) {\r\n if (list.find(\'" +
"li[data-subjectid=\"\' + response.Id + \'\"]\').filter(\'[data-status!=\"removed\"]\').le" +
"ngth == 0) {\r\n\r\n var liIcon =" +
" $(\'<i>\').addClass(\'fa fa-lg\');\r\n " +
" if (response.Type === \'user\')\r\n " +
" liIcon.addClass(\'fa-user\');\r\n " +
" else\r\n liIco" +
"n.addClass(\'fa-users\');\r\n\r\n v" +
"ar li = $(\'<li>\')\r\n .appe" +
"nd(liIcon)\r\n .append($(\'<" +
"span>\').text(response.Id == response.Name ? response.Id : response.Name + \' [\' +" +
" response.Id + \']\'))\r\n .a" +
"ppend($(\'<i>\').addClass(\'fa fa-times-circle remove\'))\r\n " +
" .addClass(response.Type)\r\n " +
" .attr(\'data-subjectid\', response.Id)\r\n " +
" .attr(\'data-subjectstatus\', \'new\'" +
");\r\n\r\n list.append(li);\r\n\r\n " +
" updateNoSubjects();\r\n " +
" } else {\r\n " +
" alert(\'That subject has already been added\');\r\n " +
" }\r\n " +
" } else {\r\n alert(response.Name" +
" + \' [\' + response.Id + \'] is a \' + response.Type + \'. Only users and groups can" +
" be added.\');\r\n }\r\n " +
" } else {\r\n aler" +
"t(\'Unknown Id\');\r\n }\r\n " +
" }).fail(function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Error: \' + errorThrown);\r\n " +
" });\r\n }\r\n\r\n " +
" function updateNoSubjects() {\r\n " +
" if (list.find(\'li:visible\').length > 0)\r\n " +
" noSubjects.hide();\r\n else\r\n " +
" noSubjects.show();\r\n }" +
"\r\n\r\n function saveChanges() {\r\n " +
" var form = $(\'#Config_JobQueues_Subjects_Update_Dialog_Form\')." +
"empty();\r\n\r\n list.find(\'li[data-subjectstatus" +
"!=\"removed\"]\').each(function () {\r\n var s" +
"ubjectId = $(this).attr(\'data-subjectid\');\r\n\r\n " +
" form.append($(\'<input>\').attr({\r\n " +
" \'name\': \'Subjects\',\r\n \'type\': \'hid" +
"den\'\r\n }).val(subjectId));\r\n\r\n " +
" }).get();\r\n\r\n form.s" +
"ubmit();\r\n\r\n dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n " +
" }\r\n\r\n $(function () {\r\n" +
" $(\'#Config_JobQueues_Subjects_Update\').click" +
"(showDialog);\r\n });\r\n\r\n " +
" })();\r\n </script>\r\n </div>\r\n");
#line 499 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 503 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
@@ -1432,13 +1437,13 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
" Jobs:</th>\r\n <td>\r\n <div>\r\n");
#line 506 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 510 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line default
#line hidden
#line 506 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 510 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
if (Model.Token.JobQueue.JobSubTypes.Count > 0)
{
@@ -1448,13 +1453,13 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" <ul>\r\n");
#line 509 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 513 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line default
#line hidden
#line 509 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 513 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
foreach (var jobType in Model.Token.JobQueue.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
{
@@ -1466,7 +1471,7 @@ WriteLiteral(" <li>\r\n");
WriteLiteral(" ");
#line 512 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 516 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(jobType.Key.Description);
@@ -1475,13 +1480,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n <ul>\r\n");
#line 514 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 518 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line default
#line hidden
#line 514 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 518 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
{
@@ -1495,7 +1500,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">[All Sub Types]</span></li>\r\n");
#line 517 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 521 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
else
{
@@ -1508,7 +1513,7 @@ WriteLiteral(">[All Sub Types]</span></li>\r\n");
WriteLiteral(" <li>");
#line 522 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 526 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(jobSubType.Description);
@@ -1517,7 +1522,7 @@ WriteLiteral(" <li>");
WriteLiteral("</li>\r\n");
#line 523 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 527 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
}
@@ -1528,7 +1533,7 @@ WriteLiteral(" </ul>\r\n
"\n");
#line 527 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 531 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
@@ -1537,7 +1542,7 @@ WriteLiteral(" </ul>\r\n
WriteLiteral(" </ul>\r\n");
#line 529 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 533 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
else
{
@@ -1552,7 +1557,7 @@ WriteLiteral("&lt;None&gt;");
WriteLiteral("\r\n");
#line 533 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 537 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
@@ -1561,13 +1566,13 @@ WriteLiteral("\r\n");
WriteLiteral(" </div>\r\n");
#line 535 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 539 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line default
#line hidden
#line 535 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 539 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
if (canConfig)
{
@@ -1595,13 +1600,13 @@ WriteLiteral(" title=\"Job Queue Automatic Types\"");
WriteLiteral(">\r\n");
#line 539 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 543 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line default
#line hidden
#line 539 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 543 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
using (Html.BeginForm(MVC.API.JobQueue.UpdateJobSubTypes(Model.Token.JobQueue.Id, null, true)))
{
var selectedTypes = Model.Token.JobQueue.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
@@ -1613,15 +1618,15 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <div");
WriteAttribute("id", Tuple.Create(" id=\"", 28527), Tuple.Create("\"", 28549)
, Tuple.Create(Tuple.Create("", 28532), Tuple.Create("trJobType", 28532), true)
WriteAttribute("id", Tuple.Create(" id=\"", 28953), Tuple.Create("\"", 28975)
, Tuple.Create(Tuple.Create("", 28958), Tuple.Create("trJobType", 28958), true)
#line 544 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28541), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 548 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28967), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 28541), false)
, 28967), false)
);
WriteLiteral(" class=\"jobTypes\"");
@@ -1629,35 +1634,35 @@ WriteLiteral(" class=\"jobTypes\"");
WriteLiteral(">\r\n <h4>\r\n <inp" +
"ut");
WriteAttribute("id", Tuple.Create(" id=\"", 28650), Tuple.Create("\"", 28669)
, Tuple.Create(Tuple.Create("", 28655), Tuple.Create("Types_", 28655), true)
WriteAttribute("id", Tuple.Create(" id=\"", 29076), Tuple.Create("\"", 29095)
, Tuple.Create(Tuple.Create("", 29081), Tuple.Create("Types_", 29081), true)
#line 546 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28661), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 29087), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 28661), false)
, 29087), false)
);
WriteLiteral(" class=\"jobType\"");
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 28702), Tuple.Create("\"", 28718)
WriteAttribute("value", Tuple.Create(" value=\"", 29128), Tuple.Create("\"", 29144)
#line 546 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28710), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 29136), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 28710), false)
, 29136), false)
);
WriteLiteral(" ");
#line 546 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(selectedTypes.Contains(jt) ? "checked=\"checked\"" : null);
@@ -1665,21 +1670,21 @@ WriteLiteral(" ");
#line hidden
WriteLiteral(" /><label");
WriteAttribute("for", Tuple.Create(" for=\"", 28789), Tuple.Create("\"", 28809)
, Tuple.Create(Tuple.Create("", 28795), Tuple.Create("Types_", 28795), true)
WriteAttribute("for", Tuple.Create(" for=\"", 29215), Tuple.Create("\"", 29235)
, Tuple.Create(Tuple.Create("", 29221), Tuple.Create("Types_", 29221), true)
#line 546 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28801), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 29227), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 28801), false)
, 29227), false)
);
WriteLiteral(">");
#line 546 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 550 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(jt.Description);
@@ -1687,15 +1692,15 @@ WriteLiteral(">");
#line hidden
WriteLiteral("</label></h4>\r\n <div");
WriteAttribute("id", Tuple.Create(" id=\"", 28877), Tuple.Create("\"", 28899)
, Tuple.Create(Tuple.Create("", 28882), Tuple.Create("SubTypes_", 28882), true)
WriteAttribute("id", Tuple.Create(" id=\"", 29303), Tuple.Create("\"", 29325)
, Tuple.Create(Tuple.Create("", 29308), Tuple.Create("SubTypes_", 29308), true)
#line 547 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 28891), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 551 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
, Tuple.Create(Tuple.Create("", 29317), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 28891), false)
, 29317), false)
);
WriteLiteral(" class=\"jobSubTypes\"");
@@ -1705,7 +1710,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 548 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 552 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div"));
@@ -1716,7 +1721,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 549 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 553 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.Token.JobQueue.JobSubTypes), 2));
@@ -1726,7 +1731,7 @@ WriteLiteral("\r\n </div>\r\n
"");
#line 552 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 556 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
}
@@ -1774,7 +1779,7 @@ WriteLiteral(" <script>\r\n (function
" })();\r\n </script>\r\n");
#line 617 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 621 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
@@ -1795,7 +1800,7 @@ WriteLiteral("></i>&nbsp;When jobs of these types are created, they will automat
" </table>\r\n</div>\r\n");
#line 625 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 629 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
if (canDelete || canShowJobs)
{
@@ -1811,7 +1816,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 628 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 632 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button"));
@@ -1866,7 +1871,7 @@ WriteLiteral(@">
WriteLiteral(" ");
#line 665 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 669 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
Write(Html.ActionLinkButton(string.Format("Show {0} job{1}", Model.OpenJobCount, (Model.OpenJobCount == 1 ? null : "s")), MVC.Job.Queue(Model.Token.JobQueue.Id), "Config_JobQueues_Actions_ShowJobs_Button"));
@@ -1875,7 +1880,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 667 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
#line 671 "..\..\Areas\Config\Views\JobQueue\Show.cshtml"
}
#line default
@@ -148,22 +148,23 @@
<th style="width: 135px">Primary Domain:
</th>
<td>
<code><strong>@Model.ADPrimaryDomain.DnsName</strong> <span>[@Model.ADPrimaryDomain.NetBiosName]</span></code>
<code><strong>@Model.ADPrimaryDomain.Name</strong> <span>[@Model.ADPrimaryDomain.NetBiosName]</span></code>
</td>
</tr>
<tr>
<th style="width: 135px">Additional Domains:
</th>
<td>
@if (Model.ADAdditionalDomains.Count > 0)
@if (Model.ADDomains.Count > 1)
{
var adDomainFirst = Model.ADAdditionalDomains.First();
<code>@adDomainFirst.DnsName <span>[@adDomainFirst.NetBiosName]</span></code>
foreach (var adDomain in Model.ADAdditionalDomains.Skip(1))
var adAdditionalDomains = Model.ADDomains.Where(d => d != Model.ADPrimaryDomain).OrderBy(d => d.Name).ToList();
var adDomainFirst = adAdditionalDomains.First();
<code>@adDomainFirst.Name <span>[@adDomainFirst.NetBiosName]</span></code>
foreach (var adDomain in adAdditionalDomains.Skip(1))
{
<hr />
<div>
<code>@adDomain.DnsName <span>[@adDomain.NetBiosName]</span></code>
<code>@adDomain.Name <span>[@adDomain.NetBiosName]</span></code>
</div>
}
}
@@ -178,18 +179,42 @@
</th>
<td>
<code><strong>@Model.ADSite.Name</strong></code>
<hr />
</td>
</tr>
<tr>
<th style="width: 135px">Servers:
</th>
<td>
<div>
@if (Model.ADSiteServers.Count > 0)
@if (Model.ADServers.Count > 0)
{
<span>Servers:</span>
<ul class="none">
@foreach (var siteServer in Model.ADSiteServers)
@foreach (var server in Model.ADServers)
{
var server = siteServer.Item1;
var reachable = siteServer.Item2;
var serverDescription = string.Format("{0} [{1}]", server.Name.EndsWith(server.Domain.Name, StringComparison.OrdinalIgnoreCase) ? server.Name.Substring(0, server.Name.Length - server.Domain.Name.Length - 1) : server.Name, server.Domain.NetBiosName);
var reachable = server.IsAvailable;
<li>
<i class="fa @(reachable ? "fa-check success" : "fa-exclamation warning") fa-fw fa-lg" title="@(reachable ? "Reachable" : "Unavailable")"></i>&nbsp;<code>@(server.Name)</code>
@if (server.IsAvailable)
{
<i class="fa fa-check success fa-fw fa-lg" title="Available"></i>
}
else
{
<i class="fa fa-exclamation warning fa-fw fa-lg" title="Unavailable, will retry at @(server.AvailableWhen.Value.ToLongTimeString())"></i>
}
<code>@(serverDescription)</code>
@if (server.IsSiteServer)
{
<i class="fa fa-building-o information fa-fw" title="Site Server"></i>
}
else
{
<i class="fa fa-globe warning fa-fw" title="Not a Site Server"></i>
}
@if (server.IsWritable)
{
<i class="fa fa-pencil information fa-fw" title="Writable Domain Controller"></i>
}
</li>
}
</ul>
@@ -210,11 +235,12 @@
@if (Model.ADForestServers == null)
{
<div>
@Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchEntireForest)
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
</div>
<div style="padding: 0.7em 0.7em;" class="ui-state-highlight ui-corner-all">
<i class="fa fa-info-circle information"></i>&nbsp;Forest servers are currently being retrieved.
<br />Try refreshing this page in a moment.
<br />
Try refreshing this page in a moment.
</div>
}
else
@@ -225,20 +251,20 @@
<div>
@if (!canSearchEntireForest)
{
@Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchEntireForest)
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
<div style="padding: 0.7em 0.7em;" class="ui-state-highlight ui-corner-all">
<i class="fa fa-exclamation-circle warning"></i>&nbsp;Disco will not search entire forests which consist of more than @(Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxForestServerSearch) servers. Only servers within this site will be searched.
</div>
}
else
{
@Html.CheckBoxFor(m => m.ADSearchEntireForest) @Html.LabelFor(m => m.ADSearchEntireForest) @AjaxHelpers.AjaxLoader()
@Html.CheckBoxFor(m => m.ADSearchAllForestServers) @Html.LabelFor(m => m.ADSearchAllForestServers) @AjaxHelpers.AjaxLoader()
<div class="smallMessage">
If this setting is enabled, Disco will search all servers within the forest rather than only servers within this site.
If this setting is enabled, Disco will query all servers within the forest rather than only servers within this site.
</div>
<script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper($('#ADSearchEntireForest'), null, '@(Url.Action(MVC.API.System.UpdateActiveDirectorySearchEntireForest()))', 'SearchEntireForest');
document.DiscoFunctions.PropertyChangeHelper($('#ADSearchAllForestServers'), null, '@(Url.Action(MVC.API.System.UpdateActiveDirectorySearchAllForestServers()))', 'SearchAllForestServers');
});
</script>
}
@@ -247,7 +273,7 @@
else
{
<div>
@Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchEntireForest)
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
<div class="smallMessage">
If this setting is enabled, Disco will search all servers within the forest rather than only servers within this site.
</div>
@@ -255,11 +281,25 @@
}
<div>
<hr />
<span>Servers:</span>
<ul id="Config_System_AD_ForestServers">
@foreach (var server in Model.ADForestServers.OrderBy(s => s))
<span>All Servers:</span>
<ul id="Config_System_AD_ForestServers" class="none">
@{
var domainIndex = Model.ADDomains.ToDictionary(d => d.Name, StringComparer.OrdinalIgnoreCase);
foreach (var server in Model.ADForestServers.OrderBy(s => s))
{
var isSiteServer = Model.ADServers.Any(s => s.IsSiteServer && s.Name.Equals(server, StringComparison.OrdinalIgnoreCase));
var serverDescription = server;
if (server.Contains('.'))
{
Disco.Services.Interop.ActiveDirectory.ADDomain serverDomain;
if (domainIndex.TryGetValue(server.Substring(server.IndexOf('.') + 1), out serverDomain))
{
<li><code>@server</code> @(Model.ADSiteServers.Count(ss => ss.Item1.Name.Equals(server, StringComparison.InvariantCultureIgnoreCase)) > 0 ? "[Site Server]" : null)</li>
serverDescription = string.Format("{0} [{1}]", server.Substring(0, server.IndexOf('.')), serverDomain.NetBiosName);
}
}
<li><code>@serverDescription</code>@if (isSiteServer)
{ <i class="fa fa-building-o information fa-fw" title="Site Server"></i> }</li>
}
}
</ul>
<script>
@@ -502,7 +502,7 @@ WriteLiteral(">Primary Domain:\r\n </th>\r\n <td>\r\n
#line 151 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.ADPrimaryDomain.DnsName);
Write(Model.ADPrimaryDomain.Name);
#line default
@@ -511,7 +511,7 @@ WriteLiteral("</strong> <span>[");
#line 151 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.ADPrimaryDomain.NetBiosName);
Write(Model.ADPrimaryDomain.NetBiosName);
#line default
@@ -530,9 +530,10 @@ WriteLiteral(">Additional Domains:\r\n </th>\r\n <td>\r\n"
#line hidden
#line 158 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.ADAdditionalDomains.Count > 0)
if (Model.ADDomains.Count > 1)
{
var adDomainFirst = Model.ADAdditionalDomains.First();
var adAdditionalDomains = Model.ADDomains.Where(d => d != Model.ADPrimaryDomain).OrderBy(d => d.Name).ToList();
var adDomainFirst = adAdditionalDomains.First();
#line default
@@ -540,8 +541,8 @@ WriteLiteral(">Additional Domains:\r\n </th>\r\n <td>\r\n"
WriteLiteral(" <code>");
#line 161 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomainFirst.DnsName);
#line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomainFirst.Name);
#line default
@@ -549,8 +550,8 @@ WriteLiteral(" <code>");
WriteLiteral(" <span>[");
#line 161 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomainFirst.NetBiosName);
#line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomainFirst.NetBiosName);
#line default
@@ -558,8 +559,8 @@ WriteLiteral(" <span>[");
WriteLiteral("]</span></code>\r\n");
#line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var adDomain in Model.ADAdditionalDomains.Skip(1))
#line 163 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var adDomain in adAdditionalDomains.Skip(1))
{
@@ -570,8 +571,8 @@ WriteLiteral(" <hr />\r\n");
WriteLiteral(" <div>\r\n <code>");
#line 166 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomain.DnsName);
#line 167 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomain.Name);
#line default
@@ -579,8 +580,8 @@ WriteLiteral(" <div>\r\n <code>");
WriteLiteral(" <span>[");
#line 166 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomain.NetBiosName);
#line 167 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adDomain.NetBiosName);
#line default
@@ -588,7 +589,7 @@ WriteLiteral(" <span>[");
WriteLiteral("]</span></code>\r\n </div>\r\n");
#line 168 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 169 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
}
else
@@ -604,7 +605,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None&gt;</span>\r\n");
#line 173 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 174 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -617,30 +618,33 @@ WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Site:\r\n </th>\r\n <td>\r\n <code><strong>");
#line 180 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 181 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.ADSite.Name);
#line default
#line hidden
WriteLiteral("</strong></code>\r\n <hr />\r\n <div>\r\n");
WriteLiteral("</strong></code>\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
"");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Servers:\r\n </th>\r\n <td>\r\n <div>\r\n");
#line 183 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 189 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 183 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.ADSiteServers.Count > 0)
#line 189 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.ADServers.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <span>Servers:</span>\r\n");
WriteLiteral(" <ul");
WriteLiteral(" class=\"none\"");
@@ -648,59 +652,167 @@ WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 187 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 187 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var siteServer in Model.ADSiteServers)
#line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var server in Model.ADServers)
{
var server = siteServer.Item1;
var reachable = siteServer.Item2;
var serverDescription = string.Format("{0} [{1}]", server.Name.EndsWith(server.Domain.Name, StringComparison.OrdinalIgnoreCase) ? server.Name.Substring(0, server.Name.Length - server.Domain.Name.Length - 1) : server.Name, server.Domain.NetBiosName);
var reachable = server.IsAvailable;
#line default
#line hidden
WriteLiteral(" <li>\r\n <i");
WriteLiteral(" <li>\r\n");
WriteAttribute("class", Tuple.Create(" class=\"", 7471), Tuple.Create("\"", 7554)
, Tuple.Create(Tuple.Create("", 7479), Tuple.Create("fa", 7479), true)
#line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create(" ", 7481), Tuple.Create<System.Object, System.Int32>(reachable ? "fa-check success" : "fa-exclamation warning"
#line 197 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
, 7482), false)
, Tuple.Create(Tuple.Create(" ", 7542), Tuple.Create("fa-fw", 7543), true)
, Tuple.Create(Tuple.Create(" ", 7548), Tuple.Create("fa-lg", 7549), true)
#line 197 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (server.IsAvailable)
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-check success fa-fw fa-lg\"");
WriteLiteral(" title=\"Available\"");
WriteLiteral("></i>\r\n");
#line 200 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-exclamation warning fa-fw fa-lg\"");
WriteAttribute("title", Tuple.Create(" title=\"", 8221), Tuple.Create("\"", 8304)
, Tuple.Create(Tuple.Create("", 8229), Tuple.Create("Unavailable,", 8229), true)
, Tuple.Create(Tuple.Create(" ", 8241), Tuple.Create("will", 8242), true)
, Tuple.Create(Tuple.Create(" ", 8246), Tuple.Create("retry", 8247), true)
, Tuple.Create(Tuple.Create(" ", 8252), Tuple.Create("at", 8253), true)
#line 203 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create(" ", 8255), Tuple.Create<System.Object, System.Int32>(server.AvailableWhen.Value.ToLongTimeString()
#line default
#line hidden
, 8256), false)
);
WriteAttribute("title", Tuple.Create(" title=\"", 7555), Tuple.Create("\"", 7605)
#line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 7563), Tuple.Create<System.Object, System.Int32>(reachable ? "Reachable" : "Unavailable"
#line default
#line hidden
, 7563), false)
);
WriteLiteral("></i>&nbsp;<code>");
WriteLiteral("></i>\r\n");
#line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(server.Name);
#line 204 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</code>\r\n </li>\r\n");
WriteLiteral(" <code>");
#line 194 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 205 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(serverDescription);
#line default
#line hidden
WriteLiteral("</code>\r\n");
#line 206 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 206 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (server.IsSiteServer)
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-building-o information fa-fw\"");
WriteLiteral(" title=\"Site Server\"");
WriteLiteral("></i>\r\n");
#line 209 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-globe warning fa-fw\"");
WriteLiteral(" title=\"Not a Site Server\"");
WriteLiteral("></i>\r\n");
#line 213 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 214 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (server.IsWritable)
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-pencil information fa-fw\"");
WriteLiteral(" title=\"Writable Domain Controller\"");
WriteLiteral("></i>\r\n");
#line 217 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </li>\r\n");
#line 219 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -709,7 +821,7 @@ WriteLiteral("</code>\r\n </li>\r\n");
WriteLiteral(" </ul>\r\n");
#line 196 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 221 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
@@ -728,7 +840,7 @@ WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\"");
WriteLiteral("></i>&nbsp;<span>None Found</span>\r\n </div>\r\n");
#line 202 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 227 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -742,13 +854,13 @@ WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Forest:\r\n </th>\r\n <td>\r\n");
#line 210 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 210 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.ADForestServers == null)
{
@@ -760,8 +872,8 @@ WriteLiteral(" <div>\r\n");
WriteLiteral(" ");
#line 213 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }));
#line 238 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }));
#line default
@@ -769,8 +881,8 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 213 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchEntireForest));
#line 238 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchAllForestServers));
#line default
@@ -788,10 +900,11 @@ WriteLiteral(">\r\n <i");
WriteLiteral(" class=\"fa fa-info-circle information\"");
WriteLiteral("></i>&nbsp;Forest servers are currently being retrieved.\r\n " +
" <br />Try refreshing this page in a moment.\r\n </div>\r\n");
" <br />\r\n Try refreshing this page in a moment.\r\n " +
" </div>\r\n");
#line 219 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 245 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
@@ -805,13 +918,13 @@ WriteLiteral("></i>&nbsp;Forest servers are currently being retrieved.\r\n
WriteLiteral(" <div>\r\n");
#line 226 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 252 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 226 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 252 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (!canSearchEntireForest)
{
@@ -819,28 +932,28 @@ WriteLiteral(" <div>\r\n");
#line default
#line hidden
#line 228 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }));
#line 254 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }));
#line default
#line hidden
#line 228 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 254 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 228 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchEntireForest));
#line 254 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchAllForestServers));
#line default
#line hidden
#line 228 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 254 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
@@ -858,7 +971,7 @@ WriteLiteral(" class=\"fa fa-exclamation-circle warning\"");
WriteLiteral("></i>&nbsp;Disco will not search entire forests which consist of more than ");
#line 230 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 256 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxForestServerSearch);
@@ -868,7 +981,7 @@ WriteLiteral(" servers. Only servers within this site will be searched.\r\n
" </div>\r\n");
#line 232 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 258 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
@@ -877,41 +990,41 @@ WriteLiteral(" servers. Only servers within this site will be searched.\r\n
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchEntireForest));
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchAllForestServers));
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchEntireForest));
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchAllForestServers));
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 235 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 261 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
@@ -920,26 +1033,26 @@ WriteLiteral(" <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n If this setting is enabled, Disco will search " +
"all servers within the forest rather than only servers within this site.\r\n " +
" </div>\r\n");
WriteLiteral(">\r\n If this setting is enabled, Disco will query a" +
"ll servers within the forest rather than only servers within this site.\r\n " +
" </div>\r\n");
WriteLiteral(" <script>\r\n $(function " +
"() {\r\n document.DiscoFunctions.PropertyChange" +
"Helper($(\'#ADSearchEntireForest\'), null, \'");
"Helper($(\'#ADSearchAllForestServers\'), null, \'");
#line 241 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Url.Action(MVC.API.System.UpdateActiveDirectorySearchEntireForest()));
#line 267 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Url.Action(MVC.API.System.UpdateActiveDirectorySearchAllForestServers()));
#line default
#line hidden
WriteLiteral("\', \'SearchEntireForest\');\r\n });\r\n " +
" </script>\r\n");
WriteLiteral("\', \'SearchAllForestServers\');\r\n });\r\n " +
" </script>\r\n");
#line 244 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 270 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -948,7 +1061,7 @@ WriteLiteral("\', \'SearchEntireForest\');\r\n })
WriteLiteral(" </div>\r\n");
#line 246 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 272 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
@@ -961,8 +1074,8 @@ WriteLiteral(" <div>\r\n");
WriteLiteral(" ");
#line 250 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchEntireForest, new { disabled = "disabled" }));
#line 276 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }));
#line default
@@ -970,8 +1083,8 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 250 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchEntireForest));
#line 276 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.LabelFor(m => m.ADSearchAllForestServers));
#line default
@@ -985,29 +1098,43 @@ WriteLiteral(">\r\n If this setting is enabled, Disco
" </div>\r\n </div>\r\n");
#line 255 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 281 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div>\r\n <hr />\r\n " +
" <span>Servers:</span>\r\n <ul");
" <span>All Servers:</span>\r\n <ul");
WriteLiteral(" id=\"Config_System_AD_ForestServers\"");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 260 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 286 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 260 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var server in Model.ADForestServers.OrderBy(s => s))
#line 286 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
var domainIndex = Model.ADDomains.ToDictionary(d => d.Name, StringComparer.OrdinalIgnoreCase);
foreach (var server in Model.ADForestServers.OrderBy(s => s))
{
var isSiteServer = Model.ADServers.Any(s => s.IsSiteServer && s.Name.Equals(server, StringComparison.OrdinalIgnoreCase));
var serverDescription = server;
if (server.Contains('.'))
{
Disco.Services.Interop.ActiveDirectory.ADDomain serverDomain;
if (domainIndex.TryGetValue(server.Substring(server.IndexOf('.') + 1), out serverDomain))
{
serverDescription = string.Format("{0} [{1}]", server.Substring(0, server.IndexOf('.')), serverDomain.NetBiosName);
}
}
#line default
@@ -1015,31 +1142,46 @@ WriteLiteral(">\r\n");
WriteLiteral(" <li><code>");
#line 262 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(server);
#line 300 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(serverDescription);
#line default
#line hidden
WriteLiteral("</code> ");
WriteLiteral("</code>");
#line 262 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.ADSiteServers.Count(ss => ss.Item1.Name.Equals(server, StringComparison.InvariantCultureIgnoreCase)) > 0 ? "[Site Server]" : null);
#line 300 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (isSiteServer)
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-building-o information fa-fw\"");
WriteLiteral(" title=\"Site Server\"");
WriteLiteral("></i> ");
#line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 263 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line 302 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(@" </ul>
WriteLiteral(@"
</ul>
<script>
$(function () {
var toManyServers = 5;
@@ -1066,7 +1208,7 @@ WriteLiteral(@" </ul>
");
#line 288 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 328 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -1079,13 +1221,13 @@ WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Search Scope:\r\n </th>\r\n <td>\r\n");
#line 295 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 335 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 295 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 335 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.ADSearchContainers != null && Model.ADSearchContainers.Count > 0)
{
@@ -1102,13 +1244,13 @@ WriteLiteral(" id=\"Config_System_AD_SearchScope_DistinguishedNames\"");
WriteLiteral(">\r\n");
#line 299 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 339 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 299 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 339 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
foreach (var adContainer in Model.ADSearchContainers)
{
@@ -1120,7 +1262,7 @@ WriteLiteral(" <li");
WriteLiteral(" data-distinguishedname=\"");
#line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 341 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adContainer.Item1);
@@ -1131,7 +1273,7 @@ WriteLiteral("\"");
WriteLiteral("><code>");
#line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 341 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(adContainer.Item3);
@@ -1140,7 +1282,7 @@ WriteLiteral("><code>");
WriteLiteral("</code></li>\r\n");
#line 302 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 342 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -1149,7 +1291,7 @@ WriteLiteral("</code></li>\r\n");
WriteLiteral(" </ul>\r\n");
#line 304 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 344 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
@@ -1167,7 +1309,7 @@ WriteLiteral(">When searching, the entire domain will be queried. This is suitab
"gle-domain deployments.</div>\r\n");
#line 309 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 349 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -1176,7 +1318,7 @@ WriteLiteral(">When searching, the entire domain will be queried. This is suitab
WriteLiteral(" ");
#line 310 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 350 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (canConfigAD)
{
@@ -1211,7 +1353,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 318 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 358 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -1227,13 +1369,13 @@ WriteLiteral(" class=\"organisationalUnitTree\"");
WriteLiteral(">\r\n </div>\r\n");
#line 322 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 362 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 322 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 362 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
using (Html.BeginForm(MVC.API.System.UpdateActiveDirectorySearchScope(null, redirect: true)))
{
}
@@ -1280,7 +1422,7 @@ WriteLiteral(" <script>\r\n $(function
"\');\r\n\r\n $.getJSON(\'");
#line 376 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 416 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Url.Action(MVC.API.System.DomainOrganisationalUnits()));
@@ -1326,7 +1468,7 @@ WriteLiteral("\', null, function (data) {\r\n
"\r\n </script>\r\n");
#line 433 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 473 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -1335,7 +1477,7 @@ WriteLiteral("\', null, function (data) {\r\n
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
#line 438 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 478 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (canConfigProxy)
{
using (Html.BeginForm(MVC.API.System.UpdateProxySettings()))
@@ -1360,7 +1502,7 @@ WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 489 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyAddress));
@@ -1371,7 +1513,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 450 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 490 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyAddress));
@@ -1387,7 +1529,7 @@ WriteLiteral(">Port:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 457 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 497 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyPort));
@@ -1398,7 +1540,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 458 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 498 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyPort));
@@ -1414,7 +1556,7 @@ WriteLiteral(">Username:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 465 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 505 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyUsername));
@@ -1425,7 +1567,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 466 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 506 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyUsername));
@@ -1441,7 +1583,7 @@ WriteLiteral(">Password:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 473 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 513 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyPassword));
@@ -1452,7 +1594,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 474 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 514 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyPassword));
@@ -1474,7 +1616,7 @@ WriteLiteral(" value=\"Save Proxy Settings\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 486 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 526 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
}
else
@@ -1499,7 +1641,7 @@ WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 497 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 537 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyAddress));
@@ -1515,7 +1657,7 @@ WriteLiteral(">Port:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 504 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 544 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyPort));
@@ -1531,7 +1673,7 @@ WriteLiteral(">Username:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 511 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 551 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyUsername));
@@ -1546,7 +1688,7 @@ WriteLiteral(">Password:\r\n </th>\r\n <td>*******
"</td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 522 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 562 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
@@ -1561,7 +1703,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 524 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 564 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));