auto assign users to usergroups upon registration

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!
 
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)?
 
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.
 
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.
 
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.

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.
 
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.

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.
 
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!!!
 
Top Bottom