Esempio n. 1
0
        public ActionResult Login(User Account)
        {
            if (UserAccount.Login(ref Account))
            {
                if (Account.UserStatus != 1)
                {
                    UserAccount.Clear();    //JDR: CLear Session for all

                    //JDR: Show Email confirmation Error
                    string LinkResendConfirmation = Url.Action("ResentConfirmationCode", "Account", new { Email = Account.Email });
                    LinkResendConfirmation = "<a href=\"" + LinkResendConfirmation + "\">Resend Confirmation Code</a>";

                    TempData["AlertTag"]     = "warning";
                    TempData["AlertLabel"]   = "Email Confirmation:";
                    TempData["AlertMessage"] = "Email confirmation is requierd, please verify you email. " + LinkResendConfirmation;

                    return(View());
                }

                //JDR: Redirect useser to correct path depending where he tried to login
                ActionResult Action = RedirectToAction(UserAccount.LoggedInAction(), UserAccount.LoggedInController(), new { Example = "" });

                UserAccount.ResetLoggedInPath();

                return(Action);
            }

            ModelState.AddModelError("", "Email/Password is Incorrect");

            return(View());
        }
Esempio n. 2
0
        //JDR: LoggedOut Action - Log Out user (session destroy)
        public ActionResult LoggedOut()
        {
            UserAccount.Clear();

            return(RedirectToAction("LoggedIn"));
        }