public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (!(filterContext.Controller is AccountController || filterContext.Controller is HomeController))
            {
                string id = IdStore.GetUserId();

                if (id == null)
                {
                    return;
                }
                else
                {
                    var user = new Users().Single(id);

                    if (user == null)
                    {
                        IdStore.RemoveClientAccess();
                        return;
                    }

                    if (user.IsFirstVisit)
                    {
                        filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary { { "action", "ClickThru" }, { "controller", "Account" } });
                    }
                }

                base.OnActionExecuting(filterContext);
            }
        }
Esempio n. 2
0
        private bool ValidateUser(long userID)
        {
            Users users = new Users();
               dynamic result = users.Single(userID);

               if (result != null)
               return true;
               else
               return false;
        }
Esempio n. 3
0
 /// <summary>
 /// The overloaded constructor for the Account Controller
 /// </summary>
 /// <param name="idStore">The Forms Authentication Abstraction</param>
 /// <param name="logger">The Logging Abstraction</param>
 public AccountController(IIdStore idStore, ILogger logger)
     : base(idStore, logger)
 {
     _users = new Users();
 }