Certificate/wireless plugins; major refactoring
Migrate much of BI to Services. Added Wireless Profile Provider plugin feature. Added Certificate Authority Provider plugin feature. Modified Certificate Provider plugin feature. Database migration v17, for Device Profiles. Enrolment Client Updated to support CA Certificates, Wireless Profiles and Hardware Info. New Client Enrolment Protocol to support new features. Plugin Manifest Generator added to main solution. Improved AD search performance.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Authorization.Roles;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
|
||||
@@ -703,7 +703,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[DiscoAuthorize(Claims.DiscoAdminAccount)]
|
||||
public virtual ActionResult MigrateDeviceMacAddressesFromLog()
|
||||
{
|
||||
var taskStatus = Disco.BI.DeviceBI.Migration.LogMacAddressImporting.ScheduleImmediately();
|
||||
var taskStatus = Disco.Services.Devices.Enrolment.LogMacAddressImportingTask.ScheduleImmediately();
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(taskStatus.SessionId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.CertificateAuthorityProvider;
|
||||
using Disco.Services.Plugins.Features.CertificateProvider;
|
||||
using Disco.Services.Plugins.Features.WirelessProfileProvider;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
@@ -16,7 +22,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
const string pName = "name";
|
||||
const string pShortName = "shortname";
|
||||
const string pDistributionType = "distributiontype";
|
||||
const string pCertificateProviderId = "certificateproviderid";
|
||||
const string pCertificateProviders = "certificateproviders";
|
||||
const string pCertificateAuthorityProviders = "certificateauthorityproviders";
|
||||
const string pWirelessProfileProviders = "wirelessprofileproviders";
|
||||
const string pOrganisationalUnit = "organisationalunit";
|
||||
const string pDefaultOrganisationAddress = "defaultorganisationaddress";
|
||||
const string pComputerNameTemplate = "computernametemplate";
|
||||
@@ -56,8 +64,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
case pDistributionType:
|
||||
UpdateDistributionType(deviceProfile, value);
|
||||
break;
|
||||
case pCertificateProviderId:
|
||||
UpdateCertificateProviderId(deviceProfile, value);
|
||||
case pCertificateProviders:
|
||||
UpdateCertificateProviders(deviceProfile, value);
|
||||
break;
|
||||
case pCertificateAuthorityProviders:
|
||||
UpdateCertificateAuthorityProviders(deviceProfile, value);
|
||||
break;
|
||||
case pWirelessProfileProviders:
|
||||
UpdateWirelessProfileProviders(deviceProfile, value);
|
||||
break;
|
||||
case pOrganisationalUnit:
|
||||
UpdateOrganisationalUnit(deviceProfile, value);
|
||||
@@ -139,9 +153,21 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
public virtual ActionResult UpdateCertificateProviderId(int id, string CertificateProviderId = null, Nullable<bool> redirect = null)
|
||||
public virtual ActionResult UpdateCertificateProviders(int id, string CertificateProviders = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pCertificateProviderId, CertificateProviderId, redirect);
|
||||
return Update(id, pCertificateProviders, CertificateProviders, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
public virtual ActionResult UpdateCertificateAuthorityProviders(int id, string CertificateAuthorityProviders = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pCertificateAuthorityProviders, CertificateAuthorityProviders, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
public virtual ActionResult UpdateWirelessProfileProviders(int id, string WirelessProfileProviders = null, Nullable<bool> redirect = null)
|
||||
{
|
||||
return Update(id, pWirelessProfileProviders, WirelessProfileProviders, redirect);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
@@ -298,21 +324,111 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
throw new Exception("Invalid Distribution Type Number");
|
||||
}
|
||||
|
||||
private void UpdateCertificateProviderId(Disco.Models.Repository.DeviceProfile deviceProfile, string CertificateProviderId)
|
||||
private void UpdateCertificateProviders(DeviceProfile deviceProfile, string CertificateProviderIds)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(CertificateProviderId))
|
||||
if (string.IsNullOrWhiteSpace(CertificateProviderIds))
|
||||
{
|
||||
deviceProfile.CertificateProviderId = null;
|
||||
deviceProfile.CertificateProviders = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Validate
|
||||
var featureManifest = Disco.Services.Plugins.Plugins.GetPluginFeature(CertificateProviderId, typeof(Disco.Services.Plugins.Features.CertificateProvider.CertificateProviderFeature));
|
||||
if (featureManifest == null)
|
||||
throw new Exception(string.Format("Invalid Certificate Provider Plugin Id: [{0}]", CertificateProviderId));
|
||||
var validatedProviders = new List<PluginFeatureManifest>();
|
||||
foreach (var certificateProviderId in CertificateProviderIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
var featureManifest = Plugins.GetPluginFeature(certificateProviderId, typeof(CertificateProviderFeature));
|
||||
if (featureManifest == null)
|
||||
{
|
||||
throw new Exception(string.Format("Invalid Certificate Provider Plugin Id: [{0}]", certificateProviderId));
|
||||
}
|
||||
else
|
||||
{
|
||||
validatedProviders.Add(featureManifest);
|
||||
}
|
||||
}
|
||||
|
||||
if (validatedProviders.Count > 0)
|
||||
{
|
||||
deviceProfile.CertificateProviders = string.Join(",", validatedProviders.Select(p => p.Id));
|
||||
}
|
||||
else
|
||||
deviceProfile.CertificateProviderId = featureManifest.Id;
|
||||
{
|
||||
deviceProfile.CertificateProviders = null;
|
||||
}
|
||||
}
|
||||
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
private void UpdateCertificateAuthorityProviders(DeviceProfile deviceProfile, string CertificateAuthorityProviderIds)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(CertificateAuthorityProviderIds))
|
||||
{
|
||||
deviceProfile.CertificateAuthorityProviders = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Validate
|
||||
var validatedProviders = new List<PluginFeatureManifest>();
|
||||
foreach (var certificateAuthorityProviderId in CertificateAuthorityProviderIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
var featureManifest = Plugins.GetPluginFeature(certificateAuthorityProviderId, typeof(CertificateAuthorityProviderFeature));
|
||||
if (featureManifest == null)
|
||||
{
|
||||
throw new Exception(string.Format("Invalid Certificate Authority Provider Plugin Id: [{0}]", certificateAuthorityProviderId));
|
||||
}
|
||||
else
|
||||
{
|
||||
validatedProviders.Add(featureManifest);
|
||||
}
|
||||
}
|
||||
|
||||
if (validatedProviders.Count > 0)
|
||||
{
|
||||
deviceProfile.CertificateAuthorityProviders = string.Join(",", validatedProviders.Select(p => p.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceProfile.CertificateAuthorityProviders = null;
|
||||
}
|
||||
}
|
||||
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
private void UpdateWirelessProfileProviders(DeviceProfile deviceProfile, string WirelessProfileProviderIds)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(WirelessProfileProviderIds))
|
||||
{
|
||||
deviceProfile.WirelessProfileProviders = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Validate
|
||||
var validatedProviders = new List<PluginFeatureManifest>();
|
||||
foreach (var wirelessProfileProviderId in WirelessProfileProviderIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
var featureManifest = Plugins.GetPluginFeature(wirelessProfileProviderId, typeof(WirelessProfileProviderFeature));
|
||||
if (featureManifest == null)
|
||||
{
|
||||
throw new Exception(string.Format("Invalid Wireless Profile Provider Plugin Id: [{0}]", wirelessProfileProviderId));
|
||||
}
|
||||
else
|
||||
{
|
||||
validatedProviders.Add(featureManifest);
|
||||
}
|
||||
}
|
||||
|
||||
if (validatedProviders.Count > 0)
|
||||
{
|
||||
deviceProfile.WirelessProfileProviders = string.Join(",", validatedProviders.Select(p => p.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
deviceProfile.WirelessProfileProviders = null;
|
||||
}
|
||||
}
|
||||
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using Disco.BI;
|
||||
using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Documents;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Services.Users;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Interop;
|
||||
using Disco.Services.Jobs.JobLists;
|
||||
using Disco.Services.Jobs.Statistics;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Extensions;
|
||||
@@ -528,7 +530,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
private void UpdateDeviceHeldLocation(Job job, string DeviceHeldLocation)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(DeviceHeldLocation) &&
|
||||
Database.DiscoConfiguration.JobPreferences.LocationMode == Disco.Models.BI.Job.LocationModes.RestrictedList)
|
||||
Database.DiscoConfiguration.JobPreferences.LocationMode == LocationModes.RestrictedList)
|
||||
{
|
||||
// Enforce Restricted List Mode
|
||||
var value = DeviceHeldLocation.Trim();
|
||||
@@ -2076,7 +2078,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[DiscoAuthorize(Claims.Job.Show)]
|
||||
public virtual ActionResult StatisticsDailyOpenedClosed()
|
||||
{
|
||||
var result = BI.JobBI.Statistics.DailyOpenedClosed.Data(Database, true);
|
||||
var result = DailyOpenedClosed.Data(Database, true);
|
||||
|
||||
return Json(result, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
@@ -2123,12 +2125,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
switch (Database.DiscoConfiguration.JobPreferences.LocationMode)
|
||||
{
|
||||
case Disco.Models.BI.Job.LocationModes.Unrestricted:
|
||||
case 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.OrdinalIgnoreCase).OrderBy(l => l).ToList();
|
||||
break;
|
||||
case Disco.Models.BI.Job.LocationModes.OptionalList:
|
||||
case Disco.Models.BI.Job.LocationModes.RestrictedList:
|
||||
case LocationModes.OptionalList:
|
||||
case LocationModes.RestrictedList:
|
||||
locations = Database.DiscoConfiguration.JobPreferences.LocationList;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using Disco.Models.BI.Job;
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Jobs.JobQueues;
|
||||
using Disco.Services.Web;
|
||||
using Disco.BI.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Collections.Generic;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Jobs.JobQueues;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Data.Configuration;
|
||||
using Disco.Data.Configuration;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
@@ -29,40 +28,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[DiscoAuthorize(Claims.DiscoAdminAccount)]
|
||||
public virtual ActionResult UpdateAttachmentThumbnails()
|
||||
{
|
||||
// Device Attachments
|
||||
var das = Database.DeviceAttachments.Where(da => da.MimeType == "application/pdf");
|
||||
foreach (var da in das)
|
||||
{
|
||||
var fileName = da.RepositoryThumbnailFilename(Database);
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
{
|
||||
da.GenerateThumbnail(Database);
|
||||
}
|
||||
}
|
||||
|
||||
// User Attachments
|
||||
var uas = Database.UserAttachments.Where(ua => ua.MimeType == "application/pdf");
|
||||
foreach (var ua in uas)
|
||||
{
|
||||
var fileName = ua.RepositoryThumbnailFilename(Database);
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
{
|
||||
ua.GenerateThumbnail(Database);
|
||||
}
|
||||
}
|
||||
|
||||
// Job Attachments
|
||||
var jas = Database.JobAttachments.Where(ja => ja.MimeType == "application/pdf");
|
||||
foreach (var ja in jas)
|
||||
{
|
||||
var fileName = ja.RepositoryThumbnailFilename(Database);
|
||||
if (!System.IO.File.Exists(fileName))
|
||||
{
|
||||
ja.GenerateThumbnail(Database);
|
||||
}
|
||||
}
|
||||
|
||||
return Content("Done", "text/text");
|
||||
var ts = Disco.Services.Documents.AttachmentImport.ThumbnailUpdateTask.ScheduleImmediately();
|
||||
ts.SetFinishedUrl(Url.Action(MVC.Config.SystemConfig.Index()));
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(ts.SessionId));
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.System.Show)]
|
||||
@@ -243,7 +211,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
try
|
||||
{
|
||||
var result = ActiveDirectory.Context.UpdateSearchAllForestServers(Database, SearchAllForestServers);
|
||||
|
||||
|
||||
Database.SaveChanges();
|
||||
|
||||
if (!result)
|
||||
@@ -269,11 +237,24 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.System.ConfigureActiveDirectory)]
|
||||
public virtual ActionResult UpdateActiveDirectorySearchWildcardSuffixOnly(bool SearchWildcardSuffixOnly, bool redirect = false)
|
||||
{
|
||||
ActiveDirectory.Context.UpdateWildcardSearchSuffixOnly(Database, SearchWildcardSuffixOnly);
|
||||
|
||||
Database.SaveChanges();
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.SystemConfig.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorizeAny(Claims.Config.System.ConfigureActiveDirectory, Claims.Config.DeviceProfile.Configure)]
|
||||
public virtual ActionResult DomainOrganisationalUnits()
|
||||
{
|
||||
var domainOUs = ActiveDirectory.RetrieveADOrganisationalUnitStructure()
|
||||
.Select(d => new Models.System.DomainOrganisationalUnitsModel() { Domain = d.Item1, OrganisationalUnits = d.Item2})
|
||||
.Select(d => new Models.System.DomainOrganisationalUnitsModel() { Domain = d.Item1, OrganisationalUnits = d.Item2 })
|
||||
.Select(ous => ous.ToFancyTreeNode()).ToList();
|
||||
|
||||
return new JsonResult()
|
||||
@@ -322,12 +303,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public virtual ActionResult SyncActiveDirectoryManagedGroup(string id, string redirectUrl = null)
|
||||
{
|
||||
ADManagedGroup managedGroup;
|
||||
|
||||
|
||||
if (!ActiveDirectory.Context.ManagedGroups.TryGetValue(id, out managedGroup))
|
||||
throw new ArgumentException("Unknown Managed Group Key");
|
||||
|
||||
var taskStatus = ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||
|
||||
|
||||
if (redirectUrl != null)
|
||||
taskStatus.SetFinishedUrl(redirectUrl);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
@@ -13,7 +13,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
const string pComments = "comments";
|
||||
|
||||
public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null)
|
||||
public virtual ActionResult Update(int id, string key, string value = null, bool? redirect = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
#region Update Shortcut Methods
|
||||
[DiscoAuthorizeAny(Claims.User.Actions.EditFlags)]
|
||||
public virtual ActionResult UpdateComments(int id, string Comments = null, Nullable<bool> redirect = null)
|
||||
public virtual ActionResult UpdateComments(int id, string Comments = null, bool? redirect = null)
|
||||
{
|
||||
return Update(id, pComments, Comments, redirect);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Web;
|
||||
@@ -79,7 +80,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
// Default Batch
|
||||
var m = new Models.DeviceBatch.CreateModel()
|
||||
{
|
||||
DeviceBatch = BI.DeviceBI.BatchUtilities.DefaultNewDeviceBatch(Database)
|
||||
DeviceBatch = DeviceBatches.DefaultNewDeviceBatch(Database)
|
||||
};
|
||||
|
||||
// UI Extensions
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DeviceModel;
|
||||
using Disco.Models.UI.Config.DeviceModel;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.RepairProvider;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Config.DeviceProfile;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.ManagedGroups;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.CertificateAuthorityProvider;
|
||||
using Disco.Services.Plugins.Features.CertificateProvider;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Plugins.Features.WirelessProfileProvider;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -45,6 +47,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
m.DevicesLinkedGroup = devicesManagedGroup;
|
||||
|
||||
m.CertificateProviders = Plugins.GetPluginFeatures(typeof(CertificateProviderFeature));
|
||||
m.CertificateAuthorityProviders = Plugins.GetPluginFeatures(typeof(CertificateAuthorityProviderFeature));
|
||||
m.WirelessProfileProviders = Plugins.GetPluginFeatures(typeof(WirelessProfileProviderFeature));
|
||||
|
||||
var DistributionValues = Enum.GetValues(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes));
|
||||
m.DeviceProfileDistributionTypes = new List<SelectListItem>();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Expressions;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Web;
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.UI.Config.DeviceProfile;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DeviceProfile;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
}
|
||||
|
||||
public List<PluginFeatureManifest> CertificateProviders { get; set; }
|
||||
public List<PluginFeatureManifest> CertificateAuthorityProviders { get; set; }
|
||||
public List<PluginFeatureManifest> WirelessProfileProviders { get; set; }
|
||||
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Expressions;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Web.Extensions;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.BI.Job;
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Models.UI.Config.JobPreferences;
|
||||
using Disco.Services.Extensions;
|
||||
using System;
|
||||
|
||||
@@ -84,6 +84,8 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
|
||||
public ADSite ADSite { get; set; }
|
||||
public List<ADDomainController> ADServers { get; set; }
|
||||
public List<Tuple<string, ADDomain, string>> ADSearchContainers { get; set; }
|
||||
[Display(Name = "Search With Suffix Wildcard Only")]
|
||||
public bool ADSearchWildcardSuffixOnly { get; set; }
|
||||
public List<string> ADForestServers { get; set; }
|
||||
|
||||
#endregion
|
||||
@@ -126,6 +128,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
|
||||
m.ADPrimaryDomain = ActiveDirectory.Context.PrimaryDomain;
|
||||
m.ADSite = ActiveDirectory.Context.Site;
|
||||
m.ADServers = ActiveDirectory.Context.Domains.SelectMany(d => d.DomainControllers).ToList();
|
||||
m.ADSearchWildcardSuffixOnly = config.ActiveDirectory.SearchWildcardSuffixOnly;
|
||||
var configSearchContainers = config.ActiveDirectory.SearchContainers;
|
||||
m.ADSearchContainers = configSearchContainers == null ? null : configSearchContainers.SelectMany(d => d.Value, (k, c) =>
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel
|
||||
@using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
@using Disco.Services.Documents.ManagedGroups;
|
||||
@using Disco.Services.Interop.ActiveDirectory;
|
||||
@using Disco.Web.Areas.Config.Models.Shared;
|
||||
@{
|
||||
|
||||
@@ -27,17 +27,16 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using Disco.BI.DocumentTemplateBI.ManagedGroups;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
|
||||
@@ -112,14 +111,14 @@ WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_DocumentTemplates_Show\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2027), Tuple.Create("\"", 2081)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2024), Tuple.Create("\"", 2078)
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2035), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? "Config_HideAdvanced" : null
|
||||
, Tuple.Create(Tuple.Create("", 2032), Tuple.Create<System.Object, System.Int32>(hideAdvanced ? "Config_HideAdvanced" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2035), false)
|
||||
, 2032), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
@@ -461,23 +460,23 @@ WriteLiteral("></i>This template is generated from ");
|
||||
#line hidden
|
||||
WriteLiteral("s. Any expressions within the Template PDF will be evaluated within the <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 7002), Tuple.Create("\"", 7108)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 6999), Tuple.Create("\"", 7105)
|
||||
|
||||
#line 143 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7009), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser())
|
||||
, Tuple.Create(Tuple.Create("", 7006), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser())
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7009), false)
|
||||
, Tuple.Create(Tuple.Create("", 7071), Tuple.Create("#", 7071), true)
|
||||
, 7006), false)
|
||||
, Tuple.Create(Tuple.Create("", 7068), Tuple.Create("#", 7068), true)
|
||||
|
||||
#line 143 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7072), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Scope
|
||||
, Tuple.Create(Tuple.Create("", 7069), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Scope
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7072), false)
|
||||
, Tuple.Create(Tuple.Create("", 7103), Tuple.Create("Scope", 7103), true)
|
||||
, 7069), false)
|
||||
, Tuple.Create(Tuple.Create("", 7100), Tuple.Create("Scope", 7100), true)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -568,24 +567,24 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <option");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 8220), Tuple.Create("\"", 8234)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 8217), Tuple.Create("\"", 8231)
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8228), Tuple.Create<System.Object, System.Int32>(scope
|
||||
, Tuple.Create(Tuple.Create("", 8225), Tuple.Create<System.Object, System.Int32>(scope
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 8228), false)
|
||||
, 8225), false)
|
||||
);
|
||||
|
||||
WriteAttribute("selected", Tuple.Create(" selected=\"", 8235), Tuple.Create("\"", 8306)
|
||||
WriteAttribute("selected", Tuple.Create(" selected=\"", 8232), Tuple.Create("\"", 8303)
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8246), Tuple.Create<System.Object, System.Int32>(scope == Model.DocumentTemplate.Scope ? "selected" : null
|
||||
, Tuple.Create(Tuple.Create("", 8243), Tuple.Create<System.Object, System.Int32>(scope == Model.DocumentTemplate.Scope ? "selected" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 8246), false)
|
||||
, 8243), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -923,29 +922,29 @@ WriteLiteral(" class=\"jobTypes\"");
|
||||
WriteLiteral(">\r\n <h4>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 14951), Tuple.Create("\"", 14970)
|
||||
, Tuple.Create(Tuple.Create("", 14956), Tuple.Create("Types_", 14956), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 14948), Tuple.Create("\"", 14967)
|
||||
, Tuple.Create(Tuple.Create("", 14953), Tuple.Create("Types_", 14953), true)
|
||||
|
||||
#line 257 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 14962), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 14959), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 14962), false)
|
||||
, 14959), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobType\"");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 15003), Tuple.Create("\"", 15019)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 15000), Tuple.Create("\"", 15016)
|
||||
|
||||
#line 257 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 15011), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 15008), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 15011), false)
|
||||
, 15008), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
@@ -959,15 +958,15 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 15090), Tuple.Create("\"", 15110)
|
||||
, Tuple.Create(Tuple.Create("", 15096), Tuple.Create("Types_", 15096), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 15087), Tuple.Create("\"", 15107)
|
||||
, Tuple.Create(Tuple.Create("", 15093), Tuple.Create("Types_", 15093), true)
|
||||
|
||||
#line 257 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 15102), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 15099), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 15102), false)
|
||||
, 15099), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -982,15 +981,15 @@ WriteLiteral(">");
|
||||
WriteLiteral("</label>\r\n </h4>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 15252), Tuple.Create("\"", 15274)
|
||||
, Tuple.Create(Tuple.Create("", 15257), Tuple.Create("SubTypes_", 15257), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 15249), Tuple.Create("\"", 15271)
|
||||
, Tuple.Create(Tuple.Create("", 15254), Tuple.Create("SubTypes_", 15254), true)
|
||||
|
||||
#line 259 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 15266), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
, Tuple.Create(Tuple.Create("", 15263), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 15266), false)
|
||||
, 15263), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobSubTypes\"");
|
||||
@@ -1111,14 +1110,14 @@ WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" style=\"margin: 8px 5px;\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 20216), Tuple.Create("\"", 20302)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 20213), Tuple.Create("\"", 20299)
|
||||
|
||||
#line 345 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 20222), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.TemplatePreview(Model.DocumentTemplate.Id))
|
||||
, Tuple.Create(Tuple.Create("", 20219), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.TemplatePreview(Model.DocumentTemplate.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 20222), false)
|
||||
, 20219), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </div>\r\n </td>\r\n <" +
|
||||
@@ -2081,16 +2080,16 @@ WriteLiteral(" id=\"dialogBulkGenerate\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 40430), Tuple.Create("\"", 40481)
|
||||
, Tuple.Create(Tuple.Create("", 40438), Tuple.Create("Bulk", 40438), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 40442), Tuple.Create("Generate:", 40443), true)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 40427), Tuple.Create("\"", 40478)
|
||||
, Tuple.Create(Tuple.Create("", 40435), Tuple.Create("Bulk", 40435), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 40439), Tuple.Create("Generate:", 40440), true)
|
||||
|
||||
#line 722 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 40452), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
, Tuple.Create(Tuple.Create(" ", 40449), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 40453), false)
|
||||
, 40450), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ModuleFilter = Disco.BI.DeviceBI.EnrolmentLog.Current,
|
||||
ModuleFilter = Disco.Services.Devices.Enrolment.EnrolmentLog.Current,
|
||||
ViewPortHeight = 250
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -27,7 +27,6 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
@@ -423,7 +422,7 @@ Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ModuleFilter = Disco.BI.DeviceBI.EnrolmentLog.Current,
|
||||
ModuleFilter = Disco.Services.Devices.Enrolment.EnrolmentLog.Current,
|
||||
ViewPortHeight = 250
|
||||
}));
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@
|
||||
logHub = $.connection.logNotifications;
|
||||
logHub.client.receiveLog = parseLog
|
||||
|
||||
$.connection.hub.qs = { LogModules: '@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)' };
|
||||
$.connection.hub.qs = { LogModules: '@(Disco.Services.Devices.Enrolment.EnrolmentLog.Current.LiveLogGroupName)' };
|
||||
$.connection.hub.error(onHubFailed);
|
||||
|
||||
$.connection.hub.start()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -27,7 +27,6 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
@@ -514,7 +513,7 @@ WriteLiteral(@"',
|
||||
|
||||
|
||||
#line 329 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
|
||||
Write(Disco.Services.Devices.Enrolment.EnrolmentLog.Current.LiveLogGroupName);
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<div class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 135px">Disco Version:
|
||||
<th style="width: 135px">
|
||||
Disco Version:
|
||||
</th>
|
||||
<td>
|
||||
<div>
|
||||
@@ -29,7 +30,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Database Connection:
|
||||
<th style="width: 135px">
|
||||
Database Connection:
|
||||
</th>
|
||||
<td>
|
||||
<table class="sub">
|
||||
@@ -46,18 +48,19 @@
|
||||
<td>@Model.DatabaseAuthentication</td>
|
||||
</tr>
|
||||
@{if (Model.DatabaseSqlAuthUsername != null)
|
||||
{
|
||||
<tr>
|
||||
<th>SQL User:</th>
|
||||
<td><span class="code">@Model.DatabaseSqlAuthUsername</span></td>
|
||||
</tr>
|
||||
}
|
||||
{
|
||||
<tr>
|
||||
<th>SQL User:</th>
|
||||
<td><span class="code">@Model.DatabaseSqlAuthUsername</span></td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Data Store Location:
|
||||
<th style="width: 135px">
|
||||
Data Store Location:
|
||||
</th>
|
||||
<td>
|
||||
<span class="code">@Model.DataStoreLocation</span>
|
||||
@@ -71,49 +74,53 @@
|
||||
@{
|
||||
if (Model.UpdateLatestResponse == null)
|
||||
{
|
||||
<tr>
|
||||
<th style="width: 135px">Last Check:
|
||||
</th>
|
||||
<td>
|
||||
<div class="error"><i class="fa fa-exclamation-circle fa-lg"></i> Never</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Last Check:
|
||||
</th>
|
||||
<td>
|
||||
<div class="error"><i class="fa fa-exclamation-circle fa-lg"></i> Never</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<th style="width: 135px">Last Run:
|
||||
</th>
|
||||
<td>
|
||||
<span>@CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.UpdateResponseDate.ToLocalTime())</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Last Run:
|
||||
</th>
|
||||
<td>
|
||||
<span>@CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.UpdateResponseDate.ToLocalTime())</span>
|
||||
</td>
|
||||
</tr>
|
||||
if (Model.UpdateAvailable)
|
||||
{
|
||||
<tr>
|
||||
<th style="width: 135px">Update Available:
|
||||
</th>
|
||||
<td>
|
||||
<div>
|
||||
<i class="fa fa-info-circle fa-lg information"></i> Version @(Model.UpdateLatestResponse.LatestVersion) is available
|
||||
</div>
|
||||
<div class="smallMessage">
|
||||
[Released @(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ReleasedDate))]
|
||||
</div>
|
||||
<div class="smallMessage">@(new HtmlString(Model.UpdateLatestResponse.Description))</div>
|
||||
<a href="@(Model.UpdateLatestResponse.UrlLink)" target="_blank">Download Now</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Update Available:
|
||||
</th>
|
||||
<td>
|
||||
<div>
|
||||
<i class="fa fa-info-circle fa-lg information"></i> Version @(Model.UpdateLatestResponse.LatestVersion) is available
|
||||
</div>
|
||||
<div class="smallMessage">
|
||||
[Released @(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ReleasedDate))]
|
||||
</div>
|
||||
<div class="smallMessage">@(new HtmlString(Model.UpdateLatestResponse.Description))</div>
|
||||
<a href="@(Model.UpdateLatestResponse.UrlLink)" target="_blank">Download Now</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr>
|
||||
<th style="width: 135px">Status:
|
||||
</th>
|
||||
<td>
|
||||
<i class="fa fa-check-square fa-lg success"></i> <span>The latest version is installed</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Status:
|
||||
</th>
|
||||
<td>
|
||||
<i class="fa fa-check-square fa-lg success"></i> <span>The latest version is installed</span>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,13 +130,13 @@
|
||||
@{
|
||||
if (Model.UpdateRunningStatus == null)
|
||||
{
|
||||
<span>@Html.ActionLinkSmallButton("Check Now", MVC.API.System.UpdateCheck())</span>
|
||||
<span class="smallMessage">[Will run automatically <strong>@CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown")</strong>]</span>
|
||||
<span>@Html.ActionLinkSmallButton("Check Now", MVC.API.System.UpdateCheck())</span>
|
||||
<span class="smallMessage">[Will run automatically <strong>@CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown")</strong>]</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@Html.ActionLink("View Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId))</span>
|
||||
<span class="smallMessage">[Running Now]</span>
|
||||
<span>@Html.ActionLink("View Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId))</span>
|
||||
<span class="smallMessage">[Running Now]</span>
|
||||
}
|
||||
}
|
||||
@if (Model.UpdateBetaDeployment)
|
||||
@@ -145,14 +152,16 @@
|
||||
<h2>Active Directory</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 135px">Primary Domain:
|
||||
<th style="width: 135px">
|
||||
Primary Domain:
|
||||
</th>
|
||||
<td>
|
||||
<code><strong>@Model.ADPrimaryDomain.Name</strong> <span>[@Model.ADPrimaryDomain.NetBiosName]</span></code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Additional Domains:
|
||||
<th style="width: 135px">
|
||||
Additional Domains:
|
||||
</th>
|
||||
<td>
|
||||
@if (Model.ADDomains.Count > 1)
|
||||
@@ -162,10 +171,10 @@
|
||||
<code>@adDomainFirst.Name <span>[@adDomainFirst.NetBiosName]</span></code>
|
||||
foreach (var adDomain in adAdditionalDomains.Skip(1))
|
||||
{
|
||||
<hr />
|
||||
<div>
|
||||
<code>@adDomain.Name <span>[@adDomain.NetBiosName]</span></code>
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
<code>@adDomain.Name <span>[@adDomain.NetBiosName]</span></code>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -175,14 +184,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Site:
|
||||
<th style="width: 135px">
|
||||
Site:
|
||||
</th>
|
||||
<td>
|
||||
<code><strong>@Model.ADSite.Name</strong></code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Servers:
|
||||
<th style="width: 135px">
|
||||
Servers:
|
||||
</th>
|
||||
<td>
|
||||
<div>
|
||||
@@ -229,7 +240,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Forest:
|
||||
<th style="width: 135px">
|
||||
Forest:
|
||||
</th>
|
||||
<td>
|
||||
@if (Model.ADForestServers == null)
|
||||
@@ -249,60 +261,66 @@
|
||||
if (canConfigAD)
|
||||
{
|
||||
var canSearchEntireForest = (Model.ADForestServers.Count <= Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxForestServerSearch);
|
||||
<div>
|
||||
@if (!canSearchEntireForest)
|
||||
{
|
||||
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-exclamation-circle warning"></i>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.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.CheckBoxFor(m => m.ADSearchAllForestServers) @Html.LabelFor(m => m.ADSearchAllForestServers) @AjaxHelpers.AjaxLoader()
|
||||
<div class="smallMessage">
|
||||
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($('#ADSearchAllForestServers'), null, '@(Url.Action(MVC.API.System.UpdateActiveDirectorySearchAllForestServers()))', 'SearchAllForestServers');
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
@if (!canSearchEntireForest)
|
||||
{
|
||||
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-exclamation-circle warning"></i>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.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.CheckBoxFor(m => m.ADSearchAllForestServers) @Html.LabelFor(m => m.ADSearchAllForestServers) @AjaxHelpers.AjaxLoader()
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-info-circle"></i>If this setting is enabled, Disco will query all servers within the forest rather than only servers within this site.
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#ADSearchAllForestServers'), null, '@(Url.Action(MVC.API.System.UpdateActiveDirectorySearchAllForestServers()))', 'SearchAllForestServers');
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>
|
||||
@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>
|
||||
@Html.CheckBoxFor(m => m.ADSearchAllForestServers, new { disabled = "disabled" }) @Html.LabelFor(m => m.ADSearchAllForestServers)
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-info-circle"></i>If this setting is enabled, Disco will query all servers within the forest rather than only servers within this site.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
<hr />
|
||||
<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))
|
||||
{
|
||||
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>
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
<li>
|
||||
<code>@serverDescription</code>@if (isSiteServer)
|
||||
{ <i class="fa fa-building-o information fa-fw" title="Site Server"></i> }
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
<script>
|
||||
@@ -328,11 +346,45 @@
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Searching:
|
||||
</th>
|
||||
<td>
|
||||
@{
|
||||
object ADSearchWildcardSuffixOnlyAttributes = null;
|
||||
if (!canConfigAD)
|
||||
{
|
||||
ADSearchWildcardSuffixOnlyAttributes = new
|
||||
{
|
||||
disabled = "disabled"
|
||||
};
|
||||
}
|
||||
}
|
||||
@Html.CheckBoxFor(m => m.ADSearchWildcardSuffixOnly, ADSearchWildcardSuffixOnlyAttributes) @Html.LabelFor(m => m.ADSearchWildcardSuffixOnly) @AjaxHelpers.AjaxLoader()
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-info-circle"></i>If this setting is enabled, Disco will utilize Active Directory indexes to greatly improve search performance.
|
||||
If disabled, more results may be returned however performance will be reduced especially in large Active Directory domains.
|
||||
</p>
|
||||
</div>
|
||||
@if (canConfigAD)
|
||||
{
|
||||
<script>
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#ADSearchWildcardSuffixOnly'), null, '@(Url.Action(MVC.API.System.UpdateActiveDirectorySearchWildcardSuffixOnly()))', 'SearchWildcardSuffixOnly');
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Search Scope:
|
||||
<th style="width: 135px">
|
||||
Search Scope:
|
||||
</th>
|
||||
<td>
|
||||
@if (Model.ADSearchContainers != null && Model.ADSearchContainers.Count > 0)
|
||||
@@ -347,8 +399,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>No restrictions are in effect.</div>
|
||||
<div class="smallMessage">When searching, the entire domain will be queried. This is suitable for most single-domain deployments.</div>
|
||||
<div>No Organisational Unit restrictions are in effect.</div>
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-info-circle"></i>When searching, the entire domain will be queried. This is suitable for most single-domain deployments.
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@if (canConfigAD)
|
||||
{
|
||||
@@ -475,88 +531,96 @@
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@if (canConfigProxy)
|
||||
{
|
||||
using (Html.BeginForm(MVC.API.System.UpdateProxySettings()))
|
||||
{
|
||||
<div class="form" style="width: 450px; margin-top: 15px;">
|
||||
<h2>Proxy Settings</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 135px">Address:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyAddress)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyAddress)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Port:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyPort)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyPort)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Username:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyUsername)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyUsername)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Password:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyPassword)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyPassword)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
</th>
|
||||
<td>
|
||||
<button id="Config_System_Proxy_Save" type="button" class="button small">Save Proxy Settings</button>@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var button = $('#Config_System_Proxy_Save');
|
||||
{
|
||||
<div class="form" style="width: 450px; margin-top: 15px;">
|
||||
<h2>Proxy Settings</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Address:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyAddress)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyAddress)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Port:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyPort)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyPort)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Username:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyUsername)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyUsername)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
Password:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.ProxyPassword)<br />
|
||||
@Html.ValidationMessageFor(m => m.ProxyPassword)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">
|
||||
|
||||
</th>
|
||||
<td>
|
||||
<button id="Config_System_Proxy_Save" type="button" class="button small">Save Proxy Settings</button>@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var button = $('#Config_System_Proxy_Save');
|
||||
|
||||
button.click(function () {
|
||||
var url = '@(Url.Action(MVC.API.System.UpdateProxySettings()))';
|
||||
var data = {
|
||||
ProxyAddress: $('#ProxyAddress').val(),
|
||||
ProxyPort: $('#ProxyPort').val(),
|
||||
ProxyUsername: $('#ProxyUsername').val(),
|
||||
ProxyPassword: $('#ProxyPassword').val()
|
||||
}
|
||||
var ajaxLoading = button.next('.ajaxLoading').first().show();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: url,
|
||||
data: data,
|
||||
success: function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change property "' + UpdatePropertyName + '":\n' + response);
|
||||
ajaxLoading.hide();
|
||||
} else {
|
||||
ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
button.click(function () {
|
||||
var url = '@(Url.Action(MVC.API.System.UpdateProxySettings()))';
|
||||
var data = {
|
||||
ProxyAddress: $('#ProxyAddress').val(),
|
||||
ProxyPort: $('#ProxyPort').val(),
|
||||
ProxyUsername: $('#ProxyUsername').val(),
|
||||
ProxyPassword: $('#ProxyPassword').val()
|
||||
}
|
||||
var ajaxLoading = button.next('.ajaxLoading').first().show();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: url,
|
||||
data: data,
|
||||
success: function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change property "' + UpdatePropertyName + '":\n' + response);
|
||||
ajaxLoading.hide();
|
||||
} else {
|
||||
ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -565,30 +629,35 @@ else
|
||||
<h2>Proxy Settings</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 135px">Address:
|
||||
<th style="width: 135px">
|
||||
Address:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(m => m.ProxyAddress)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Port:
|
||||
<th style="width: 135px">
|
||||
Port:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(m => m.ProxyPort)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Username:
|
||||
<th style="width: 135px">
|
||||
Username:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(m => m.ProxyUsername)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 135px">Password:
|
||||
<th style="width: 135px">
|
||||
Password:
|
||||
</th>
|
||||
<td>********
|
||||
<td>
|
||||
********
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,6 @@
|
||||
<pages pageBaseType="Disco.Services.Web.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="Disco" />
|
||||
<add namespace="Disco.BI.Extensions" />
|
||||
<add namespace="Disco.Models.Repository" />
|
||||
<add namespace="Disco.Services" />
|
||||
<add namespace="Disco.Services.Authorization" />
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using System;
|
||||
|
||||
namespace Disco.Web.Areas.Public.Models.UserHeldDevices
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="Disco.Services.Web.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="Disco.BI.Extensions" />
|
||||
<add namespace="Disco.Models.Repository" />
|
||||
<add namespace="Disco.Services" />
|
||||
<add namespace="Disco.Services.Authorization" />
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.ClientServices;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Devices.Enrolment;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Script.Serialization;
|
||||
|
||||
namespace Disco.Web.Areas.Services.Controllers
|
||||
{
|
||||
@@ -34,8 +34,31 @@ namespace Disco.Web.Areas.Services.Controllers
|
||||
{
|
||||
case "enrol":
|
||||
{
|
||||
JavaScriptSerializer serializer = new JavaScriptSerializer();
|
||||
Enrol enrolRequest = serializer.Deserialize<Enrol>(base.Request.InputStream.StreamToString());
|
||||
// Ensure supported version
|
||||
if (Request.UserAgent.StartsWith(@"Disco-Client/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Version clientVersion;
|
||||
if (Version.TryParse(Request.UserAgent.Substring(13), out clientVersion))
|
||||
{
|
||||
if (clientVersion < new Version(2, 2))
|
||||
{
|
||||
return new HttpStatusCodeResult(400, "Disco Client not compatible");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var serializer = new JsonSerializer();
|
||||
Enrol enrolRequest;
|
||||
|
||||
Request.InputStream.Position = 0;
|
||||
using (var streamReader = new StreamReader(Request.InputStream))
|
||||
{
|
||||
using (var jsonReader = new JsonTextReader(streamReader))
|
||||
{
|
||||
enrolRequest = serializer.Deserialize<Enrol>(jsonReader);
|
||||
}
|
||||
}
|
||||
|
||||
EnrolResponse enrolResponse = enrolRequest.BuildResponse();
|
||||
return Json(enrolResponse);
|
||||
}
|
||||
@@ -58,18 +81,11 @@ namespace Disco.Web.Areas.Services.Controllers
|
||||
using (var database = new DiscoDataContext())
|
||||
{
|
||||
var host = HttpContext.Request.UserHostAddress;
|
||||
MacSecureEnrolResponse enrolResponse = BI.DeviceBI.DeviceEnrol.MacSecureEnrol(database, host);
|
||||
MacSecureEnrolResponse enrolResponse = DeviceEnrolment.MacSecureEnrol(database, host);
|
||||
database.SaveChanges();
|
||||
return Json(enrolResponse, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
case "register":
|
||||
{
|
||||
Register registerRequest = new Register();
|
||||
this.UpdateModel(registerRequest);
|
||||
RegisterResponse registerResponse = registerRequest.BuildResponse();
|
||||
return Json(registerResponse);
|
||||
}
|
||||
}
|
||||
throw new MissingMethodException(string.Format("Unknown Feature: {0}", feature));
|
||||
}
|
||||
@@ -91,18 +107,34 @@ namespace Disco.Web.Areas.Services.Controllers
|
||||
}
|
||||
case "enrol":
|
||||
{
|
||||
JavaScriptSerializer serializer = new JavaScriptSerializer();
|
||||
Enrol enrolRequest = serializer.Deserialize<Enrol>(base.Request.InputStream.StreamToString());
|
||||
// Ensure supported version
|
||||
if (Request.UserAgent.StartsWith(@"Disco-Client/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Version clientVersion;
|
||||
if (Version.TryParse(Request.UserAgent.Substring(13), out clientVersion))
|
||||
{
|
||||
if (clientVersion < new Version(2, 2))
|
||||
{
|
||||
return new HttpStatusCodeResult(400, "Disco Client not compatible");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var serializer = new JsonSerializer();
|
||||
Enrol enrolRequest;
|
||||
|
||||
Request.InputStream.Position = 0;
|
||||
using (var streamReader = new StreamReader(Request.InputStream))
|
||||
{
|
||||
using (var jsonReader = new JsonTextReader(streamReader))
|
||||
{
|
||||
enrolRequest = serializer.Deserialize<Enrol>(jsonReader);
|
||||
}
|
||||
}
|
||||
|
||||
EnrolResponse enrolResponse = enrolRequest.BuildResponse();
|
||||
return Json(enrolResponse);
|
||||
}
|
||||
case "register":
|
||||
{
|
||||
Register registerRequest = new Register();
|
||||
this.UpdateModel(registerRequest);
|
||||
RegisterResponse registerResponse = registerRequest.BuildResponse();
|
||||
return Json(registerResponse);
|
||||
}
|
||||
}
|
||||
throw new MissingMethodException(string.Format("Unknown Feature: {0}", feature));
|
||||
}
|
||||
@@ -133,9 +165,9 @@ namespace Disco.Web.Areas.Services.Controllers
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(SessionId))
|
||||
Disco.BI.DeviceBI.EnrolmentLog.LogClientError(clientIP, DeviceIdentifier, clientVersion, errorMessage, JsonException);
|
||||
EnrolmentLog.LogClientError(clientIP, DeviceIdentifier, clientVersion, errorMessage, JsonException);
|
||||
else
|
||||
Disco.BI.DeviceBI.EnrolmentLog.LogSessionClientError(SessionId, clientIP, DeviceIdentifier, clientVersion, errorMessage, JsonException);
|
||||
EnrolmentLog.LogSessionClientError(SessionId, clientIP, DeviceIdentifier, clientVersion, errorMessage, JsonException);
|
||||
|
||||
return Content("Error Message Logged");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user