diff options
| author | Michael <[email protected]> | 2017-04-30 19:38:17 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-30 19:38:17 -0400 |
| commit | 73402c31a69bec303933d80a0cedaa5ae6a4f89c (patch) | |
| tree | 5657abab0649614290cb4d20bfd06352f37bf295 /Project-Unite | |
| parent | 76be5076e025216a66d29ea7da67317c94ab06e6 (diff) | |
| download | project-unite-73402c31a69bec303933d80a0cedaa5ae6a4f89c.tar.gz project-unite-73402c31a69bec303933d80a0cedaa5ae6a4f89c.tar.bz2 project-unite-73402c31a69bec303933d80a0cedaa5ae6a4f89c.zip | |
System Name fiield in register view
Diffstat (limited to 'Project-Unite')
| -rw-r--r-- | Project-Unite/Controllers/AccountController.cs | 2 | ||||
| -rw-r--r-- | Project-Unite/Models/AccountViewModels.cs | 5 | ||||
| -rw-r--r-- | Project-Unite/Views/Account/Register.cshtml | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Project-Unite/Controllers/AccountController.cs b/Project-Unite/Controllers/AccountController.cs index 2eb5806..9dd86aa 100644 --- a/Project-Unite/Controllers/AccountController.cs +++ b/Project-Unite/Controllers/AccountController.cs @@ -200,7 +200,7 @@ The address used to send this message is not a no-reply address. In fact, my nam } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email, DisplayName = model.Username, Codepoints = 0, JoinedAt = DateTime.Now, MutedAt = DateTime.Now, BannedAt = DateTime.Now, LastLogin = DateTime.Now }; + var user = new ApplicationUser { SystemName = model.SystemName, UserName = model.Email, Email = model.Email, DisplayName = model.Username, Codepoints = 0, JoinedAt = DateTime.Now, MutedAt = DateTime.Now, BannedAt = DateTime.Now, LastLogin = DateTime.Now }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { diff --git a/Project-Unite/Models/AccountViewModels.cs b/Project-Unite/Models/AccountViewModels.cs index 30f24f1..4850c7c 100644 --- a/Project-Unite/Models/AccountViewModels.cs +++ b/Project-Unite/Models/AccountViewModels.cs @@ -69,6 +69,11 @@ namespace Project_Unite.Models [Display(Name = "Email")] public string Email { get; set; } + [Required(ErrorMessage = "You require a system name. This is the hostname you will use when inside ShiftOS.")] + [MinLength(5, ErrorMessage ="Your System Name must have at least 5 characters in it.")] + [Display(Name ="System Name")] + public string SystemName { get; set; } + [Required] [MaxLength(25, ErrorMessage ="Your username must be less than 25 characters long.")] [MinLength(3, ErrorMessage ="Your username must have a minimum of 3 characters.")] diff --git a/Project-Unite/Views/Account/Register.cshtml b/Project-Unite/Views/Account/Register.cshtml index e8f43a4..b708b5c 100644 --- a/Project-Unite/Views/Account/Register.cshtml +++ b/Project-Unite/Views/Account/Register.cshtml @@ -28,6 +28,14 @@ </div> </div> <div class="form-group"> + @Html.LabelFor(m => m.SystemName, new { @class = "col-md-2 control-label" }) + <div class="col-md-10"> + @Html.TextBoxFor(m => m.SystemName, new { @class = "form-control" }) + </div> + </div> + + + <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) |
