Esempio n. 1
0
 public ActionResult Login(LoginModel model, string returnUrl)
 {
     var myAuthenticator = new Web.Models.Authenticate();
     if (ModelState.IsValid && myAuthenticator.IsAuthenticated(model.UserName,model.Password))
     {
         Session["User"] = model.UserName.Split('@')[0];
         return RedirectToLocal(returnUrl);
     }
     ModelState.AddModelError("", "The user name or password provided is incorrect.");
     return View(model);
 }
Esempio n. 2
0
        public ActionResult Login(LoginModel model, string returnUrl)
        {
            var myAuthenticator = new Web.Models.Authenticate();

            if (ModelState.IsValid && myAuthenticator.IsAuthenticated(model.UserName, model.Password))
            {
                Session["User"] = model.UserName.Split('@')[0];
                return(RedirectToLocal(returnUrl));
            }
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return(View(model));
        }