Exemple #1
0
        public ActionResult ResetPassword(ResetPasswordModel model)
        {
            if (ModelState.IsValid)
              {
            //change password to the new value
            var repository = GetAccountHelperRepository();
            var user = ForgettPasswordHelper.ValidatePasswordResetKeyGetUserID(model.ResetKey, repository);
            string tmpPassword = user.ResetPassword();
            user.ChangePassword(tmpPassword, model.NewPassword);

            //remove the password reset key
            ForgettPasswordHelper.RemoveResetKey(model.ResetKey, repository);
              }
              else
              {
            model.NewPassword = string.Empty;
            model.PasswordConfirmation = string.Empty;
            return View(model);
              }

              return View("ResetPasswordSuccess");
        }
Exemple #2
0
        public ActionResult ResetPassword(Guid resetKey)
        {
            try
              {
            var user = ForgettPasswordHelper.ValidatePasswordResetKeyGetUserID(resetKey, GetAccountHelperRepository());
              }
              catch (ArgumentException ex)
              {
            throw ex;
              }

              ResetPasswordModel model = new ResetPasswordModel()
              {
            ResetKey = resetKey
              };

              return PartialView(model);
        }