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

auto assign users to usergroups upon registration

Discussion in 'XenForo Questions and Support' started by Vicki, Jun 3, 2013.

  1. Vicki

    Vicki Active Member

    Hi,

    I'd like our site be able to assign each new registrant, based on a custom field value the user chooses, to a specific usergroup as soon as the new registrant completed his or her email confirmation. So if the user chooses value 'A' for that custom field, this user will have to be assigned to a secondary usergroup called 'A'. All the usergroups have been configured already via ACP.

    I am aware of the usergroup promotions feature in XF, but if I understand correctly, it is set to be run once every hour. I need the function that any new registrant be automatically assigned immediately to a specific usergroup once the registration is complete, because there is a specific private node(associated with each usergroup) that I need the user be able to enter as soon as their registration is complete.

    This doesn't sound hard. Can this be done in ACP or template edits? Thanks in advance!
     
    erich37 likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Vicki likes this.
  3. Vicki

    Vicki Active Member

    Thanks Brogan for your quick reply!

    Can you be a little more specific about session creation, in this case? When is exactly the session creation started after the new user completes the registration(comfirmed email)?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I can't confirm it as I am not able to test it yet (don't yet have a copy of 1.2 as it's still too new and in flux) but the assumption is that the promotions will run on registration, once the account has been created.

    So if you have email confirmation enabled it will be prior to that.
     
    Vicki likes this.
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

    Not entirely sure on registration, but as soon as a user logs in (completes registration) a session is created. If you leave a forum for a long period of time and return, you receive a new session.

    Mike may be able to invalidate and recreate a session on email sign up just to run the promotions check. Not sure if that's optimal tho.
     
    Vicki likes this.
  6. Vicki

    Vicki Active Member

    Right, that's what I guessed - the user probably have to re - log in after completing registration... but there are users who might be able to confirm in email very fast while the old signup window still open, then they want to start using forums immediately. I am wondering, at that point, are the users already assigned to the usergroup(if promotions set alright)? If they simply refresh the window, can they get to the forums and see the private node that is associated with the particular usergroup we've configured ahead of time? This is something I'd really like to know.
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    Based on current code (1.1), it most likely would take some time. Not sure how 1.2 handles it, but it may be possible to have an add-on easily created to run your promotions on email verification.
     
    Vicki likes this.
  8. Vicki

    Vicki Active Member

    This is the situation I wish I could have time to learn how to create an easy add-on like this, because the logic is just so simple ... :p

    I'll see if I post an add-on request or not. But thank you all who have replied!!!
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    I would wait until it can be tested in 1.2 before requesting an add-on.
     
    Vicki and Jeremy like this.
  10. Vicki

    Vicki Active Member

    Thanks Brogan for the suggestion!
     

Share This Page