Beispiel #1
0
        public ActionResult Login(KeyHouse.Models.Login login, string returnurl)
        {
            Uitilsateur user = new Uitilsateur();

            if (ModelState.IsValid)
            {
                if (usera != null)
                {
                    FormsAuthentication.SetAuthCookie(user.idUtilisateur.ToString(), false);
                    if (!string.IsNullOrEmpty(returnurl) && Url.IsLocalUrl(returnurl))
                    {
                        return(Redirect(returnurl));
                    }

                    ModelState.AddModelError(usera.Email, "Utilisateur incorrecte");
                }
            }

            return(View(login));
        }
Beispiel #2
0
        // GET: Login
        public ActionResult Login()
        {
            Uitilsateur uitilsateur = new Uitilsateur();


            KeyHouse.Models.Login loginuser = new KeyHouse.Models.Login()
            {
                Authentifie = HttpContext.User.Identity.IsAuthenticated
            };

            if (HttpContext.User.Identity.IsAuthenticated)
            {
                loginuser.Loginapp = HttpContext.User.Identity.Name;
            }
            else
            {
            }

            return(View());
        }