Esempio n. 1
0
 public ActionResult ChangePassword(LocalPasswordModel.Password model)
 {
     WLogMembershipProvider provider = new WLogMembershipProvider();
     if (!provider.ChangePassword(User.Identity.Name, model.OldPassword, model.NewPassword))
     {
         UserProfileContext.Current.Refresh();
         ModelState.AddModelError("", "Error");
         RedirectToAction("Manage");
     }
     else
     {
         return RedirectToAction("Index", "Private");
     }
     return View(new LocalPasswordModel());
 }
Esempio n. 2
0
        public ActionResult ChangeEmail(LocalPasswordModel.Email model)
        {
            if (ModelState.IsValid)
            {

                    UserEntity entity = RepositoryContext.Current.Users.GetByUsername(User.Identity.Name);
                    entity.Email = model.address;
                    entity.LastActivityDate = DateTime.Now;
                RepositoryContext.Current.Users.Save(entity);

              UserProfileContext.Current.Refresh();
                return RedirectToAction("Index", "Private");
            }
            else
            {
                ModelState.AddModelError("", "Error");
            }

            return View();
        }
Esempio n. 3
0
 public ActionResult Manage()
 {
     LocalPasswordModel model = new LocalPasswordModel();
     model.email.address = UserProfileContext.Current.User.Email;
     return View(model);
 }