PDA

View Full Version : Re-setting $userdata->set('usergroupid', $newusergroupid);


woostar
11-12-2009, 12:19 PM
I haven't got an testing board at the moment so can't test this.

Question:
In register.php can you re-set
$userdata->set('usergroupid', $newusergroupid);
to
$userdata->set('usergroupid', 8);
using hook:
register_addmember_process

even though it is set before the hook (but not saved)?

TIA :)

kh99
11-13-2009, 11:58 AM
Well it looks like it should work, I tried it and it creates a banned user, but I can't say for sure if everything will work as it should.

Lynne
11-13-2009, 02:44 PM
Wouldn't that put all new users into the banned usergroup? Is that what you are trying to do?

If the variable isn't saved yet, you should be able to overwrite the set like you have written.

woostar
11-13-2009, 03:48 PM
Thanks :)

Wouldn't that put all new users into the banned usergroup? Is that what you are trying to do?

If the variable isn't saved yet, you should be able to overwrite the set like you have written.

Yes, I'm going to wrap it in a condition (antispam measure) :)