예제 #1
0
    protected void btnChange_Click(object sender, EventArgs e)
    {
        ///changes the current password
        ///if there is no temp passsword supplied then treat it as a typical user
        ///wanting to change their password
        ///if there is a temp password then treat it as a user who
        ///has forgotten their password

        //var to store any errors
        string Error;

        //if there is no temp password
        if (TempPW == null)
        {
            //change the password as a typical user
            Error = Sec.ChangePassword(Sec.UserEMail, txtCurrentPassword.Text, txtPassword1.Text, txtPassword2.Text);
        }
        else
        {
            //change the password based on a forgotten password
            Error = Sec.ChangePasswordWithTempPW(EMail, TempPW, txtPassword1.Text, txtPassword2.Text);
        }
        //display any errors
        lblError.Text = Error;
    }
예제 #2
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            //change the password and record the outcome
            string Outcome = mSec.ChangePassword(txtEMail.Text, txtPassword.Text, txtPassword1.Text, txtPassword2.Text);

            //display the outcome
            lblError.Text = Outcome;
        }