mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
System Name fiield in register view
This commit is contained in:
parent
76be5076e0
commit
73402c31a6
3 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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.")]
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue