コード例 #1
0
 public ActionResult Login(LoginModel lm, string returnUrl)
 {
     if (ModelState.IsValid)
     {
         WebSecurity.Login(lm.Email, lm.Password, persistCookie: lm.RememberMe);
         return RedirectToLocal(returnUrl);
     }
     return RedirectToAction("Index");
 }
コード例 #2
0
 public ActionResult Login(LoginModel model)
 {
     /*
     if (ModelState.IsValid && WebSecurity.Login(model.Email, model.Password, persistCookie: model.RememberMe))
     {
         return RedirectToAction("Index");
     }
     ModelState.AddModelError("", "The email or password provided is incorrect.");
      * */
     return View(model);
 }
コード例 #3
0
 public ActionResult UrlLogin(LoginModel lm)
 {
     if (WebSecurity.UserExists(lm.Email))
     {
         WebSecurity.ChangePassword(lm.Email, "heelErgGeheimPasswordWatNiemandMagWeten", lm.Password);
         WebSecurity.Login(lm.Email, lm.Password);
         return RedirectToAction("RemoveGuid", "TakeEnquete");
     }
     return RedirectToAction("Index", "Account");
 }
コード例 #4
0
ファイル: AccountController.cs プロジェクト: jordyhert/emina
        public ActionResult Login(LoginModel model, string returnUrl)
        {
            if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
            {
                return RedirectToLocal(returnUrl);
            }

            // If we got this far, something failed, redisplay form
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return View(model);
        }