public ActionResult PasswordRecoverySend(PasswordRecoveryModel model) { if (ModelState.IsValid) { var user = userService.GetByUsername(model.UserName); if (user != null && user.CurrentPublishingStatus == PublishingStatus.Active) { var passwordRecoveryToken = Guid.NewGuid(); attributeService.SaveAttribute(user, SystemUserAttributeNames.PasswordRecoveryToken, passwordRecoveryToken.ToString()); messageService.SendUserPasswordRecoveryMessage(user, workContext.WorkingLanguage.RowId); SuccessNotification("Email with instructions to reset your password has been sent to you."); return RedirectToRoute(SystemRouteNames.Login); } else ErrorNotification("The specified user does not exists"); return View(model); } //If we got this far, something failed, redisplay form return View(model); }
public ActionResult PasswordRecovery() { var model = new PasswordRecoveryModel(); return View(model); }