Esempio n. 1
0
    /// <summary>
    /// Creates a new team memeber
    /// </summary>
    public void CreateMember()
    {
        User result = null;

        if (UserObject.password == string.Empty)
        {
            result = new User();
            Enjin.InviteUser(UserObject.email, UserObject.name);
        }
        else
        {
            result = Enjin.CreateUser(UserObject.name, UserObject.email, UserObject.password, RolesList[RoleDropDownSelection].name);
        }

        if (result != null && Enjin.ServerResponse == ResponseCodes.SUCCESS)
        {
            if (UserObject.password == string.Empty)
            {
                EnjinEditor.DisplayDialog("SUCCESS", "User " + UserObject.name + " successfully created and invite sent.");
            }
            else
            {
                EnjinEditor.DisplayDialog("SUCCESS", "User " + UserObject.name + " successfully created.");
            }

            EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADTEAM);
            EnjinEditor.ExecuteMethod(EnjinEditor.CallMethod.RELOADIDENTITIES);
            SetTeamState(TeamState.VIEWLIST);
        }
        else
        {
            EnjinEditor.DisplayDialog("FAILED", "Eamil address: " + UserObject.email + " has already been registered. Please enter a different email address");
        }
    }
Esempio n. 2
0
    // Register the user as a new player on this app.
    public void Register()
    {
        string email = registrationEmail.text;

        Enjin.InviteUser(email);
        if (Enjin.ServerResponse != ResponseCodes.SUCCESS)
        {
            SetStatus("Failed to send registration email; check your logs.", true);
        }
        else
        {
            ShowPanel(proceedToLoginPanel);
        }
    }
Esempio n. 3
0
    public void DrawInviteUserPanel(TeamController controller, GUISkin skin)
    {
        GUILayout.BeginArea(new Rect(5, 126, 912, 490), skin.GetStyle("TopBackground"));
        GUILayout.Space(10);
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField(new GUIContent("INVITE USER"), skin.GetStyle("MainTitle"));
        EditorGUILayout.EndHorizontal();
        GUILayout.Space(20);

        GUILayout.BeginHorizontal();
        GUILayout.Space(16);
        GUILayout.BeginVertical();
        EditorGUILayout.LabelField(new GUIContent("EMAIL ADDRESS"), skin.GetStyle("Subtitle"));
        _email = EditorGUILayout.TextField(_email, skin.textField, GUILayout.Width(360), GUILayout.Height(30));
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("SEND INVITE", GUILayout.Width(100), GUILayout.Height(30)))
        {
            Enjin.InviteUser(_email, "");
        }

        if (GUILayout.Button("BACK", GUILayout.Width(100), GUILayout.Height(30)))
        {
            controller.SetTeamState(EnjinEditorPanel.TeamState.VIEWLIST);
            _email = string.Empty;
            controller.SetTeamState(EnjinEditorPanel.TeamState.VIEWLIST);
        }

        GUILayout.Space(16);
        GUILayout.EndHorizontal();
        GUILayout.Space(10);
        GUILayout.EndArea();
    }