Example #1
0
        public static void AddUser(RegisterModel model)
        {
            string confirmationToken =
                 WebSecurity.CreateUserAndAccount(model.Email, model.Password, new { FirstName = model.FirstName, LastName = model.LastName, About = model.About }, true);
            var user = model;

            BodyEmail.BodySend(user, confirmationToken);
        }
Example #2
0
        public static void AddUser(RegisterModel model)
        {
            WebSecurity.CreateUserAndAccount(model.Email, model.Password,
                    new { FirstName = model.FirstName, LastName = model.LastName, About = model.About });

            WebSecurity.Login(model.Email, model.Password);

            //BodyEmail.BodySend(user, confirmationToken);
        }
Example #3
0
 public static void BodySend(RegisterModel model, string confirmationToken)
 {
     var uri = new Uri("http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/Account/RegisterConfirmation/" + confirmationToken);
     string body = "<h4>" + "Your login:"******"<h4>" + "Your password:"******".</div> <div>" + "To activate your account please click on the link:"
      + "<a href=\"" + uri
      + "\">" + "Press here" + "</a>"
      + "<div></h4>";
     new SendEmail(model.Email,body);
 }
Example #4
0
        public ActionResult Register(RegisterModel model, string[] selectedInterests)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    CreativesRepository.AddUser(model);

                    return RedirectToAction("Index","Home");
                }
                catch (MembershipCreateUserException e)
                {
                    ModelState.AddModelError("", ErrorCodeToString(e.StatusCode));
                }
            }

            return View(model);
        }