Beispiel #1
0
        public ActionResult BlockUnblock(UserModel model)
        {
            if (ModelState.IsValid)
            {
                MembershipUser user = Membership.GetUser(model.UserName);
                user.IsApproved = !user.IsApproved;
                Membership.UpdateUser(user);
                this._rankingService.UpdateRanking();
                return RedirectToAction("Index");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
Beispiel #2
0
        public ActionResult ResetPassword(UserModel model)
        {
            if (ModelState.IsValid)
            {
                MembershipUser user = Membership.GetUser(model.UserName);
                if (user.IsLockedOut)
                {
                    user.UnlockUser();
                }
                var generatedPass = user.ResetPassword();
                user.ChangePassword(generatedPass, DefaultPassword);

                return RedirectToAction("Index");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }