From 3e6ba2cd69f94802e01b5861aa25967ba982c3b1 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 28 Apr 2026 10:11:28 +1000 Subject: [PATCH] v1.3.1 - Add Initialize override that calls Register() to hook into page rendering --- Features/DeviceUIExtension.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Features/DeviceUIExtension.cs b/Features/DeviceUIExtension.cs index 9618141..094c05d 100644 --- a/Features/DeviceUIExtension.cs +++ b/Features/DeviceUIExtension.cs @@ -1,3 +1,4 @@ +using Disco.Data.Repository; using Disco.Models.UI.Device; using Disco.Services.Interop.ActiveDirectory; using Disco.Services.Plugins; @@ -11,6 +12,11 @@ namespace Disco.Plugins.ADCompare.Features [PluginFeature(Id = "ADCompareDeviceUI", Name = "Device Page - AD Compare")] public class DeviceUIExtension : UIExtensionFeature { + public override void Initialize(DiscoDataContext Database) + { + Register(); + } + public override UIExtensionResult ExecuteAction(ControllerContext context, DeviceShowModel model) { var device = model.Device; @@ -41,10 +47,8 @@ namespace Disco.Plugins.ADCompare.Features var hasManagedBy = !string.IsNullOrEmpty(managedByDN); var hasAssignment = !string.IsNullOrEmpty(discoAssignedUser); - // Extract display name from managedBy DN string managedByDisplayName = hasManagedBy ? ExtractCNFromDN(managedByDN) : null; - // Look up the Disco assigned user's DN in AD for comparison string assignedUserDN = null; if (hasAssignment) { @@ -57,7 +61,6 @@ namespace Disco.Plugins.ADCompare.Features catch { } } - // Compare DN-to-DN bool isMatch = false; if (!hasAssignment && !hasManagedBy) isMatch = true; @@ -107,7 +110,6 @@ namespace Disco.Plugins.ADCompare.Features } html.Append(""); - // Last Logon var lastLogonTicks = adAccount.GetPropertyValue("lastLogonTimestamp"); html.Append("Last Login"); if (lastLogonTicks > 0)