feature: device profiles - set assigned user for logon

This commit is contained in:
Gary Sharp committed 2025-09-07 12:48:10 +10:00
1 parent 36c24542e1
commit 3e514fdf9a
13 files changed
+580 -192

No files matched your search

@@ -134,7 +134,10 @@ namespace Disco.Client.Extensions
if (enrolResponse.AssignedUserIsLocalAdmin)
LocalAuthentication.AddLocalGroupMembership("Administrators", enrolResponse.AssignedUserSID, enrolResponse.AssignedUserUsername, enrolResponse.AssignedUserDomain);
}
if (enrolResponse.SetAssignedUserForLogon && !string.IsNullOrEmpty(enrolResponse.AssignedUserDomain) && !string.IsNullOrEmpty(enrolResponse.AssignedUserUsername))
{
// Make Windows think this user was the last to logon
using (RegistryKey regWinlogon = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true))
{
+7
View File
@@ -201,6 +201,10 @@
<Compile Include="Migrations\202507170522576_DBv28.Designer.cs">
<DependentUpon>202507170522576_DBv28.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202509070209304_DBv29.cs" />
<Compile Include="Migrations\202509070209304_DBv29.Designer.cs">
<DependentUpon>202509070209304_DBv29.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -300,6 +304,9 @@
<EmbeddedResource Include="Migrations\202507170522576_DBv28.resx">
<DependentUpon>202507170522576_DBv28.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202509070209304_DBv29.resx">
<DependentUpon>202509070209304_DBv29.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
+27
View File
@@ -0,0 +1,27 @@
// <auto-generated />
namespace Disco.Data.Migrations
{
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
public sealed partial class DBv29 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv29));
string IMigrationMetadata.Id
{
get { return "202509070209304_DBv29"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,18 @@
namespace Disco.Data.Migrations
{
using System.Data.Entity.Migrations;
public partial class DBv29 : DbMigration
{
public override void Up()
{
AddColumn("dbo.DeviceProfiles", "SetAssignedUserForLogon", c => c.Boolean(nullable: false));
Sql("UPDATE dbo.DeviceProfiles SET SetAssignedUserForLogon = 1");
}
public override void Down()
{
DropColumn("dbo.DeviceProfiles", "SetAssignedUserForLogon");
}
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1925Ict47g+0bsPyj6aXciRi3JsiyfkGdCbkl2ayS1TrdsP3akqtjdOc7KLGdmyerza/uwn7S/sGReeQF4S+alSvVwfNRFEARAJAiSIPD//s//ffGfXzfJgy8kL+Is/enk8cNHJw9IusrWcXr708muvPn35yf/+R//83+8eL3efH3wewv3HYOjPdPip5O7stz+4/S0WN2RTVQ83MSrPCuym/LhKtucRuvs9MmjRz+ePn58SiiKE4rrwYMXl7u0jDek+oP+eZalK7Itd1HyPluTpGh+py1XFdYHH6INKbbRivx08iouVtnDV1EZPbwk26yIyyy/P3nwMokjSswVSW5OHmyf/uO3glyVeZbeXm2jMo6ST/dbQttvoqQgDen/2D61pf7RE0b9aZSmWUnRZakX9ycdX5Sz11QC5T0jq+LupxMqhJv4dpdX+M9LIoDTDv9F7oUf6E8f82xL8vL+ktw0SK5W9JeTB6dmSIpOhntxKo/R9RPRM6rpH2VOteTkwZv4K1m/I+ltedcJ+H30tf3lOVWV39KY6hTtU+Y72vphlyTR54R04KfaUStSJx7z9yjZuXJK/6kZtv6bH/XFaa8EWtV4la12G5KWn8hmm0Ql8dGM87X7dLM+ThL4brDcX5Filcfb+htzGvvJ94MH91HvZ0M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namespace Disco.Models.ClientServices
public string AssignedUserDescription { get; set; }
public bool AssignedUserIsLocalAdmin { get; set; }
public bool SetAssignedUserForLogon { get; set; }
public string OfflineDomainJoinManifest { get; set; }
@@ -38,6 +38,7 @@ namespace Disco.Models.Repository
public bool ProvisionADAccount { get; set; }
public bool AssignedUserLocalAdmin { get; set; }
public bool SetAssignedUserForLogon { get; set; }
public bool AllowUntrustedReimageJobEnrolment { get; set; }
@@ -501,6 +501,8 @@ namespace Disco.Services.Devices.Enrolment
response.AllowBootstrapperUninstall = true;
}
response.SetAssignedUserForLogon = device.DeviceProfile.SetAssignedUserForLogon;
// Provision Certificates
if (!string.IsNullOrEmpty(device.DeviceProfile.CertificateProviders) ||
!string.IsNullOrEmpty(device.DeviceProfile.CertificateAuthorityProviders))
@@ -22,22 +22,23 @@ namespace Disco.Web.Areas.API.Controllers
{
public partial class DeviceProfileController : AuthorizedDatabaseController
{
const string pDescription = "description";
const string pName = "name";
const string pShortName = "shortname";
const string pDistributionType = "distributiontype";
const string pCertificateProviders = "certificateproviders";
const string pCertificateAuthorityProviders = "certificateauthorityproviders";
const string pWirelessProfileProviders = "wirelessprofileproviders";
const string pOrganisationalUnit = "organisationalunit";
const string pDefaultOrganisationAddress = "defaultorganisationaddress";
const string pEnforceComputerNameConvention = "enforcecomputernameconvention";
const string pEnforceOrganisationalUnit = "enforceorganisationalunit";
const string pProvisionADAccount = "provisionadaccount";
const string pAssignedUserLocalAdmin = "assigneduserlocaladmin";
const string pAllowUntrustedReimageJobEnrolment = "allowuntrustedreimagejobrnrolment";
const string pDevicesLinkedGroup = "deviceslinkedgroup";
const string pAssignedUsersLinkedGroup = "assigneduserslinkedgroup";
private const string pDescription = "description";
private const string pName = "name";
private const string pShortName = "shortname";
private const string pDistributionType = "distributiontype";
private const string pCertificateProviders = "certificateproviders";
private const string pCertificateAuthorityProviders = "certificateauthorityproviders";
private const string pWirelessProfileProviders = "wirelessprofileproviders";
private const string pOrganisationalUnit = "organisationalunit";
private const string pDefaultOrganisationAddress = "defaultorganisationaddress";
private const string pEnforceComputerNameConvention = "enforcecomputernameconvention";
private const string pEnforceOrganisationalUnit = "enforceorganisationalunit";
private const string pProvisionADAccount = "provisionadaccount";
private const string pAssignedUserLocalAdmin = "assigneduserlocaladmin";
private const string pSetAssignedUserForLogon = "setassigneduserforlogon";
private const string pAllowUntrustedReimageJobEnrolment = "allowuntrustedreimagejobrnrolment";
private const string pDevicesLinkedGroup = "deviceslinkedgroup";
private const string pAssignedUsersLinkedGroup = "assigneduserslinkedgroup";
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
[HttpPost, ValidateAntiForgeryToken]
@@ -95,6 +96,9 @@ namespace Disco.Web.Areas.API.Controllers
case pAssignedUserLocalAdmin:
UpdateAssignedUserLocalAdmin(deviceProfile, value);
break;
case pSetAssignedUserForLogon:
UpdateSetAssignedUserForLogon(deviceProfile, value);
break;
case pAllowUntrustedReimageJobEnrolment:
UpdateAllowUntrustedReimageJobEnrolment(deviceProfile, value);
break;
@@ -347,6 +351,13 @@ namespace Disco.Web.Areas.API.Controllers
return Update(id, pProvisionADAccount, ProvisionADAccount, redirect);
}
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
[HttpPost, ValidateAntiForgeryToken]
public virtual ActionResult UpdateSetAssignedUserForLogon(int id, string setAssignedUserForLogon = null, bool? redirect = null)
{
return Update(id, pSetAssignedUserForLogon, setAssignedUserForLogon, redirect);
}
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
[HttpPost, ValidateAntiForgeryToken]
public virtual ActionResult UpdateAssignedUserLocalAdmin(int id, string AssignedUserLocalAdmin = null, bool? redirect = null)
@@ -667,6 +678,18 @@ namespace Disco.Web.Areas.API.Controllers
throw new Exception("Invalid Boolean Value");
}
private void UpdateSetAssignedUserForLogon(DeviceProfile deviceProfile, string setAssignedUserForLogon)
{
if (bool.TryParse(setAssignedUserForLogon, out var bValue))
{
deviceProfile.SetAssignedUserForLogon = bValue;
Database.SaveChanges();
return;
}
throw new Exception("Invalid Boolean Value");
}
private void UpdateAllowUntrustedReimageJobEnrolment(DeviceProfile deviceProfile, string allowUntrustedReimageJobEnrolment)
{
if (bool.TryParse(allowUntrustedReimageJobEnrolment, out var bValue))
@@ -134,7 +134,8 @@ namespace Disco.Web.Areas.Config.Controllers
ProvisionADAccount = true,
ComputerNameTemplate = DeviceProfile.DefaultComputerNameTemplate,
DistributionType = DeviceProfile.DistributionTypes.OneToMany,
OrganisationalUnit = ActiveDirectory.Context.PrimaryDomain.DefaultComputerContainer
OrganisationalUnit = ActiveDirectory.Context.PrimaryDomain.DefaultComputerContainer,
SetAssignedUserForLogon = true,
};
Database.DeviceProfiles.Add(deviceProfile);
@@ -258,6 +258,35 @@
</p>
</div>
</div>
<div style="margin-top: 8px;">
@if (canConfig)
{
<input id="DeviceProfile_SetAssignedUserForLogon" type="checkbox" @(Model.DeviceProfile.SetAssignedUserForLogon ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) />
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceProfile_SetAssignedUserForLogon'),
null,
'@Url.Action(MVC.API.DeviceProfile.UpdateSetAssignedUserForLogon(Model.DeviceProfile.Id))',
'setAssignedUserForLogon'
);
});
</script>
}
else
{
<input id="DeviceProfile_SetAssignedUserForLogon" type="checkbox" @(Model.DeviceProfile.SetAssignedUserForLogon ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
}
<label for="DeviceProfile_SetAssignedUserForLogon">
Set Assigned User for Logon
</label>
@AjaxHelpers.AjaxLoader()
<div class="info-box">
<p class="fa-p">
<i class="fa fa-info-circle"></i>When enabled the assigned user details will be pre-populated at the device logon screen.
</p>
</div>
</div>
<div style="margin-top: 8px;">
@if (canConfig)
{
File diff suppressed because it is too large. Load diff
@@ -151,6 +151,12 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UpdateSetAssignedUserForLogon()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateSetAssignedUserForLogon);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UpdateAssignedUserLocalAdmin()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUserLocalAdmin);
@@ -222,6 +228,7 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string UpdateEnforceComputerNameConvention = "UpdateEnforceComputerNameConvention";
public readonly string UpdateEnforceOrganisationalUnit = "UpdateEnforceOrganisationalUnit";
public readonly string UpdateProvisionADAccount = "UpdateProvisionADAccount";
public readonly string UpdateSetAssignedUserForLogon = "UpdateSetAssignedUserForLogon";
public readonly string UpdateAssignedUserLocalAdmin = "UpdateAssignedUserLocalAdmin";
public readonly string UpdateAllowUntrustedReimageJobEnrolment = "UpdateAllowUntrustedReimageJobEnrolment";
public readonly string UpdateDevicesLinkedGroup = "UpdateDevicesLinkedGroup";
@@ -249,6 +256,7 @@ namespace Disco.Web.Areas.API.Controllers
public const string UpdateEnforceComputerNameConvention = "UpdateEnforceComputerNameConvention";
public const string UpdateEnforceOrganisationalUnit = "UpdateEnforceOrganisationalUnit";
public const string UpdateProvisionADAccount = "UpdateProvisionADAccount";
public const string UpdateSetAssignedUserForLogon = "UpdateSetAssignedUserForLogon";
public const string UpdateAssignedUserLocalAdmin = "UpdateAssignedUserLocalAdmin";
public const string UpdateAllowUntrustedReimageJobEnrolment = "UpdateAllowUntrustedReimageJobEnrolment";
public const string UpdateDevicesLinkedGroup = "UpdateDevicesLinkedGroup";
@@ -411,6 +419,16 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string ProvisionADAccount = "ProvisionADAccount";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_UpdateSetAssignedUserForLogon s_params_UpdateSetAssignedUserForLogon = new ActionParamsClass_UpdateSetAssignedUserForLogon();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UpdateSetAssignedUserForLogon UpdateSetAssignedUserForLogonParams { get { return s_params_UpdateSetAssignedUserForLogon; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_UpdateSetAssignedUserForLogon
{
public readonly string id = "id";
public readonly string setAssignedUserForLogon = "setAssignedUserForLogon";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_UpdateAssignedUserLocalAdmin s_params_UpdateAssignedUserLocalAdmin = new ActionParamsClass_UpdateAssignedUserLocalAdmin();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UpdateAssignedUserLocalAdmin UpdateAssignedUserLocalAdminParams { get { return s_params_UpdateAssignedUserLocalAdmin; } }
@@ -709,6 +727,20 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
partial void UpdateSetAssignedUserForLogonOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string setAssignedUserForLogon, bool? redirect);
[NonAction]
public override System.Web.Mvc.ActionResult UpdateSetAssignedUserForLogon(int id, string setAssignedUserForLogon, bool? redirect)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateSetAssignedUserForLogon);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "setAssignedUserForLogon", setAssignedUserForLogon);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
UpdateSetAssignedUserForLogonOverride(callInfo, id, setAssignedUserForLogon, redirect);
return callInfo;
}
[NonAction]
partial void UpdateAssignedUserLocalAdminOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string AssignedUserLocalAdmin, bool? redirect);