Beispiel #1
0
    /// <summary>
    /// Registers the new user.
    /// </summary>
    static void RegisterNewUser()
    {
        if (username.Length < 1 || password.Length < 1 || email.Length < 1)
        {
            LumosSocialGUI.statusMessage = "Please fill in all the fields.";
            return;
        }

        if (password != passwordConfirmation)
        {
            LumosSocialGUI.statusMessage = "Please supply matching passwords.";
            return;
        }

        LumosSocialGUI.inProgress    = true;
        LumosSocialGUI.statusMessage = "Registering...";
        var user = new LumosUser(username, password);

        user.email = email;

        LumosSocial.RegisterUser(user,
                                 success => {
            LumosSocialGUI.inProgress = false;

            if (success)
            {
                LumosSocialGUI.statusMessage = null;
                LumosSocialGUI.HideWindow();
            }
            else
            {
                LumosSocialGUI.statusMessage = "There was a problem registering. Please try again.";
            }
        });
    }
Beispiel #2
0
    /// <summary>
    /// Submits the username and password.
    /// </summary>
    static void SubmitLoginCredentials()
    {
        if (username.Length < 1)
        {
            LumosSocialGUI.statusMessage = "Please enter a username.";
            return;
        }

        if (password.Length < 1)
        {
            LumosSocialGUI.statusMessage = "Please enter a password.";
            return;
        }

        LumosSocialGUI.inProgress    = true;
        LumosSocialGUI.statusMessage = "Logging in...";
        var user = new LumosUser(username, password);

        Social.Active.Authenticate(user,
                                   success => {
            LumosSocialGUI.inProgress = false;

            if (success)
            {
                LumosSocialGUI.HideWindow();
                LumosSocialGUI.statusMessage = null;
            }
            else
            {
                LumosSocialGUI.statusMessage = "There was a problem signing in. Perhaps your username and password do not match.";
            }
        });
    }