From 10394c4e3947fbba4a5b5964ca7fbbe7ff05de1a Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 23 Jan 2014 13:36:19 +1100 Subject: [PATCH] Bug Fix #36: Default Profile name template error The "Initial Default Workstation Profile" had an incorrect Computer Name Template set by default. This does not affect newly created Device Profiles which use a valid template. --- Disco.Data/Repository/DiscoDataSeeder.cs | 2 +- Disco.Models/Repository/Device/DeviceProfile.cs | 2 ++ Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Disco.Data/Repository/DiscoDataSeeder.cs b/Disco.Data/Repository/DiscoDataSeeder.cs index b5c7070d..e6b3f3bf 100644 --- a/Disco.Data/Repository/DiscoDataSeeder.cs +++ b/Disco.Data/Repository/DiscoDataSeeder.cs @@ -66,7 +66,7 @@ namespace Disco.Data.Repository ShortName = "WS", Name = "Default", Description = "Initial Default Workstation Profile", - ComputerNameTemplate = "DeviceProfile.ShortName + ''-'' + SerialNumber", + ComputerNameTemplate = DeviceProfile.DefaultComputerNameTemplate, DistributionType = DeviceProfile.DistributionTypes.OneToMany }); } diff --git a/Disco.Models/Repository/Device/DeviceProfile.cs b/Disco.Models/Repository/Device/DeviceProfile.cs index 2e806c4f..37ff8608 100644 --- a/Disco.Models/Repository/Device/DeviceProfile.cs +++ b/Disco.Models/Repository/Device/DeviceProfile.cs @@ -63,6 +63,8 @@ namespace Disco.Models.Repository [StringLength(64)] public string CertificateProviderId { get; set; } + public const string DefaultComputerNameTemplate = "DeviceProfile.ShortName + '-' + SerialNumber"; + public enum DistributionTypes : int { OneToMany = 0, diff --git a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs index cd5dda61..4516a92e 100644 --- a/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs +++ b/Disco.Web/Areas/Config/Controllers/DeviceProfileController.cs @@ -73,7 +73,7 @@ namespace Disco.Web.Areas.Config.Controllers { DeviceProfile = new DeviceProfile() { - ComputerNameTemplate = "DeviceProfile.ShortName + '-' + SerialNumber", + ComputerNameTemplate = DeviceProfile.DefaultComputerNameTemplate, ProvisionADAccount = true, DistributionType = DeviceProfile.DistributionTypes.OneToMany }