public virtual ActionResult CreateUser(RegisterViewModel model) { MembershipUser user; MembershipCreateStatus status; user = membershipService.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, model.Approve, out status); return routeHelpers.Actions.GrantRolesToUser(user.UserName); }
public virtual ActionResult CreateUser() { var model = new RegisterViewModel() { RequireSecretQuestionAndAnswer = membershipService.RequiresQuestionAndAnswer }; return View(model); }
public virtual ActionResult Register(RegisterViewModel model) { if (ModelState.IsValid) { // Attempt to register the user MembershipCreateStatus createStatus; Membership.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, true, out createStatus); if (createStatus == MembershipCreateStatus.Success) { FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */); return RedirectToAction("Index", "Home"); } else { ModelState.AddModelError("", ErrorCodeToString(createStatus)); } } return RedirectToAction("Register"); }
public virtual ActionResult CreateUser(RegisterViewModel model) { MembershipUser user; if (model.RequireSecretQuestionAndAnswer) { MembershipCreateStatus status; user = membershipService.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, model.Approve, out status); } else { user = membershipService.CreateUser(model.UserName, model.Password, model.Email); } return Actions.GrantRolesToUser(user.UserName); }
public virtual ActionResult Confirmation(RegisterViewModel model) { ViewBag.Email = model.Email; return View(); }