Пример #1
0
        public ActionResult Login(LoginModel login)
        {
            if (!ModelState.IsValid)
            {
                return(View(login));
            }
            Authenticate    authenticate = new Authenticate(server, login.userName, login.password);
            JsonResultLogin resultLogin  = authenticate.CheckLogin();

            if (authenticate.isLogin)
            {
                FormsAuthentication.SetAuthCookie(login.userName, login.RememberCookie);

                return(RedirectToAction("ControlRoomMeeting", "RoomsMeetings"));
            }
            return(View(login));
        }
Пример #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));
        }