protected override bool AuthorizeCore(HttpContextBase httpContext) { DASUser user = (DASUser)HttpContext.Current.Session["DASUser"]; if (user == null) { return(false); } else { return(true); } }
public ActionResult LoginAction(String email, String password) { bool loggedIn = false; User userDB = Db.Users.Where(u => u.Username == email && u.Password == password).FirstOrDefault(); if (userDB != null) { loggedIn = true; DASUser user = new DASUser(); user.SelectedLanguageId = 1; user.UserName = userDB.Username; Session["DASUser"] = user; } else { loggedIn = false; } return(Json(new { success = loggedIn })); }