Exemple #1
0
        public ActionResult Login(AdminLoginData ald)
        {
            _ah = WagenWebHelper.SignInAccount(
                this.AuthAdmin,
                ald.Login,
                ald.Password,
                this.GetAdminSessionId,
                AppHelper.Constants.ADMIN_COOKIE_NAME,
                this.Response);

            return RedirectToAction("index");
        }
Exemple #2
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            string action = filterContext.ActionDescriptor.ActionName.ToLower();
            if (action == "login")
            {
                // we wanna login, no problem
            }
            else
            {
                _ah = WagenWebHelper.GetAccountHandle(
                    AppHelper.Constants.ADMIN_COOKIE_NAME,
                    this.GetAdmin,
                    this.Request,
                    this.Response);

                if (_ah == null)
                {
                    filterContext.Result = this.RedirectToAction("index", "home");
                }
            }

            base.OnActionExecuting(filterContext);
        }
Exemple #3
0
 private string GetAdminSessionId(IAdminHandle ah)
 {
     return ah.SessionId;
 }