Пример #1
0
        public ActionResult ChangePassword(ChangePassword pwdForm)
        {
            UserModel userModel = new UserModel();
            UserInfo userInfo = userModel.GetUserInfo(User.Identity.Name);

            userInfo.Password = userModel.PasswordEncrypt(pwdForm.NewPassword);
            userModel.Save();

            userModel.SignOut();

            return RedirectToAction("Login");
        }
Пример #2
0
        public ActionResult LogOut(string returnUrl)
        {
            UserModel accountModel = new UserModel();
            accountModel.SignOut();

            if (!string.IsNullOrWhiteSpace(returnUrl) && !returnUrl.ToLower().Contains("/user"))
                return Redirect(returnUrl);

            return Redirect("/");;
        }