1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

User and user groups

Discussion in 'XenForo Development Discussions' started by Helmut2509, Dec 18, 2013.

  1. Helmut2509

    Helmut2509 Member

    Is there an easy way - from the administrators view - to find out all user groups attached to a certain user? Do I have to fetch these data from secondary_group_ids in xf_user or from the table xf_user_group_relations?
    And when the administrator wants to attach a new user group to a user, which of those tables has to be updated and how?
    Is it also possible to get all users attached to a certain user group?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    View the member's profile in the ACP - the primary and secondary groups are shown (checked).

    Do a user search against a user group to return all members.
    Main Company likes this.
  3. Helmut2509

    Helmut2509 Member

    sorry, I was not clear enough. I mean not on the GUI, but programmatically with PHP.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Moved to dev discussions.
  5. tyteen4a03

    tyteen4a03 Well-Known Member

    xf_users contain the user group information of the user.
  6. Daniel Hood

    Daniel Hood Well-Known Member

    Look in the library/xenforo/model/user.php file. You want to avoid adding and removing users from groups with a simple query because of the way users are cached. You can also see some useful functions for getting users based on their group.
  7. Main Company

    Main Company Active Member

    Aha! Thank you.

    I couldn't figure this out, and I knew there had to be an easy way. Doh.

Share This Page