Beispiel #1
0
        public ActionResult Lock()
        {
            if (User.Identity.IsAuthenticated)
            {
                LockScreenModel lockScreen = new LockScreenModel
                {
                    Username = User.Identity.Name,
                    Password = null
                };

                FormsAuthentication.SignOut();
                this.lockScreen.Username = lockScreen.Username;
                return(View("LockScreen", lockScreen));
            }

            return(RedirectToAction("Login", "Auth"));
        }
Beispiel #2
0
        public ActionResult LockScreen(LockScreenModel login)
        {
            if (login.Username.Count() < 1)
            {
                return(RedirectToAction("Login", "Auth"));
            }

            if (ModelState.IsValid)
            {
                System.Web.Helpers.AntiForgery.Validate();
                Authenticate    authenticate = new Authenticate(server, login.Username, login.Password);
                JsonResultLogin resultLogin  = authenticate.CheckLogin();
                if (authenticate.isLogin)
                {
                    FormsAuthentication.SetAuthCookie(login.Username, false);

                    return(RedirectToAction("AllConference", "RoomsMeetings"));
                }
            }
            return(View(login));
        }