Esempio n. 1
0
        public ActionResult Password(PasswordViewModel model, string Password, string NewPassword, string ConfirmPassword)
        {
            SetBreadCrumb("Password");

            if (!_userServices.ValidatePassword(CurrentUser, model.CurrentPassword))
                ModelState.AddModelError("CurrentPassword", "Invalid password.");

            if (IsModelValidAndPersistErrors())
            {
                _userServices.UpdatePassword(CurrentUser.UserID, NewPassword);
                _emailServices.PasswordChanged(CurrentUser, NewPassword);
                SetSuccess("Password changed. An email confirmation has been sent");
            }

            return RedirectToSelf();
        }
Esempio n. 2
0
        public ActionResult Password()
        {
            SetBreadCrumb("Password");
            var model = new PasswordViewModel()
            {
                MinimumPasswordLength = SiteConfig.PasswordMin.ToInt()
            };

            return View(model);
        }