Ejemplo n.º 1
0
        public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl)
        {
            if (!ValidateLogOn(userName, password))
            {
                LogOnScreen screen = new LogOnScreen();
                ViewData.Model = screen;
                return View();
            }

            FormsAuth.SignIn(userName, rememberMe);

            bool isRealUser = repo.ValidateUser(CacheHandler.BlogConfigId, userName, password);

            var user = repo.GetBlogUserByUserName(CacheHandler.BlogConfigId, userName);

            SessionHandler.CurrentUser = user;
            SessionHandler.CurrentUserId = user.BlogUserId;

            if (!String.IsNullOrEmpty(returnUrl))
            {
                return Redirect(returnUrl);
            }
            else
            {
                return RedirectToAction("Index", "Admin");
            }
        }
Ejemplo n.º 2
0
 public ActionResult LogOn()
 {
     LogOnScreen screen = new LogOnScreen();
     ViewData.Model = screen;
     return View();
 }