From 162ca20046e6ec32adc03afe9477c71fc6b63ac3 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Sun, 16 Feb 2025 17:13:55 +1100 Subject: [PATCH] fix: enrollment > enrolment --- Disco.Client/Program.cs | 8 +- Disco.Models/UI/Job/JobIndexModel.cs | 2 +- .../Devices/Enrolment/EnrolmentLog.cs | 12 +- .../Enrolment/WindowsDeviceEnrolment.cs | 4 +- ...ntController.cs => EnrolmentController.cs} | 4 +- .../Areas/Config/Views/Config/Index.cshtml | 4 +- .../Config/Views/Config/Index.generated.cs | 14 +- .../Areas/Config/Views/Enrolment/Index.cshtml | 14 +- .../Config/Views/Enrolment/Index.generated.cs | 18 +-- .../Config/Views/Enrolment/Status.cshtml | 22 +-- .../Views/Enrolment/Status.generated.cs | 150 +++++++++--------- Disco.Web/ClientSource/Style/Job.css | 6 +- Disco.Web/ClientSource/Style/Job.less | 2 +- Disco.Web/ClientSource/Style/Job.min.css | 2 +- Disco.Web/Controllers/JobController.cs | 2 +- Disco.Web/Disco.Web.csproj | 4 +- ...s => API.EnrolmentController.generated.cs} | 16 +- Disco.Web/Extensions/T4MVC/T4MVC.cs | 2 +- Disco.Web/Models/Job/IndexModel.cs | 2 +- Disco.Web/Views/Job/Index.cshtml | 10 +- Disco.Web/Views/Job/Index.generated.cs | 22 +-- 21 files changed, 160 insertions(+), 160 deletions(-) rename Disco.Web/Areas/API/Controllers/{EnrollmentController.cs => EnrolmentController.cs} (87%) rename Disco.Web/Extensions/T4MVC/{API.EnrollmentController.generated.cs => API.EnrolmentController.generated.cs} (93%) diff --git a/Disco.Client/Program.cs b/Disco.Client/Program.cs index 8cf2e98e..ae7b4707 100644 --- a/Disco.Client/Program.cs +++ b/Disco.Client/Program.cs @@ -119,7 +119,7 @@ namespace Disco.Client EnrolResponse response = null; // Build Request - Presentation.UpdateStatus("Enrolling Device", "Building enrollment request and preparing to send data to the server.", true, -1); + Presentation.UpdateStatus("Enrolling Device", "Building enrolment request and preparing to send data to the server.", true, -1); request = new Enrol(); request.Build(); @@ -127,11 +127,11 @@ namespace Disco.Client do { // Send Request - Presentation.UpdateStatus("Enrolling Device", "Sending the enrollment request to the server.", true, -1); + Presentation.UpdateStatus("Enrolling Device", "Sending the enrolment request to the server.", true, -1); response = request.Post(Program.IsAuthenticated); // Process Response - Presentation.UpdateStatus("Enrolling Device", "Processing the enrollment response from the server.", true, -1); + Presentation.UpdateStatus("Enrolling Device", "Processing the enrolment response from the server.", true, -1); response.Process(); if (response.IsPending) @@ -144,7 +144,7 @@ namespace Disco.Client var secondsConsumed = (DateTimeOffset.Now - startTime).TotalSeconds; var progress = (int)((secondsConsumed / totalSeconds) * 100); - Presentation.UpdateStatus($"Pending Device Enrollment Approval: {response.PendingIdentifier}", $"Waiting for enrollment session '{response.PendingIdentifier}' to be approved.{Environment.NewLine}Reason: {response.PendingReason}", true, progress); + Presentation.UpdateStatus($"Pending Device Enrolment Approval: {response.PendingIdentifier}", $"Waiting for enrolment session '{response.PendingIdentifier}' to be approved.{Environment.NewLine}Reason: {response.PendingReason}", true, progress); System.Threading.Thread.Sleep(TimeSpan.FromSeconds(10)); } else diff --git a/Disco.Models/UI/Job/JobIndexModel.cs b/Disco.Models/UI/Job/JobIndexModel.cs index 76a88111..8db9687f 100644 --- a/Disco.Models/UI/Job/JobIndexModel.cs +++ b/Disco.Models/UI/Job/JobIndexModel.cs @@ -8,6 +8,6 @@ namespace Disco.Models.UI.Job { JobTableModel MyJobs { get; set; } JobTableModel StaleJobs { get; set; } - List PendingEnrollments { get; set; } + List PendingEnrolments { get; set; } } } diff --git a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs index fd8ec4f5..5acbf287 100644 --- a/Disco.Services/Devices/Enrolment/EnrolmentLog.cs +++ b/Disco.Services/Devices/Enrolment/EnrolmentLog.cs @@ -47,7 +47,7 @@ namespace Disco.Services.Devices.Enrolment { get { - return "Device Enrollment"; + return "Device Enrolment"; } } public override int ModuleId @@ -340,7 +340,7 @@ namespace Disco.Services.Devices.Enrolment Id = (int)EventTypeIds.SessionStarting, ModuleId = _ModuleId, Name = "Session Starting", - Format = "Starting '{2}' Enrollment for {1} (Session# {0})", + Format = "Starting '{2}' Enrolment for {1} (Session# {0})", Severity = 0, UseLive = true, UsePersist = true, @@ -384,7 +384,7 @@ namespace Disco.Services.Devices.Enrolment Id = (int)EventTypeIds.SessionPending, ModuleId = _ModuleId, Name = "Session Pending", - Format = "Pending '{2}' Enrollment for {1} (Session# {0}; Reason: {3}; Identifier: {4})", + Format = "Pending '{2}' Enrolment for {1} (Session# {0}; Reason: {3}; Identifier: {4})", Severity = 0, UseLive = true, UsePersist = true, @@ -395,7 +395,7 @@ namespace Disco.Services.Devices.Enrolment Id = (int)EventTypeIds.SessionPendingApproved, ModuleId = _ModuleId, Name = "Session Pending Approved", - Format = "Pending enrollment approved by {1} (Session# {0}; Reason: {2})", + Format = "Pending enrolment approved by {1} (Session# {0}; Reason: {2})", Severity = 0, UseLive = true, UsePersist = true, @@ -406,7 +406,7 @@ namespace Disco.Services.Devices.Enrolment Id = (int)EventTypeIds.SessionPendingRejected, ModuleId = _ModuleId, Name = "Session Pending Rejected", - Format = "Pending enrollment rejected by {1} (Session# {0}; Reason: {2})", + Format = "Pending enrolment rejected by {1} (Session# {0}; Reason: {2})", Severity = 0, UseLive = true, UsePersist = true, @@ -417,7 +417,7 @@ namespace Disco.Services.Devices.Enrolment Id = (int)EventTypeIds.SessionContinuing, ModuleId = _ModuleId, Name = "Session Continuing", - Format = "Continuing '{2}' Enrollment for {1} (Session# {0})", + Format = "Continuing '{2}' Enrolment for {1} (Session# {0})", Severity = 0, UseLive = true, UsePersist = true, diff --git a/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs b/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs index abdc6267..5577df86 100644 --- a/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs +++ b/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs @@ -59,7 +59,7 @@ namespace Disco.Services.Devices.Enrolment .ToList(); } - public static void ResolvePendingEnrollment(string sessionId, bool approve, string username, string reason) + public static void ResolvePendingEnrolment(string sessionId, bool approve, string username, string reason) { if (!pendingEnrolments.TryGetValue(sessionId, out var enrolResponse)) throw new InvalidOperationException("The pending session is invalid or has expired"); @@ -79,7 +79,7 @@ namespace Disco.Services.Devices.Enrolment } else { - enrolResponse.ErrorMessage = $"Enrollment rejected"; + enrolResponse.ErrorMessage = $"Enrolment rejected"; EnrolmentLog.LogSessionPendingRejected(sessionId, username, reason); } } diff --git a/Disco.Web/Areas/API/Controllers/EnrollmentController.cs b/Disco.Web/Areas/API/Controllers/EnrolmentController.cs similarity index 87% rename from Disco.Web/Areas/API/Controllers/EnrollmentController.cs rename to Disco.Web/Areas/API/Controllers/EnrolmentController.cs index eb2ce129..ae2b98b1 100644 --- a/Disco.Web/Areas/API/Controllers/EnrollmentController.cs +++ b/Disco.Web/Areas/API/Controllers/EnrolmentController.cs @@ -6,14 +6,14 @@ using System.Web.Mvc; namespace Disco.Web.Areas.API.Controllers { - public partial class EnrollmentController : AuthorizedDatabaseController + public partial class EnrolmentController : AuthorizedDatabaseController { [HttpPost] [ValidateAntiForgeryToken] [DiscoAuthorize(Claims.Device.Actions.EnrolDevices)] public virtual ActionResult ResolveSessionPending(string sessionId, bool approve, string reason) { - WindowsDeviceEnrolment.ResolvePendingEnrollment(sessionId, approve, CurrentUser.UserId, reason); + WindowsDeviceEnrolment.ResolvePendingEnrolment(sessionId, approve, CurrentUser.UserId, reason); return new HttpStatusCodeResult(200); } diff --git a/Disco.Web/Areas/Config/Views/Config/Index.cshtml b/Disco.Web/Areas/Config/Views/Config/Index.cshtml index 145b3331..3052ffa0 100644 --- a/Disco.Web/Areas/Config/Views/Config/Index.cshtml +++ b/Disco.Web/Areas/Config/Views/Config/Index.cshtml @@ -84,9 +84,9 @@ } @if (Authorization.Has(Claims.Config.Enrolment.Show)) { - @Html.ActionLinkClass("Enrollment", MVC.Config.Enrolment.Index(), "config") + @Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config") } diff --git a/Disco.Web/Areas/Config/Views/Config/Index.generated.cs b/Disco.Web/Areas/Config/Views/Config/Index.generated.cs index b30a6d52..d462e366 100644 --- a/Disco.Web/Areas/Config/Views/Config/Index.generated.cs +++ b/Disco.Web/Areas/Config/Views/Config/Index.generated.cs @@ -592,14 +592,14 @@ WriteLiteral(">"); #line hidden #line 87 "..\..\Areas\Config\Views\Config\Index.cshtml" - Write(Html.ActionLinkClass("Enrollment", MVC.Config.Enrolment.Index(), "config")); + Write(Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config")); #line default #line hidden #line 87 "..\..\Areas\Config\Views\Config\Index.cshtml" - + #line default @@ -608,8 +608,8 @@ WriteLiteral(" \r\n Configure Enrollment settings including secure cre" + -"dentials.\r\n \r\n"); +WriteLiteral(">\r\n Configure Enrolment settings including secure cred" + +"entials.\r\n \r\n"); #line 91 "..\..\Areas\Config\Views\Config\Index.cshtml" @@ -1011,14 +1011,14 @@ WriteLiteral(" class=\"fa fa-cloud-download info\""); WriteLiteral(">\r\n
An updated version of Disco is available
\r\n (Model.UpdateResponse.UrlLink +, Tuple.Create(Tuple.Create("", 8687), Tuple.Create(Model.UpdateResponse.UrlLink #line default #line hidden -, 8689), false) +, 8687), false) ); WriteLiteral(" class=\"button small alert\""); diff --git a/Disco.Web/Areas/Config/Views/Enrolment/Index.cshtml b/Disco.Web/Areas/Config/Views/Enrolment/Index.cshtml index 81fb26d3..5b44292f 100644 --- a/Disco.Web/Areas/Config/Views/Enrolment/Index.cshtml +++ b/Disco.Web/Areas/Config/Views/Enrolment/Index.cshtml @@ -5,7 +5,7 @@ var canConfig = Authorization.Has(Claims.Config.Enrolment.Configure); var canShowStatus = Authorization.Has(Claims.Config.Enrolment.ShowStatus); - ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrollment"); + ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Enrolment"); }
@@ -45,7 +45,7 @@ return; } else { $.ajax({ - url: '@Url.Action(MVC.API.Enrollment.PendingTimeoutMinutes())', + url: '@Url.Action(MVC.API.Enrolment.PendingTimeoutMinutes())', dataType: 'json', method: 'POST', data: data, @@ -76,8 +76,8 @@ @@ -215,7 +215,7 @@ - This url will return a JSON response containing basic information about the enrollment.
+ This url will return a JSON response containing basic information about the enrolment.
This command makes use of cURL (bundled with OSX). Other methods can also trigger a Mac Secure Enroll, such as an anchor (<a>) or <script> @@ -227,7 +227,7 @@ @if (canShowStatus && Authorization.Has(Claims.Config.Logging.Show)) { -

Live Enrollment Logging

+

Live Enrolment Logging

@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel() { IsLive = true, @@ -244,6 +244,6 @@ } @if (canShowStatus) { - @Html.ActionLinkButton("Enrollment Status", MVC.Config.Enrolment.Status()) + @Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status()) } diff --git a/Disco.Web/Areas/Config/Views/Enrolment/Index.generated.cs b/Disco.Web/Areas/Config/Views/Enrolment/Index.generated.cs index e2e40087..b480fac4 100644 --- a/Disco.Web/Areas/Config/Views/Enrolment/Index.generated.cs +++ b/Disco.Web/Areas/Config/Views/Enrolment/Index.generated.cs @@ -51,7 +51,7 @@ namespace Disco.Web.Areas.Config.Views.Enrolment var canConfig = Authorization.Has(Claims.Config.Enrolment.Configure); var canShowStatus = Authorization.Has(Claims.Config.Enrolment.ShowStatus); - ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrollment"); + ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Enrolment"); #line default @@ -160,7 +160,7 @@ WriteLiteral(@"> #line 48 "..\..\Areas\Config\Views\Enrolment\Index.cshtml" - Write(Url.Action(MVC.API.Enrollment.PendingTimeoutMinutes())); + Write(Url.Action(MVC.API.Enrolment.PendingTimeoutMinutes())); #line default @@ -221,8 +221,8 @@ WriteLiteral(">\r\n - If a device enrollment is not automatically approved it will remain pending until the timeout is reached. - Pending enrollments can be approved manually from the Enrollment Status page. + If a device enrolment is not automatically approved it will remain pending until the timeout is reached. + Pending enrolments can be approved manually from the Enrolment Status page.
@@ -562,8 +562,8 @@ WriteLiteral(" target=\"_blank\""); WriteLiteral(" href=\"http://json.org/\""); -WriteLiteral(">JSON response containing basic information about the enrollment.
\r\n JSON response containing basic information about the enrolment.
" + +"\r\n <script>\r\n tag embedded on the #line default #line hidden -WriteLiteral("

Live Enrollment Logging

\r\n"); +WriteLiteral("

Live Enrolment Logging

\r\n"); #line 231 "..\..\Areas\Config\Views\Enrolment\Index.cshtml" @@ -671,14 +671,14 @@ WriteLiteral(" "); #line hidden #line 247 "..\..\Areas\Config\Views\Enrolment\Index.cshtml" - Write(Html.ActionLinkButton("Enrollment Status", MVC.Config.Enrolment.Status())); + Write(Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status())); #line default #line hidden #line 247 "..\..\Areas\Config\Views\Enrolment\Index.cshtml" - + } diff --git a/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml b/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml index 99b3cb48..47b27f64 100644 --- a/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml +++ b/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml @@ -1,15 +1,15 @@ @{ Authorization.Require(Claims.Config.Enrolment.ShowStatus); - ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrollment", MVC.Config.Enrolment.Index(), "Status"); + ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Enrolment", MVC.Config.Enrolment.Index(), "Status"); Html.BundleDeferred("~/ClientScripts/Modules/Knockout"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope"); }
- @Html.AntiForgeryToken(); + @Html.AntiForgeryToken()
-

No enrollment sessions today

+

No enrolment sessions today

} -@if (Model.PendingEnrollments != null && Model.PendingEnrollments.Count > 0 && Authorization.Has(Claims.Device.Actions.EnrolDevices)) +@if (Model.PendingEnrolments != null && Model.PendingEnrolments.Count > 0 && Authorization.Has(Claims.Device.Actions.EnrolDevices)) { -
+
-
There are device enrollments pending approval.
- View Enrollments +
There are device enrolments pending approval.
+ View Enrolments
\r\n"); +"ayout_PageHeading\').height(80);\r\n $(\'#pendingEnrolments\')\r\n " + +" .detach()\r\n .appendTo(layout_PageHeading);\r\n });\r\n " + +" \r\n"); #line 169 "..\..\Views\Job\Index.cshtml"
- If a device enrollment is not automatically approved it will remain pending until the timeout is reached. - Pending enrollments can be approved manually from the Enrollment Status page. + If a device enrolment is not automatically approved it will remain pending until the timeout is reached. + Pending enrolments can be approved manually from the Enrolment Status page.