System Name fiield in register view

This commit is contained in:
Michael 2017-04-30 19:38:17 -04:00
parent 76be5076e0
commit 73402c31a6
3 changed files with 14 additions and 1 deletions

View file

@ -200,7 +200,7 @@ public async Task<ActionResult> Register(RegisterViewModel model)
}
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)
{

View file

@ -69,6 +69,11 @@ public class RegisterViewModel
[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.")]

View file

@ -27,6 +27,14 @@
@Html.TextBoxFor(m => m.Username, new { @class = "form-control" })
</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">