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

Changing the default usergroup?

Discussion in 'XenForo Questions and Support' started by Jake Hakoda Shirley, Apr 27, 2011.

  1. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Hey guys, I really want to change the default usergroup from the default "member". Is there currently a way to do that in the Admin CP?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Is there any particular reason you want to change the default user group?

    Can't you rename the default Registered group and create a new one for your requirements?
     
  3. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Because I already have a lump of people in the default usergroup, and instead of changing all of their groups to a new one, I was just going to make the new registrations a different one.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Unfortunately I am using the user_group_id column to control access to a Minecraft server I run, so I have been changing people's groups to which ever they are. Should I be using secondary_group_ids instead?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You should respect the roles of the default groups. They are hard-coded and changing them will cause problems in the future.

    See this post:

    http://xenforo.com/community/thread...group-for-new-registrations.8022/#post-111413

    Do you want to set different permissions for the existing users? Why do you want to separate existing users from new users? Maybe there is another solution.

    Currently there is no "mass move" utility in the control panel so you would have to change each user individually.
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    How is that setup? Is the server info posted in a private forum? A secondary group will work well if you just need to restrict access to an area of the forum.
     
  9. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    So I want people to be able to register, but NOT access my Minecraft Server (Which queries a list of eligible people based off of their main user group). It looks like I will want to make it so it queries the secondary user group, since the primary should (always?) be set to the default group.
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can use this query to select from the list of secondary_group_ids:

    Code:
    SELECT *
    FROM xf_user
    WHERE FIND_IN_SET(2, secondary_group_ids)
    
    Or if you want to cover both the primary and secondary groups:

    Code:
    SELECT *
    FROM xf_user
    WHERE FIND_IN_SET(2, secondary_group_ids)
    OR user_group_id = 2
    
     
    Brogan likes this.
  11. ragtek

    ragtek Guest

    IMHO it wouldn't be hard to change it.
    It's only 1x in the xenforo code.

    xenforo model user
    PHP:
    public static $defaultRegisteredGroupId 2;

    //can be called with:
    XenForo_Model_User::$defaultRegisteredGroupId
     

Share This Page