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

Changing usergroup at registration

Discussion in 'XenForo Development Discussions' started by shawn, Feb 2, 2012.

  1. shawn

    shawn Well-Known Member

    Does anyone know how you'd do this in XF? With another forum software, there was a hook after the user responded to the email confirmation, and I split off there, did a query, changed the usergroup based on the query results.

    I'm not really sure where to start with something like this in XF.
     
  2. steel_curtain

    steel_curtain Well-Known Member

    Do you mean add new members to a secondary usergroup? If so...

    Create a new user group, and then create a new user group promotion for the newly created group. For the user group promotion select apply this promotion when user state is valid under the privileges and status area.
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    To follow on from the previous post, the permissions system has been designed to work with all members being in the Registered user group as the primary.

    What are you trying to do exactly, and why?
     
  4. shawn

    shawn Well-Known Member

    No, I'm trying to change the primary usergroup at registration for some users.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  6. shawn

    shawn Well-Known Member

    Getting closer...

    I looked into the user promotion suggestion. Two small issues w/that. My existing vB database is sort of the inverse of that, so it would take more work to shuffle the permissions around. There's also no user promotion for DOB.

    What I have now is a query that checks to see if a user is under 18 years old based on their registration DOB. If they are, it changes their primary usergroup. Then I've got a cron job that runs after midnight, looking for anyone in the <18 group that has just had a birthday and moving them to the regular registered usergroup.

    The cron script is easy. I don't know how/where to interface with xf to change the usergroup in the first place.
     

Share This Page