The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Code to change usergroup at registration
I'm wanting to put users who meet certain conditions when they register into the moderated user group so we can check them before letting them in. I've added a plugin at the register_addmember_complete hook which identifies the prospective users just fine, but I can't figure out the right bit of code to get them put into the moderated user group (which is group id 4).
I'm trying: Code:
$userdata->user[usergroupid]=4; Can anyone help me out with the correct line of code please? thanks kirsty |
#2
|
|||
|
|||
Easiest way to do this would be to go to vbulletin options --> User registration -> moderate new users.
This way it will add users in to "Coppa users awaiting moderation" usergroup. Whatever your trying to achieve I am certain you could do without plugins or hacks. |
#3
|
|||
|
|||
That would put all my new users into moderation though, there are only a handful of rogues I want to catch with this.
thanks kirsty |
#4
|
||||
|
||||
I've never really played with the registration process, but looking at the code, I'm wondering if you are picking a hook location that is after the userdata save process. Have you tried using the hook "register_addmember_process"? It looks like the save occurs after that one but before the one you picked. In fact, look at line 359, that is where the usergroupid is set. You may just need to just make a userdate->set call like that one at the hook location I suggested.
|
#5
|
|||
|
|||
$userdata->set('usergroupid', 4); on hook register_addmember_process
Of course wrap it in your conditions. |
#6
|
|||
|
|||
What is your condition to place the new user in 1 or the other usergroup?
|
#7
|
|||
|
|||
Quote:
Quote:
thanks kirsty |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|