public ActionResult RegBlockPartnerPasswordPartial(SavePassModel model) { if (model.Password.IsNullOrEmpty() || model.Password.Length < 6) { model.Message = "Длина пароля должна быть не менее 6 символов"; } if (model.PasswordAgain.IsNullOrEmpty() || model.Password != model.PasswordAgain) { model.Message = "Пароли не совпадают"; } if (model.Message.IsFilled()) { return(PartialView(model)); } WebSecurity.ResetPassword(WebSecurity.GeneratePasswordResetToken(CurrentUser.Name), model.Password); var u = DB.Users.First(x => x.ID == CurrentUser.ID); u.RegStep = null; DB.SubmitChanges(); Logger.WriteEvent(Logger.EventType.UserChangePass, "Изменение пароля", CurrentUser.ID); model.RedirectURL = Url.Action("Index", "Home"); return(PartialView(model)); }
public ActionResult RegBlockPartnerPasswordPartial() { var model = new SavePassModel() { DigitID = CurrentUser.DigitID }; return(PartialView(model)); }