From d8eb8fec8343fd54167a90f3daf8d4d65f311336 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Fri, 26 Jan 2024 16:23:26 +1100 Subject: [PATCH] global support license and validation --- .../Configuration/SystemConfiguration.cs | 45 +- Disco.Services/Disco.Services.csproj | 1 + .../DiscoServices/LicenseValidationTask.cs | 167 +++++ .../Areas/API/Controllers/SystemController.cs | 20 + .../Config/Models/SystemConfig/IndexModel.cs | 9 + .../Config/Views/SystemConfig/Index.cshtml | 80 +++ .../Views/SystemConfig/Index.generated.cs | 585 +++++++++++++----- .../T4MVC/API.SystemController.generated.cs | 28 + 8 files changed, 739 insertions(+), 196 deletions(-) create mode 100644 Disco.Services/Interop/DiscoServices/LicenseValidationTask.cs diff --git a/Disco.Data/Configuration/SystemConfiguration.cs b/Disco.Data/Configuration/SystemConfiguration.cs index bb43b5e5..570f3506 100644 --- a/Disco.Data/Configuration/SystemConfiguration.cs +++ b/Disco.Data/Configuration/SystemConfiguration.cs @@ -319,20 +319,27 @@ namespace Disco.Data.Configuration #endregion #region UpdateCheck - public string DeploymentId + public bool IsLicensed { - get - { - return Get(null); - } + get => LicenseKey != null && LicenseExpiresOn != null && LicenseExpiresOn > DateTime.UtcNow && LicenseError == null; } - public string DeploymentSecret + public string LicenseKey { - get - { - return Get(null); - } + get => Get(null); + set => Set(value); } + public DateTime? LicenseExpiresOn + { + get => Get(null); + set => Set(value); + } + public string LicenseError + { + get => Get(null); + set => Set(value); + } + public string DeploymentId => Get(null); + public string DeploymentSecret => Get(null); public short DeploymentChecksum { get @@ -351,22 +358,10 @@ namespace Disco.Data.Configuration } public UpdateResponseV2 UpdateLastCheckResponse { - get - { - return Get(null); - } - set - { - Set(value); - } - } - public bool UpdateBetaDeployment - { - get - { - return Get(false); - } + get => Get(null); + set => Set(value); } + public bool UpdateBetaDeployment => Get(false); public Version InstalledDatabaseVersion { get diff --git a/Disco.Services/Disco.Services.csproj b/Disco.Services/Disco.Services.csproj index cb6e5646..ef339de0 100644 --- a/Disco.Services/Disco.Services.csproj +++ b/Disco.Services/Disco.Services.csproj @@ -367,6 +367,7 @@ + diff --git a/Disco.Services/Interop/DiscoServices/LicenseValidationTask.cs b/Disco.Services/Interop/DiscoServices/LicenseValidationTask.cs new file mode 100644 index 00000000..0abb8ef2 --- /dev/null +++ b/Disco.Services/Interop/DiscoServices/LicenseValidationTask.cs @@ -0,0 +1,167 @@ +using Disco.Data.Repository; +using Disco.Services.Tasks; +using Newtonsoft.Json; +using Quartz; +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; + +namespace Disco.Services.Interop.DiscoServices +{ + public class LicenseValidationTask : ScheduledTask + { + private const string jobMapLicenseKey = "License"; + public override string TaskName { get { return "License Validation"; } } + + public override void InitalizeScheduledTask(DiscoDataContext Database) + { + if (Database.DiscoConfiguration.LicenseKey != null) + { + // Trigger in 1 + 0-29 minutes + var rng = new Random(); + var delay = rng.Next(30) + 1; + + TriggerBuilder triggerBuilder = TriggerBuilder.Create() + .StartAt(DateTimeOffset.Now.AddMinutes(delay)); + + ScheduleTask(triggerBuilder); + + base.InitalizeScheduledTask(Database); + } + } + + public static ScheduledTaskStatus ScheduleNow(string license) + { + var taskStatus = RunningStatus; + if (taskStatus != null) + return taskStatus; + else + { + var task = new LicenseValidationTask(); + + var taskData = new JobDataMap() { { jobMapLicenseKey, license } }; + + return task.ScheduleTask(taskData); + } + } + + public static ScheduledTaskStatus RunningStatus => + ScheduledTasks.GetTaskStatuses(typeof(LicenseValidationTask)).Where(ts => ts.IsRunning).FirstOrDefault(); + + protected override void ExecuteTask() + { + var license = ExecutionContext.JobDetail.JobDataMap.GetString(jobMapLicenseKey); + string orgName; + Guid deploymentId; + using (var database = new DiscoDataContext()) + { + if (license == null) + license = database.DiscoConfiguration.LicenseKey; + orgName = database.DiscoConfiguration.OrganisationName; + deploymentId = Guid.Parse(database.DiscoConfiguration.DeploymentId); + } + if (!string.IsNullOrWhiteSpace(license)) + { + var result = ValidateLicense(deploymentId, orgName, license, true, out var infrastructureError); + + string infrastructureError2 = null; + if (result == null) + result = ValidateLicense(deploymentId, orgName, license, false, out infrastructureError2); + + if (result == null) + { + var error = $"Validation failed. {infrastructureError ?? infrastructureError2}"; + Status.SetTaskException(new Exception(error)); + } + else + { + if (result.IsValid) + { + using (var database = new DiscoDataContext()) + { + database.DiscoConfiguration.LicenseKey = license; + database.DiscoConfiguration.LicenseExpiresOn = result.ExpiresOn; + database.DiscoConfiguration.LicenseError = null; + database.SaveChanges(); + } + Status.UpdateStatus(100, "License validated"); + } + else + { + var error = result.ErrorMessage ?? "Validation failed"; + Status.SetTaskException(new Exception(error)); + } + } + } + } + + private LicenseResponseV1 ValidateLicense(Guid deploymentId, string organisationName, string license, bool useProxy, out string infrastructureError) + { + Status.UpdateStatus(10, $"Validating license for {organisationName}"); + + var appVersion = typeof(LicenseValidationTask).Assembly.GetName().Version.ToString(4); + var updateUrl = $"{DiscoServiceHelpers.ServicesUrl}API/License/V1"; + + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(updateUrl); + + // Fix for Proxy Servers which don't support KeepAlive + request.KeepAlive = false; + + if (!useProxy) + request.Proxy = new WebProxy(); + + request.ContentType = "application/x-www-form-urlencoded"; + request.Method = WebRequestMethods.Http.Post; + request.UserAgent = $"Disco/{appVersion} (License)"; + + using (var requestStream = request.GetRequestStream()) + { + using (var writer = new StreamWriter(requestStream, Encoding.GetEncoding(28591))) + { + writer.Write("deploymentId="); + writer.Write(Uri.EscapeDataString(deploymentId.ToString())); + writer.Write($"&license={Uri.EscapeDataString(license)}"); + } + } + + Status.UpdateStatus(50, "Waiting for validation response"); + using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + { + if (response.StatusCode == HttpStatusCode.OK) + { + Status.UpdateStatus(90, "Reading validation response"); + string validationJson; + LicenseResponseV1 updateResult; + + using (var responseStream = response.GetResponseStream()) + { + using (var responseReader = new StreamReader(responseStream)) + { + validationJson = responseReader.ReadToEnd(); + } + } + + updateResult = JsonConvert.DeserializeObject(validationJson); + + infrastructureError = null; + return updateResult; + } + else + { + infrastructureError = $"Server responded with: [{response.StatusCode}] {response.StatusDescription}"; + return null; + } + } + } + + private class LicenseResponseV1 + { + public bool IsValid { get; set; } + public DateTime? ValidOn { get; set; } + public DateTime? ExpiresOn { get; set; } + public string ErrorMessage { get; set; } + } + } +} diff --git a/Disco.Web/Areas/API/Controllers/SystemController.cs b/Disco.Web/Areas/API/Controllers/SystemController.cs index 9f698085..f79d834b 100644 --- a/Disco.Web/Areas/API/Controllers/SystemController.cs +++ b/Disco.Web/Areas/API/Controllers/SystemController.cs @@ -42,6 +42,26 @@ namespace Disco.Web.Areas.API.Controllers return RedirectToAction(MVC.Config.Logging.TaskStatus(ts.SessionId)); } + [DiscoAuthorize(Claims.Config.System.Show)] + [HttpPost, ValidateAntiForgeryToken] + public virtual ActionResult LicenseCheck(string license) + { + if (string.IsNullOrWhiteSpace(license)) + { + Database.DiscoConfiguration.LicenseKey = null; + Database.DiscoConfiguration.LicenseExpiresOn = null; + Database.DiscoConfiguration.LicenseError = null; + Database.SaveChanges(); + return RedirectToAction(MVC.Config.SystemConfig.Index()); + } + else + { + var ts = Disco.Services.Interop.DiscoServices.LicenseValidationTask.ScheduleNow(license); + ts.SetFinishedUrl(Url.Action(MVC.Config.SystemConfig.Index())); + return RedirectToAction(MVC.Config.Logging.TaskStatus(ts.SessionId)); + } + } + [DiscoAuthorize(Claims.Config.System.Show)] public virtual ActionResult UpdateCheck() { diff --git a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs index ff555e0e..2d91b068 100644 --- a/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs +++ b/Disco.Web/Areas/Config/Models/SystemConfig/IndexModel.cs @@ -112,6 +112,11 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig public bool EmailIsConfigured { get; set; } #endregion + public ScheduledTaskStatus LicenseValidationRunningStatus { get; set; } + public string License { get; set; } + public DateTime? LicenseExpires { get; set; } + public string LicenseError { get; set; } + public ScheduledTaskStatus UpdateRunningStatus { get; set; } public DateTime? UpdateNextScheduled { get; set; } public UpdateResponseV2 UpdateLatestResponse { get; set; } @@ -136,6 +141,10 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig EmailUsername = config.EmailUsername, EmailPassword = null, EmailIsConfigured = EmailService.IsConfigured, + License = config.LicenseKey, + LicenseExpires = config.LicenseExpiresOn, + LicenseError = config.LicenseError, + LicenseValidationRunningStatus = LicenseValidationTask.RunningStatus, UpdateLatestResponse = config.UpdateLastCheckResponse, UpdateRunningStatus = UpdateQueryTask.RunningStatus, UpdateNextScheduled = UpdateQueryTask.NextScheduled, diff --git a/Disco.Web/Areas/Config/Views/SystemConfig/Index.cshtml b/Disco.Web/Areas/Config/Views/SystemConfig/Index.cshtml index d9ef3a0f..0f781611 100644 --- a/Disco.Web/Areas/Config/Views/SystemConfig/Index.cshtml +++ b/Disco.Web/Areas/Config/Views/SystemConfig/Index.cshtml @@ -69,6 +69,86 @@ +
+

