Ejemplo n.º 1
0
        public ActionResult Index(string token)
        {
            ActionResult actionResult = RedirectToAction(string.Empty, "join");

            //another f*****g hack....
            //If not removed, it triggers the validation on the get.
            ModelState.Remove("token");

            if (!string.IsNullOrEmpty(token))
            {
                int  tokenCount = _joinRepository.GetTokenCount(token);
                bool validToken = (tokenCount == 1);

                if (validToken)
                {
                    actionResult = View(new UserRegisterView());
                }
            }

            return(actionResult);
        }
        /// <summary>
        /// Gets the token result.
        /// </summary>
        /// <param name="joinView">The join view.</param>
        /// <param name="token">The token.</param>
        /// <returns></returns>
        private ActionResult GetTokenResult(JoinView joinView, string token)
        {
            ActionResult actionResult;
            int          tokenCount = _joinRepository.GetTokenCount(token);
            bool         validToken = (tokenCount == 1);

            if (validToken)
            {
                actionResult = RedirectToAction(string.Empty, "register", new RouteValueDictionary {
                    { "token", token }
                });
            }
            else
            {
                joinView.UIMessage = "We searched our records forwards and backwards and we were unable to find the token entered. Perhaps it was mistyped?";
                actionResult       = View(joinView);
            }
            return(actionResult);
        }