Пример #1
0
        protected void UpdateButtonClick(object sender, CommandEventArgs e)
        {
            if (Request.Form["UserPassword"] != null && !Request.Form["UserPassword"].Equals("") && Request.Form["SelectSubmitted"].Equals("false"))
            {
                //update password
                if (ValidateUserPassword(Request.Form["UserPassword"]))
                {
                    int    userId = int.Parse(Request.Form["SelectUserName"]);
                    string pswd   = Request.Form["UserPassword"];

                    string hashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(pswd, "MD5");
                    Caisis.Security.SecurityController sc = new Caisis.Security.SecurityController();
                    UserDa da = new UserDa();
                    da.UpdateUserPassword(userId, hashedPassword, sc.GetUserName());
                    // no need to email user if using ldap
                    if (UseLDAP)
                    {
                        valMsg.Text = "User Password has been updated.<br /> <a href=\"AdminUpdatePassword.aspx\">Update Another User?</a>";
                    }
                    else
                    {
                        valMsg.Text = "User Password has been updated. Would like to email it to them? <a href=\"AdminEmailUser.aspx?userId=" + userId + "&pswd=" + pswd + "\">Yes</a>&nbsp;&nbsp;&nbsp;<a href=\"AdminUpdatePassword.aspx\">No</a>";
                    }
                }
            }
        }