public virtual ActionResult CreateUser()
 {
     var model = new RegisterViewModel {MinRequiredPasswordLength = _userService.Settings.MinRequiredPasswordLength};
     //{
     //  RequireSecretQuestionAndAnswer = _userService.RequiresQuestionAndAnswer
     //};
     return View(model);
 }
        public virtual ActionResult CreateUser(RegisterViewModel model)
        {
            var status = _userService.CreateUser(model.UserName, model.Password, model.Email, model.Approve);

            if (status == UserCreateStatus.Success)
            {
                var user = _userService.GetUserByUserName(model.UserName);

                return
                    new RedirectToRouteResult(
                        new RouteValueDictionary(
                            new {action = "GrantRolesToUser", controller = "Membership", username = user.UserName}));
            }
            // TODO: HAS 09/27/2012 Report create failure
            return RedirectToAction("Index");
        }
        public virtual ActionResult Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                // Attempt to register the user
                //MembershipCreateStatus createStatus;
                // TODO: HAS 02/27/2013 Fix the namespacing for Membership here!
                //Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, out createStatus);

                ////if (createStatus == MembershipCreateStatus.Success)
                //{
                //  FormsAuthentication.SetAuthCookie(model.UserName, createPersistentCookie: false);
                //  return RedirectToAction("Index", "Home");
                //}
                //else ModelState.AddModelError("", ErrorCodeToString(createStatus));
            }

            return RedirectToAction("Register");
        }
 public virtual ActionResult Register()
 {
     var model = new RegisterViewModel {MinRequiredPasswordLength = _userService.Settings.MinRequiredPasswordLength};
     return View(model);
 }