bug: edge case where the assigned user is incorrectly set for login

This commit is contained in:
Gary Sharp
2026-01-22 15:17:19 +11:00
parent 04be92a1df
commit 2ab765f2d7
+2 -3
View File
@@ -7,9 +7,8 @@ using System.IO;
namespace Disco.Client.Extensions namespace Disco.Client.Extensions
{ {
public static class EnrolExtensions internal static class EnrolExtensions
{ {
public static void Build(this Enrol enrol) public static void Build(this Enrol enrol)
{ {
enrol.ComputerName = Environment.MachineName; enrol.ComputerName = Environment.MachineName;
@@ -99,7 +98,7 @@ namespace Disco.Client.Extensions
File.Delete(odjFile); File.Delete(odjFile);
// Flush Logged-On History // Flush Logged-On History
if (!string.IsNullOrEmpty(enrolResponse.DomainName)) if (enrolResponse.SetAssignedUserForLogon && !string.IsNullOrEmpty(enrolResponse.DomainName))
{ {
using (RegistryKey regWinlogon = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true)) using (RegistryKey regWinlogon = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true))
{ {