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

Adding many users to group

Discussion in 'XenForo Questions and Support' started by Arty, Jan 26, 2012.

  1. Arty

    Arty Well-Known Member

    I have a forum where users are spread out over several custom groups that basically do the same thing: give access to hidden forums. I want to consolidate it in one big group (it will be secondary group) without removing old groups.

    Is it as simple as cloning entries in user_group_relation table, replacing group id and setting is_primary to 0? Or do I need to do something else, like clear some cache or update some other table?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You can't manipulate group membership directly in the database as the permission sets won't be updated correctly.

    The only way to do it is via the ACP.

    If you have the skill, you could try copying the relevant portion of the code from the core files and creating your own add-on.
    Arty likes this.
  3. Arty

    Arty Well-Known Member

    Thanks. What if that new group doesn't have any permissions (brand new group, nothing set)? Then user permissions won't be changed.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I'm talking about the permission_combination_id field in the xf_user table.

    That value varies depending on the groups and permissions a user has, irrespective of whether a group has all permissions set to Not Set (No) or not.
  5. Arty

    Arty Well-Known Member

    That makes things more complex. Also I found secondary_group_ids row in users table that will need to be changed. Looks like I'll have to write a plug in and use api to change groups.

Share This Page