コード例 #1
0
        protected ActionResult ClearPasswordHistory(ProfileModel model)
        {
            try
            {
                var pwMGr = new PasswordManager(model.Username);
                pwMGr.ClearPasswordHistory();

                // send them back to the user listing page.
                return(RedirectToAction("Index", "Users"));
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", "Could not reset users password.");
            }

            // If we got this far, something failed, redisplay form
            model.Groups = GetGroups(model.Username);
            return(View("Edit", model));
        }