vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Code to change usergroup at registration (https://vborg.vbsupport.ru/showthread.php?t=194932)

kirstyd 10-29-2008 03:29 PM

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;
but it's having no effect.

Can anyone help me out with the correct line of code please?

thanks
kirsty

Jinovich 10-29-2008 05:22 PM

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.

kirstyd 10-29-2008 07:06 PM

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

Lynne 10-29-2008 07:19 PM

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.

noppid 10-29-2008 07:26 PM

$userdata->set('usergroupid', 4); on hook register_addmember_process

Of course wrap it in your conditions.

Marco van Herwaarden 10-30-2008 08:19 AM

What is your condition to place the new user in 1 or the other usergroup?

kirstyd 10-30-2008 09:45 AM

Quote:

Originally Posted by noppid (Post 1655557)
$userdata->set('usergroupid', 4); on hook register_addmember_process

Of course wrap it in your conditions.

Fabulous! That's just what I needed. Thanks to everyone for their help.

Quote:

What is your condition to place the new user in 1 or the other usergroup?
At the moment I'm just trapping persistently annoying but not very cunning trolls by their IP address range ($userdata->user[ipaddress]). I don't want to ban them outright because I'm likely to pick up non-troll users using the same IP address range, I just want an easy way of knowing they are about so the moderators can monitor them.

thanks
kirsty


All times are GMT. The time now is 07:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00972 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete