public ActionResult Facebook() { var viewModel = new ChangePasswordModel(); viewModel.Session = Session; return View(viewModel); }
public ActionResult ChangePassword(ChangePasswordModel model) { if (Session.User != null) { if (ModelState.IsValid) if (userModule.ChangePassword(model.OldPassword.HashString(), model.NewPassword.HashString(), Session.User.Id)) return RedirectToAction("ChangePasswordSuccess"); else ModelState.AddModelError("", "Current password is not valid! Please enter a valid current password."); // If we got this far, something failed, redisplay form ViewData["PasswordLength"] = AccountService.MinPasswordLength; model.Session = Session; return View(model); } else { return Redirect(Url.Logon(), true); } }