Exemplo n.º 1
0
 public ActionResult Facebook()
 {
     var viewModel = new ChangePasswordModel();
     viewModel.Session = Session;
     return View(viewModel);
 }
Exemplo n.º 2
0
        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);
            }
        }