License

+ + @{ + + + + + if (Model.License != null) + { + + + + + } + else + { + + + + } + } +
+ License: + + @using (Html.BeginForm(MVC.API.System.LicenseCheck(), FormMethod.Post)) + { + @Html.AntiForgeryToken(); + + + } + +
+ Status: + + @if (Model.LicenseError != null) + { +
@Model.LicenseError
+ } + else + { + Expires @CommonHelpers.FriendlyDate(Model.LicenseExpires) + } +
+ Official support is available +
    +
  • Initial implementation assistance.
  • +
  • Commitment to maintaining Disco ICT functionality and associated plugins.
  • +
  • Direct support.
  • +
  • Access to additional functionality.
  • +
  • Ability to suggest additional functionality, with a voice in feature prioritisation.
  • +
+ +
+

Updates

diff --git a/Disco.Web/Areas/Config/Views/SystemConfig/Index.generated.cs b/Disco.Web/Areas/Config/Views/SystemConfig/Index.generated.cs index 47ced22d..e3b39b17 100644 --- a/Disco.Web/Areas/Config/Views/SystemConfig/Index.generated.cs +++ b/Disco.Web/Areas/Config/Views/SystemConfig/Index.generated.cs @@ -209,7 +209,7 @@ WriteLiteral(" class=\"form\""); WriteLiteral(" style=\"width: 450px; margin-top: 15px;\""); -WriteLiteral(">\r\n

Updates

\r\n
\r\n"); +WriteLiteral(">\r\n

License

\r\n
\r\n"); #line 75 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" @@ -220,6 +220,249 @@ WriteLiteral(">\r\n

Updates

\r\n
\r\n"); #line 75 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + + + #line default + #line hidden +WriteLiteral(" \r\n \r\n License:\r\n \r\n + +"); + + + #line 113 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + if (Model.License != null) + { + + + #line default + #line hidden +WriteLiteral(" \r\n \r\n Status:\r\n \r\n " + +" \r\n \r\n"); + + + #line 130 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + } + else + { + + + #line default + #line hidden +WriteLiteral(" \r\n + Official support is available +
    +
  • Initial implementation assistance.
  • +
  • Commitment to maintaining Disco ICT functionality and associated plugins.
  • +
  • Direct support.
  • +
  • Access to additional functionality.
  • +
  • Ability to suggest additional functionality, with a voice in feature prioritisation.
  • +
+ \r\n Request More Information\r\n \r\n " + +" \r\n
\r\n"); + + + #line 148 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + } + + + #line default + #line hidden +WriteLiteral("\r\n
\r\n"); + + + #line 81 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + + + #line default + #line hidden + + #line 81 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + using (Html.BeginForm(MVC.API.System.LicenseCheck(), FormMethod.Post)) + { + + + #line default + #line hidden + + #line 83 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + Write(Html.AntiForgeryToken()); + + + #line default + #line hidden + + #line 83 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + ; + + + #line default + #line hidden +WriteLiteral(" (Model.License + + #line default + #line hidden +, 3063), false) +); + +WriteLiteral(" />\r\n"); + +WriteLiteral(" Activate\r\n"); + + + #line 86 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" + $(function () { + const $element = $('#license'); + const original = $element.val(); + $element.on('keyup', function (e) { + const $button = $element.next('button'); + const value = $element.val(); + if (!original) { + $element.prop('required', true); + $button.text('Activate'); + } else { + if (original === value) { + $button.text('Validate'); + } else { + if (!value) { + $button.text('Clear'); + } else { + $button.text('Activate'); + } + } + } + }).trigger('keyup'); + }); + +
\r\n"); + + + #line 120 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + + + #line default + #line hidden + + #line 120 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + if (Model.LicenseError != null) + { + + + #line default + #line hidden +WriteLiteral(" "); + + + #line 122 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + Write(Model.LicenseError); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + #line 123 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + } + else + { + + + #line default + #line hidden +WriteLiteral(" Expires "); + + + #line 126 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + Write(CommonHelpers.FriendlyDate(Model.LicenseExpires)); + + + #line default + #line hidden +WriteLiteral("\r\n"); + + + #line 127 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + } + + + #line default + #line hidden +WriteLiteral("
\r\n
\r\n\r\n

Updates

\r\n \r\n"); + + + #line 155 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + + + #line default + #line hidden + + #line 155 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + if (Model.UpdateLatestResponse == null) { @@ -242,7 +485,7 @@ WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\""); WriteLiteral("> Never\r\n \r\n \r\n"); - #line 86 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 166 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -258,7 +501,7 @@ WriteLiteral(">\r\n Last Run:\r\n \r\n "); - #line 94 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 174 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.UpdateResponseDate.ToLocalTime())); @@ -267,7 +510,7 @@ WriteLiteral(">\r\n Last Run:\r\n \r\n \r\n \r\n"); - #line 97 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 177 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.UpdateAvailable) { @@ -287,7 +530,7 @@ WriteLiteral(" class=\"fa fa-info-circle fa-lg information\""); WriteLiteral("> Version "); - #line 105 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 185 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Model.UpdateLatestResponse.LatestVersion); @@ -301,7 +544,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral(">\r\n [Released "); - #line 108 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 188 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ReleasedDate)); @@ -314,7 +557,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral(">"); - #line 110 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 190 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(new HtmlString(Model.UpdateLatestResponse.Description)); @@ -322,14 +565,14 @@ WriteLiteral(">"); #line hidden WriteLiteral("\r\n (Model.UpdateLatestResponse.UrlLink + #line 191 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" +, Tuple.Create(Tuple.Create("", 7937), Tuple.Create(Model.UpdateLatestResponse.UrlLink #line default #line hidden -, 4286), false) +, 7937), false) ); WriteLiteral(" target=\"_blank\""); @@ -337,7 +580,7 @@ WriteLiteral(" target=\"_blank\""); WriteLiteral(">Download Now\r\n \r\n \r\n"); - #line 114 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 194 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -358,7 +601,7 @@ WriteLiteral("> The latest version is installed\r\n "\r\n \r\n"); - #line 125 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 205 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } } @@ -372,13 +615,13 @@ WriteLiteral(" style=\"width: 135px\""); WriteLiteral(">Check for Update:\r\n \r\n\r\n\r\n\r\n \r\n
\r\n"); - #line 131 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 211 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 131 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 211 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.UpdateRunningStatus == null) { @@ -389,7 +632,7 @@ WriteLiteral(">Check for Update:\r\n \r\n"); WriteLiteral(" "); - #line 134 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 214 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ActionLinkSmallButton("Check Now", MVC.API.System.UpdateCheck())); @@ -404,7 +647,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral(">[Will run automatically "); - #line 135 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 215 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown")); @@ -413,7 +656,7 @@ WriteLiteral(">[Will run automatically "); WriteLiteral("]\r\n"); - #line 136 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 216 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -424,7 +667,7 @@ WriteLiteral("]\r\n"); WriteLiteral(" "); - #line 139 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 219 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ActionLink("View Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId))); @@ -439,7 +682,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral(">[Running Now]\r\n"); - #line 141 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 221 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -448,13 +691,13 @@ WriteLiteral(">[Running Now]\r\n"); WriteLiteral("\r\n"); - #line 143 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 223 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 143 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 223 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.UpdateBetaDeployment) { @@ -474,7 +717,7 @@ WriteLiteral(" class=\"fa fa-info-circle fa-lg\""); WriteLiteral("> Beta Deployment\r\n"); - #line 147 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 227 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -494,7 +737,7 @@ WriteLiteral(">\r\n Primary Domain:\r\n \r\n " "); - #line 160 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 240 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Model.ADPrimaryDomain.Name); @@ -503,7 +746,7 @@ WriteLiteral(">\r\n Primary Domain:\r\n \r\n WriteLiteral(" ["); - #line 160 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 240 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Model.ADPrimaryDomain.NetBiosName); @@ -516,13 +759,13 @@ WriteLiteral(" style=\"width: 135px\""); WriteLiteral(">\r\n Additional Domains:\r\n \r\n \r\n"); - #line 168 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 248 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 168 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 248 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.ADDomains.Count > 1) { var adAdditionalDomains = Model.ADDomains.Where(d => d != Model.ADPrimaryDomain).OrderBy(d => d.Name).ToList(); @@ -534,7 +777,7 @@ WriteLiteral(">\r\n Additional Domains:\r\n \r\n WriteLiteral(" "); - #line 172 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 252 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(adDomainFirst.Name); @@ -543,7 +786,7 @@ WriteLiteral(" "); WriteLiteral(" ["); - #line 172 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 252 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(adDomainFirst.NetBiosName); @@ -552,7 +795,7 @@ WriteLiteral(" ["); WriteLiteral("]\r\n"); - #line 173 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 253 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" foreach (var adDomain in adAdditionalDomains.Skip(1)) { @@ -564,7 +807,7 @@ WriteLiteral("
\r\n"); WriteLiteral("
\r\n "); - #line 177 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 257 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(adDomain.Name); @@ -573,7 +816,7 @@ WriteLiteral("
\r\n ["); - #line 177 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 257 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(adDomain.NetBiosName); @@ -582,7 +825,7 @@ WriteLiteral(" ["); WriteLiteral("]\r\n
\r\n"); - #line 179 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 259 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } } else @@ -598,7 +841,7 @@ WriteLiteral(" class=\"smallMessage\""); WriteLiteral("><None>\r\n"); - #line 184 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 264 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -612,7 +855,7 @@ WriteLiteral(">\r\n Site:\r\n \r\n
"); - #line 192 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 272 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Model.ADSite.Name); @@ -627,13 +870,13 @@ WriteLiteral(">\r\n Servers:\r\n \r\n "
\r\n"); - #line 201 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 281 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 201 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 281 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.ADServers.Count > 0) { @@ -647,13 +890,13 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 204 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 284 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 204 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 284 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" foreach (var server in Model.ADServers) { 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); @@ -665,13 +908,13 @@ WriteLiteral(">\r\n"); WriteLiteral("
  • \r\n"); - #line 209 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 289 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 209 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 289 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (server.IsAvailable) { @@ -687,7 +930,7 @@ WriteLiteral(" title=\"Available\""); WriteLiteral(">\r\n"); - #line 212 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 292 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -699,24 +942,24 @@ WriteLiteral(" (server.AvailableWhen.Value.ToLongTimeString() + #line 295 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + , Tuple.Create(Tuple.Create(" ", 12395), Tuple.Create(server.AvailableWhen.Value.ToLongTimeString() #line default #line hidden -, 8745), false) +, 12396), false) ); WriteLiteral(">\r\n"); - #line 216 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 296 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -725,7 +968,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 217 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 297 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(serverDescription); @@ -734,13 +977,13 @@ WriteLiteral(" "); WriteLiteral("\r\n"); - #line 218 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 298 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 218 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 298 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (server.IsSiteServer) { @@ -756,7 +999,7 @@ WriteLiteral(" title=\"Site Server\""); WriteLiteral(">\r\n"); - #line 221 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -773,7 +1016,7 @@ WriteLiteral(" title=\"Not a Site Server\""); WriteLiteral(">\r\n"); - #line 225 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 305 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -782,7 +1025,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 226 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 306 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (server.IsWritable) { @@ -798,7 +1041,7 @@ WriteLiteral(" title=\"Writable Domain Controller\""); WriteLiteral(">\r\n"); - #line 229 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 309 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -807,7 +1050,7 @@ WriteLiteral(">\r\n"); WriteLiteral("
  • \r\n"); - #line 231 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 311 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -816,7 +1059,7 @@ WriteLiteral(" \r\n"); WriteLiteral(" \r\n"); - #line 233 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 313 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -835,7 +1078,7 @@ WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\""); WriteLiteral("> None Found\r\n
    \r\n"); - #line 239 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 319 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -849,13 +1092,13 @@ WriteLiteral(" style=\"width: 135px\""); WriteLiteral(">\r\n Directory:\r\n \r\n
    \r\n"); - #line 248 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 328 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 248 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 328 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.ADAllServers == null) { @@ -867,7 +1110,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 251 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 331 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" })); @@ -876,7 +1119,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 251 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 331 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.ADSearchAllServers)); @@ -901,7 +1144,7 @@ WriteLiteral(">Directory servers are currently being retrieved.
    \r\n "
    \r\n"); - #line 259 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 339 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -915,13 +1158,13 @@ WriteLiteral(">Directory servers are currently being retrieved.
    \r\n WriteLiteral("
    \r\n"); - #line 266 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 346 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 266 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 346 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (!canSearchEntireDirectory) { @@ -929,27 +1172,27 @@ WriteLiteral("
    \r\n"); #line default #line hidden - #line 268 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 348 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" })); #line default #line hidden - #line 268 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 348 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 268 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 348 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.ADSearchAllServers)); #line default #line hidden - #line 268 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 348 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" @@ -970,7 +1213,7 @@ WriteLiteral(" class=\"fa fa-exclamation-circle warning\""); WriteLiteral(">Disco ICT will not search the entire directory which consists of more than "); - #line 271 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 351 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxAllServerSearch); @@ -980,7 +1223,7 @@ WriteLiteral(" servers. Only servers within this site will be searched.\r\n "

    \r\n
    \r\n"); - #line 274 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 354 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -989,40 +1232,40 @@ WriteLiteral(" servers. Only servers within this site will be searched.\r\n #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.ADSearchAllServers)); #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.ADSearchAllServers)); #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden - #line 277 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" @@ -1049,7 +1292,7 @@ WriteLiteral(" \r\n"); - #line 288 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 368 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1068,7 +1311,7 @@ WriteLiteral("\', \'SearchAllServers\');\r\n WriteLiteral("
    \r\n"); - #line 290 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 370 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -1081,7 +1324,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 294 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 374 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" })); @@ -1090,7 +1333,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 294 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 374 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.ADSearchAllServers)); @@ -1113,7 +1356,7 @@ WriteLiteral(">If this setting is enabled, Disco ICT will query all servers "

    \r\n
    \r\n \r\n"); - #line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 381 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1129,13 +1372,13 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 306 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 386 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 306 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 386 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" var domainIndex = Model.ADDomains.ToDictionary(d => d.Name, StringComparer.OrdinalIgnoreCase); var siteServers = Model.ADServers.Where(s => s.IsSiteServer).ToDictionary(s => s.Name, StringComparer.OrdinalIgnoreCase); @@ -1158,7 +1401,7 @@ WriteLiteral("
  • \r\n " "); - #line 321 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 401 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(serverDescription); @@ -1167,7 +1410,7 @@ WriteLiteral("
  • \r\n WriteLiteral(""); - #line 321 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 401 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (siteServers.ContainsKey(server)) { @@ -1182,7 +1425,7 @@ WriteLiteral(" title=\"Site Server\""); WriteLiteral(">"); - #line 322 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 402 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1191,7 +1434,7 @@ WriteLiteral(">"); WriteLiteral("
  • \r\n"); - #line 324 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 404 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1225,7 +1468,7 @@ WriteLiteral(@" "); - #line 350 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 430 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1238,13 +1481,13 @@ WriteLiteral(" style=\"width: 135px\""); WriteLiteral(">\r\n Searching:\r\n \r\n
    \r\n"); - #line 359 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 439 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 359 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 439 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" object ADSearchWildcardSuffixOnlyAttributes = null; if (!canConfigAD) @@ -1263,7 +1506,7 @@ WriteLiteral("\r\n"); WriteLiteral(" "); - #line 369 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.ADSearchWildcardSuffixOnly, ADSearchWildcardSuffixOnlyAttributes)); @@ -1272,7 +1515,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 369 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.ADSearchWildcardSuffixOnly)); @@ -1281,7 +1524,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 369 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(AjaxHelpers.AjaxLoader()); @@ -1306,13 +1549,13 @@ WriteLiteral(@">If this setting is enabled, Disco ICT will utilize Active Di "); - #line 376 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 456 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 376 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 456 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (canConfigAD) { @@ -1324,7 +1567,7 @@ WriteLiteral(" \r\n"); - #line 383 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 463 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1347,13 +1590,13 @@ WriteLiteral(" style=\"width: 135px\""); WriteLiteral(">\r\n Search Scope:\r\n \r\n \r\n"); - #line 391 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 471 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 391 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 471 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (Model.ADSearchContainers != null && Model.ADSearchContainers.Count > 0) { @@ -1370,13 +1613,13 @@ WriteLiteral(" id=\"Config_System_AD_SearchScope_DistinguishedNames\""); WriteLiteral(">\r\n"); - #line 395 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 475 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 395 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 475 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" foreach (var adContainer in Model.ADSearchContainers) { @@ -1388,7 +1631,7 @@ WriteLiteral(" "); - #line 397 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 477 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(adContainer.Item3); @@ -1408,7 +1651,7 @@ WriteLiteral(">"); WriteLiteral("\r\n"); - #line 398 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 478 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1417,7 +1660,7 @@ WriteLiteral("\r\n"); WriteLiteral(" \r\n"); - #line 400 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 480 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -1445,7 +1688,7 @@ WriteLiteral(">When searching, the entire domain will be queried. This is su "/div>\r\n"); - #line 409 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 489 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1454,7 +1697,7 @@ WriteLiteral(">When searching, the entire domain will be queried. This is su WriteLiteral(" "); - #line 410 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 490 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (canConfigAD) { @@ -1489,7 +1732,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 418 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 498 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(AjaxHelpers.AjaxLoader()); @@ -1505,13 +1748,13 @@ WriteLiteral(" class=\"organisationalUnitTree\""); WriteLiteral(">\r\n \r\n"); - #line 422 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 502 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 422 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 502 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" using (Html.BeginForm(MVC.API.System.UpdateActiveDirectorySearchScope(null, redirect: true))) { } @@ -1558,7 +1801,7 @@ WriteLiteral(" \r\n"); - #line 533 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 613 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -1613,7 +1856,7 @@ WriteLiteral("\', null, function (data) {\r\n WriteLiteral("
    \r\n\r\n"); - #line 541 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 621 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (canConfigProxy) { using (Html.BeginForm(MVC.API.System.UpdateProxySettings())) @@ -1639,7 +1882,7 @@ WriteLiteral(">\r\n Address:\r\n WriteLiteral(" "); - #line 553 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 633 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.ProxyAddress)); @@ -1650,7 +1893,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 554 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 634 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.ProxyAddress)); @@ -1667,7 +1910,7 @@ WriteLiteral(">\r\n Port:\r\n \r\ WriteLiteral(" "); - #line 562 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 642 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.ProxyPort)); @@ -1678,7 +1921,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 563 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 643 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.ProxyPort)); @@ -1695,7 +1938,7 @@ WriteLiteral(">\r\n Username:\r\n m.ProxyUsername)); @@ -1706,7 +1949,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 572 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 652 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.ProxyUsername)); @@ -1723,7 +1966,7 @@ WriteLiteral(">\r\n Password:\r\n m.ProxyPassword)); @@ -1734,7 +1977,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 581 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 661 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.ProxyPassword)); @@ -1757,7 +2000,7 @@ WriteLiteral(" class=\"button small\""); WriteLiteral(">Save Proxy Settings"); - #line 589 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 669 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(AjaxHelpers.AjaxLoader()); @@ -1772,7 +2015,7 @@ WriteLiteral(@" var url = '"); - #line 595 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 675 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Url.Action(MVC.API.System.UpdateProxySettings())); @@ -1801,7 +2044,7 @@ WriteLiteral("\';\r\n var data = {\r\n " \r\n \r\n \r\n"); - #line 625 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 705 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } } else @@ -1826,7 +2069,7 @@ WriteLiteral(">\r\n Address:\r\n \r\n WriteLiteral(" "); - #line 637 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 717 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.ProxyAddress)); @@ -1842,7 +2085,7 @@ WriteLiteral(">\r\n Port:\r\n \r\n WriteLiteral(" "); - #line 645 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 725 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.ProxyPort)); @@ -1858,7 +2101,7 @@ WriteLiteral(">\r\n Username:\r\n \r\n WriteLiteral(" "); - #line 653 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 733 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.ProxyUsername)); @@ -1874,14 +2117,14 @@ WriteLiteral(">\r\n Password:\r\n \r\n "table>\r\n \r\n"); - #line 666 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 746 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } #line default #line hidden - #line 667 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 747 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" if (canConfigEmail) { @@ -1905,7 +2148,7 @@ WriteLiteral(">\r\n SMTP Server:\r\n \r\n WriteLiteral(" "); - #line 677 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 757 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.EmailSmtpServer)); @@ -1916,7 +2159,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 678 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 758 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailSmtpServer)); @@ -1932,7 +2175,7 @@ WriteLiteral(">\r\n Port:\r\n \r\n WriteLiteral(" "); - #line 686 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 766 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.EmailSmtpPort)); @@ -1943,7 +2186,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 687 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 767 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailSmtpPort)); @@ -1960,7 +2203,7 @@ WriteLiteral(">\r\n Default From Address:\r\n WriteLiteral(" "); - #line 695 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 775 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.EmailFromAddress)); @@ -1971,7 +2214,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 696 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 776 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailFromAddress)); @@ -1988,7 +2231,7 @@ WriteLiteral(">\r\n Reply To Address:\r\n m.EmailReplyToAddress)); @@ -1999,7 +2242,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 705 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 785 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailReplyToAddress)); @@ -2015,7 +2258,7 @@ WriteLiteral(">\r\n  \r\n \r\n WriteLiteral(" "); - #line 713 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 793 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.EmailEnableSsl)); @@ -2024,7 +2267,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 713 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 793 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.EmailEnableSsl)); @@ -2040,7 +2283,7 @@ WriteLiteral(">\r\n Username:\r\n \r\n WriteLiteral(" "); - #line 721 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 801 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.EmailUsername)); @@ -2051,7 +2294,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 722 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 802 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailUsername)); @@ -2067,7 +2310,7 @@ WriteLiteral(">\r\n Password:\r\n \r\n WriteLiteral(" "); - #line 730 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 810 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.EditorFor(m => m.EmailPassword)); @@ -2078,7 +2321,7 @@ WriteLiteral("
    \r\n"); WriteLiteral(" "); - #line 731 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 811 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ValidationMessageFor(m => m.EmailPassword)); @@ -2094,7 +2337,7 @@ WriteLiteral(">\r\n  \r\n \r\n WriteLiteral(" "); - #line 739 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 819 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.AntiForgeryToken()); @@ -2111,7 +2354,7 @@ WriteLiteral(" class=\"button small\""); WriteLiteral(" "); - #line 740 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 820 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Model.EmailIsConfigured ? null : "disabled"); @@ -2128,7 +2371,7 @@ WriteLiteral(" class=\"button small\""); WriteLiteral(">Save Email Settings"); - #line 741 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 821 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(AjaxHelpers.AjaxLoader()); @@ -2149,13 +2392,13 @@ WriteLiteral(" class=\"fa fa-envelope information\""); WriteLiteral("> Recipient Email Address:\r\n
    \r\n"); - #line 745 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 825 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 745 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 825 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" using (Html.BeginForm(MVC.API.System.SendTestEmail(), FormMethod.Post)) { @@ -2180,33 +2423,33 @@ WriteLiteral(" name=\"Recipient\""); WriteLiteral(" type=\"text\""); -WriteAttribute("value", Tuple.Create(" value=\"", 34675), Tuple.Create("\"", 34708) +WriteAttribute("value", Tuple.Create(" value=\"", 38326), Tuple.Create("\"", 38359) - #line 748 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" - , Tuple.Create(Tuple.Create("", 34683), Tuple.Create(CurrentUser.EmailAddress + #line 828 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + , Tuple.Create(Tuple.Create("", 38334), Tuple.Create(CurrentUser.EmailAddress #line default #line hidden -, 34683), false) +, 38334), false) ); WriteLiteral(" />\r\n"); - #line 749 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 829 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" #line default #line hidden - #line 749 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 829 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden - #line 749 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 829 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -2224,7 +2467,7 @@ WriteLiteral(@" var url = '"); - #line 759 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 839 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Url.Action(MVC.API.System.UpdateEmailSettings())); @@ -2287,7 +2530,7 @@ WriteLiteral("\';\r\n var data = {\r\n "\r\n \r\n \r\n \r\n"); - #line 831 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 911 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } else { @@ -2312,7 +2555,7 @@ WriteLiteral(">\r\n SMTP Server:\r\n \r\n WriteLiteral(" "); - #line 842 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 922 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.EmailSmtpServer)); @@ -2328,7 +2571,7 @@ WriteLiteral(">\r\n Port:\r\n \r\n WriteLiteral(" "); - #line 850 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 930 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.EmailSmtpPort)); @@ -2345,7 +2588,7 @@ WriteLiteral(">\r\n Default From Address:\r\n WriteLiteral(" "); - #line 858 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 938 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.EmailFromAddress)); @@ -2362,7 +2605,7 @@ WriteLiteral(">\r\n Reply To Address:\r\n m.EmailReplyToAddress)); @@ -2379,7 +2622,7 @@ WriteLiteral(">\r\n Enable SSL:\r\n \r\n WriteLiteral(" "); - #line 874 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 954 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.CheckBoxFor(m => m.EmailEnableSsl, new { disabled = "disabled" })); @@ -2388,7 +2631,7 @@ WriteLiteral(" "); WriteLiteral(" "); - #line 874 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 954 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.LabelFor(m => m.EmailEnableSsl)); @@ -2404,7 +2647,7 @@ WriteLiteral(">\r\n Username:\r\n \r\n WriteLiteral(" "); - #line 882 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 962 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.DisplayFor(m => m.EmailUsername)); @@ -2420,7 +2663,7 @@ WriteLiteral(">\r\n Password:\r\n \r\n "table>\r\n \r\n"); - #line 895 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 975 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" } @@ -2435,7 +2678,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 897 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" + #line 977 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml" Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates())); diff --git a/Disco.Web/Extensions/T4MVC/API.SystemController.generated.cs b/Disco.Web/Extensions/T4MVC/API.SystemController.generated.cs index 13c5b536..4494a5b3 100644 --- a/Disco.Web/Extensions/T4MVC/API.SystemController.generated.cs +++ b/Disco.Web/Extensions/T4MVC/API.SystemController.generated.cs @@ -59,6 +59,12 @@ namespace Disco.Web.Areas.API.Controllers return RedirectToActionPermanent(taskResult.Result); } + [NonAction] + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public virtual System.Web.Mvc.ActionResult LicenseCheck() + { + return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LicenseCheck); + } [NonAction] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public virtual System.Web.Mvc.ActionResult UpdateOrganisationName() @@ -162,6 +168,7 @@ namespace Disco.Web.Areas.API.Controllers public readonly string UpdateLastNetworkLogonDates = "UpdateLastNetworkLogonDates"; public readonly string UpdateAttachmentThumbnails = "UpdateAttachmentThumbnails"; public readonly string UpdateADDeviceDescriptions = "UpdateADDeviceDescriptions"; + public readonly string LicenseCheck = "LicenseCheck"; public readonly string UpdateCheck = "UpdateCheck"; public readonly string UpdateOrganisationName = "UpdateOrganisationName"; public readonly string OrganisationLogo = "OrganisationLogo"; @@ -187,6 +194,7 @@ namespace Disco.Web.Areas.API.Controllers public const string UpdateLastNetworkLogonDates = "UpdateLastNetworkLogonDates"; public const string UpdateAttachmentThumbnails = "UpdateAttachmentThumbnails"; public const string UpdateADDeviceDescriptions = "UpdateADDeviceDescriptions"; + public const string LicenseCheck = "LicenseCheck"; public const string UpdateCheck = "UpdateCheck"; public const string UpdateOrganisationName = "UpdateOrganisationName"; public const string OrganisationLogo = "OrganisationLogo"; @@ -207,6 +215,14 @@ namespace Disco.Web.Areas.API.Controllers } + static readonly ActionParamsClass_LicenseCheck s_params_LicenseCheck = new ActionParamsClass_LicenseCheck(); + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public ActionParamsClass_LicenseCheck LicenseCheckParams { get { return s_params_LicenseCheck; } } + [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] + public class ActionParamsClass_LicenseCheck + { + public readonly string license = "license"; + } static readonly ActionParamsClass_UpdateOrganisationName s_params_UpdateOrganisationName = new ActionParamsClass_UpdateOrganisationName(); [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] public ActionParamsClass_UpdateOrganisationName UpdateOrganisationNameParams { get { return s_params_UpdateOrganisationName; } } @@ -404,6 +420,18 @@ namespace Disco.Web.Areas.API.Controllers return callInfo; } + [NonAction] + partial void LicenseCheckOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string license); + + [NonAction] + public override System.Web.Mvc.ActionResult LicenseCheck(string license) + { + var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LicenseCheck); + ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "license", license); + LicenseCheckOverride(callInfo, license); + return callInfo; + } + [NonAction] partial void UpdateCheckOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);