Exemplo n.º 1
0
    //----------------------------------------------------------------------------------------------------------------------------------------------//

    public void CheckRegister()
    {
        if (registerUsername.text.Length >= 6 && registerEmail.text.Length >= 6 && registerPassword.text.Length >= 6 && registerConfirm.text.Length >= 6 && registerPassword.text == registerConfirm.text && registerPin.text.Length == 4 && registerPinConfirm.text.Length == 4 && registerPin.text == registerPinConfirm.text)
        {
            string email    = registerEmail.text;
            string password = registerPassword.text;
            auth.CreateUser(email, password);
        }
    }
Exemplo n.º 2
0
    //----------------------------------------------------------------------------------------------------------------------------------------------//
    // Runs the CreateUser() function on the auth script when a button is pressed. Inputs the register email and password.

    public void CreateUser()
    {
        authEvents.AlertBoxOn(true);

        if (registerUsername.text.Length >= 6 && registerEmail.text != "" && registerPassword.text.Length >= 6 && registerConfirm.text != "" && registerPassword.text == registerConfirm.text && registerPin.text.Length >= 6 && registerPinConfirm.text != "" && registerPin.text == registerPinConfirm.text)
        {
            string email    = registerEmail.text;
            string password = registerPassword.text;
            auth.CreateUser(email, password);

            authEvents.AlertBoxState("Success!");
        }
        else
        {
            authEvents.AlertBoxState("Warning!");

            if (registerUsername.text == "")
            {
                authEvents.Message("Username field is empty...");
            }
            else
            {
                if (registerEmail.text == "")
                {
                    authEvents.Message("Email field is empty...");
                }
                else
                {
                    if (registerPassword.text == "")
                    {
                        authEvents.Message("Password field is empty...");
                    }
                    else
                    {
                        if (registerConfirm.text == "")
                        {
                            authEvents.Message("Confirm password field is empty...");
                        }
                        else
                        {
                            if (registerPassword.text != registerConfirm.text)
                            {
                                authEvents.Message("Confirm password does not match...");
                            }
                            else
                            {
                                if (registerPin.text == "")
                                {
                                    authEvents.Message("PIN Number field is empty...");
                                }
                                else
                                {
                                    if (registerPinConfirm.text == "")
                                    {
                                        authEvents.Message("Confirm PIN Number field is empty...");
                                    }
                                    else
                                    {
                                        if (registerPin.text != registerPinConfirm.text)
                                        {
                                            authEvents.Message("Confirm PIN Number does not match...");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }