Пример #1
0
        /// <summary>
        /// The login form for the admin site. Will auto redirect if logged in.
        /// </summary>
        /// <returns></returns>
        public ActionResult ChangePassword(ChangePasswordModel model)
        {
            // The user shouldn't be here
            if (UserUtils.CurrentUser == null)
            {
                // log them in
                Response.Redirect("~/Admin");
            }

            // set the user before trying to change the password
            model.SetUser(UserUtils.CurrentUser, db);
            // this will only change the password if someone actually passes the necessary strings
            model.ChangePassword();

            // pass the model
            return(View(model));
        }