Exemple #1
0
        private void usernameOK_Click(object sender, EventArgs e)
        {
            this.Hide();

            try
            {
                userDN = GetUserDn(usernameText.Text);

                String message = checkPasswordExpire(usernameText.Text);

                InfoWindow showExpireInfo = new InfoWindow();
                showExpireInfo.status            = 1;
                showExpireInfo.Text              = "Password Expiration for " + usernameText.Text;
                showExpireInfo.messageLabel.Text = message;
                showExpireInfo.Show();
                uName = this.usernameText.Text;
                this.usernameText.Clear();
            }
            catch (InvalidUserException ex)
            {
                InfoWindow exception = new InfoWindow();
                exception.status = -50;
                exception.updateInfo("Something went wrong. The error thrown by the application was: " + ex.Message + "\nPlease try again", "OK", "OK");
                exception.info_OK.Hide();
                exception.Show();
            }

            this.usernameText.Clear();
        }
Exemple #2
0
        private void move_fix_button_Click(object sender, EventArgs e)
        {
            // This moves the computer from Campus Computers to the OU without EDUROAM GPO applied to fix connection
            String pc_name = computer_name.Text;

            if (String.IsNullOrEmpty(pc_name))
            {
                InfoWindow error = new InfoWindow();
                error.updateInfo("Invalid or empty computer name provided.", "OK", "OK");
                error.status = -50;
                error.info_OK.Hide();
                error.Show();
            }
            else
            {
                try
                {
                    DirectoryEntry theObjectToMove = new DirectoryEntry("LDAP://CN=" + pc_name + ",OU=Campus Computers,OU=WIT Computers,DC=wit,DC=private");
                    DirectoryEntry theNewParent    = new DirectoryEntry("LDAP://OU=eduroamfix,OU=Campus Computers,OU=WIT Computers,dc=wit,dc=private");
                    theObjectToMove.MoveTo(theNewParent);
                    InfoWindow success = new InfoWindow();
                    success.updateInfo("Object " + pc_name + " moved to the eduroamfix OU.\nPlease wait a minute and then proceed with the fix.");
                    success.info_OK.Hide();
                    success.Show();
                }
                catch
                {
                    InfoWindow error = new InfoWindow();
                    error.updateInfo("Something went wrong. Try again, and if this message still appears, contact Neil Hanlon.\nOften, this can mean that the user is already in the OU!\nCheck that you're pressing the right button!", "OK", "OK");
                    error.status = -50;
                    error.info_OK.Hide();
                    error.Show();
                }
            }
        }
Exemple #3
0
        private void label1_Click_1(object sender, EventArgs e)
        {
            TelnetConnection tc = new TelnetConnection("towel.blinkenlights.nl", 666);

            String[] result = tc.Read().Split('\r');
            int      count  = 0;

            foreach (String r in result)
            {
                count++;
            }
            // Console.WriteLine(result[count-3]);
            tc.WriteLine("exit");
            InfoWindow excuse = new InfoWindow();

            excuse.BringToFront();
            excuse.Text = "Excuse";
            excuse.updateInfo(result[count - 3], "asdf", "OK");
            excuse.info_OK.Hide();
            excuse.Show();
            excuse.Focus();
        }
Exemple #4
0
        private void usernameOK_Click(object sender, EventArgs e)
        {
            this.Hide();
            usernameText.Focus();

            if (status_code == 1)
            {
                try
                {
                    String message = resetPass.checkPasswordExpire(usernameText.Text);
                    try
                    {
                        infoWindow.updateInfo(message, "OK", "OK");
                        infoWindow.info_OK.Hide();
                        infoWindow.Show();
                    }
                    catch
                    {
                        InfoWindow infoWindow = new InfoWindow();
                        infoWindow.Hide();
                        infoWindow.updateInfo(message, "OK", "OK");
                        infoWindow.info_OK.Hide();
                        infoWindow.Show();
                    }
                }
                catch (InvalidUserException ex)
                {
                    InfoWindow exception = new InfoWindow();
                    exception.status = -50;
                    exception.updateInfo("Something went wrong. The error thrown by the application was: " + ex.Message + "\nPlease try again", "OK", "OK");
                    exception.info_OK.Hide();
                    exception.Show();
                }

                this.usernameText.Text = "";
                usernameText.Focus();
                return;
            }
            if (status_code == 2)
            {
                try
                {
                    String message = resetPass.getPassExpire(usernameText.Text);
                    try
                    {
                        infoWindow.updateInfo(message, "OK", "OK");
                        infoWindow.info_OK.Hide();
                        infoWindow.Show();
                    }
                    catch
                    {
                        InfoWindow infoWindow = new InfoWindow();
                        infoWindow.Hide();
                        infoWindow.updateInfo(message, "OK", "OK");
                        infoWindow.info_OK.Hide();
                        infoWindow.Show();
                    }
                    this.usernameText.Text = "";
                    usernameText.Focus();
                    return;
                }
                catch (InvalidUserException ex)
                {
                    InfoWindow exception = new InfoWindow();
                    exception.status = -50;
                    exception.updateInfo("Something went wrong. The error thrown by the application was: " + ex.Message + "\nPlease try again", "OK", "OK");
                    exception.info_OK.Hide();
                    exception.Show();
                }
            }
            this.usernameText.Text = "";
            usernameText.Focus();
        }