Exemple #1
0
        private Message makeNewAccount()
        {
            Message m = HNHWebServer.doJSONPost <Message>("create-user.php", "name=" + fname.Text + " " +
                                                          lname.Text + "&username="******"&password="******"&email=" + email.Text);

            return(m);
        }
Exemple #2
0
        private bool verifyInfo()
        {
            if (fname.Text == "" || lname.Text == "")
            {
                MessageBox.Show("You must have a first and Last Name!");
                return(false);
            }

            if (user.Text == "")
            {
                MessageBox.Show("You must have a username!");
                return(false);
            }
            if (user.Text.Length < 3)
            {
                MessageBox.Show("Your username must contain atleast 3 character!");
                return(false);
            }
            if (user.Text.Contains(" "))
            {
                MessageBox.Show("Your username can not contain spaces as a character!");
                return(false);
            }
            if (email.Text.Contains(" ") || !email.Text.Contains("@") || !email.Text.Contains("."))
            {
                MessageBox.Show("Invalid email address!");
                return(false);
            }
            if (pass1.Text.Length < 7)
            {
                MessageBox.Show("Your pasword must contain atleast 7 character!");
                return(false);
            }

            if (!pass1.Text.Equals(pass2.Text))
            {
                MessageBox.Show("Passwords does not match!");
                return(false);
            }
            Message m = HNHWebServer.doJSONPost <Message>("check-user-availability.php", "name=" + user.Text);

            if (!m.message.Equals("false"))
            {
                MessageBox.Show("Username already taken!");
                return(false);
            }
            m = HNHWebServer.doJSONPost <Message>("check-email-availability.php", "email=" + email.Text);
            Console.WriteLine(m.message);
            Console.WriteLine(m.type);
            if (!m.message.Equals("false"))
            {
                MessageBox.Show("Email already taken!");
                return(false);
            }

            return(true);
        }
Exemple #3
0
        private void signin_Click(object sender, EventArgs e)
        {
            Message m = HNHWebServer.doJSONPost <Message>("validate-login.php", "username="******"&password="******"true"))
            {
                this.Hide();
                User mainUser = HNHWebServer.doJSONPost <User>("get-user.php", "username="******"&password="******"Invalide Username or Password!");
            }
        }