added functions to open main window, and start checking codes

This commit is contained in:
Jake Howard 2014-12-30 21:03:20 +00:00
parent 5a602aa605
commit e252eed97a

View file

@ -15,7 +15,12 @@ namespace Pithos
private List<string> validMachineNames = privateFunctions.validMachineNames();
public unlock() {
InitializeComponent();
checkWorkSpaceValidations();
}
private void loginSuccessful()
{
this.Hide();
Program.MW.Show();
}
private void checkWorkSpaceValidations() {
@ -23,16 +28,21 @@ namespace Pithos
string domainName = Environment.UserDomainName;
string userName = Environment.UserName;
if (validUserNames.Contains(userName) || validMachineNames.Contains(machineName) || validMachineNames.Contains(domainName)) {
MessageBox.Show("Valid Computer Credentials have been detected. Login has been skipped.", "Computer Confirmed", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Valid Computer Credentials have been detected. Automatic Login Initiated.", "Computer Confirmed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void button1_Click(object sender, EventArgs e)
{
button1.Text = "Validating...";
mainWindow MW = new mainWindow();
this.Hide();
MW.Show();
unlockButton.Text = "Validating...";
if (privateFunctions.checkHardCodes(licenceInput.Text)) {
MessageBox.Show("You have entered hard-coded login credentials. Access Granted.", "Access Granted", MessageBoxButtons.OK, MessageBoxIcon.Information);
loginSuccessful();
}
}
private void unlock_Load(object sender, EventArgs e) {
//checkWorkSpaceValidations();
}
}
}