コード例 #1
0
ファイル: CPW.aspx.cs プロジェクト: bfair370/ivote-teama
    protected void submission(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            //check old password
            iVoteLoginProvider logger = new iVoteLoginProvider();
            databaseLogic dblogic = new databaseLogic();

            bool pw_correct = logger.ValidateUser(HttpContext.Current.User.Identity.Name.ToString(), oldPW.Text);
            if (pw_correct)
            {
                lblConfirm.Text = "Your password has been successfully changed.";
                string e_pw = logger.encrypt(newPW.Text);
                dblogic.updatePassword2(HttpContext.Current.User.Identity.Name.ToString(), e_pw);

            }
            else
                lblConfirm.Text = "Old password is incorrect.";
            //decrypt password fromt his
            //lblConfirm.Text = "Form in progress.";
            //change form state
            lblForm.Visible = false;
            //lblConfirm.Text = "Thank you.  Your password has been changed.";
        }
    }
コード例 #2
0
ファイル: confirm.aspx.cs プロジェクト: ji2886/ivote-teama
    protected void ButtonSave_Clicked(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            iVoteLoginProvider encryptionHelper = new iVoteLoginProvider();

            dbLogic.updatePassword(HiddenFieldPassword.Value, encryptionHelper.encrypt(TextBoxPassword.Text)); //inserts new encrypted password
            dbLogic.deleteCode(fullCode); //deletes code row from database

            //Make form invisible
            lblForm.Visible = false;
            //display confirmation message
            lblConfirm.Visible = true;

        }
    }