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