Rev 53 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SWAT_Office_App
{
public partial class ResetUserPassword_Form : Form
{
private string selectedUsername;
public ResetUserPassword_Form(string selectedUser)
{
selectedUsername = selectedUser;
InitializeComponent();
this.txt_Password1.Focus();
this.lbl_Prompt2.Visible = false;
// Monitors the text in each textbox, triggering changes when certain criteria is met
this.txt_Password1.TextChanged += new EventHandler(this.txt_Box1_TextChanged);
this.txt_Password2.TextChanged += new EventHandler(this.txt_Box2_TextChanged);
}
private void txt_Box1_TextChanged(object sender, EventArgs e)
{
// Office password is set here
if (txt_Password1.Text == "tr33b3@rd")
{
this.txt_Password1.Visible = false;
this.txt_Password2.Visible = true;
this.lbl_Prompt1.Visible = false;
this.lbl_Prompt2.Visible = true;
this.txt_Password2.Focus();
}
}
private void txt_Box2_TextChanged(object sender, EventArgs e)
{
TextBox tb = (TextBox)sender;
if (tb.Text.Length == 0)
this.btn_Ok.Enabled = false;
else
this.btn_Ok.Enabled = true;
}
private void btn_Cancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void btn_Ok_Click(object sender, EventArgs e)
{
ManageUserAccounts.ChangeUserPassword(selectedUsername, txt_Password2.Text);
this.Close();
}
}
}