Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 10-29-2008, 03:29 PM
kirstyd kirstyd is offline
 
Join Date: Aug 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 10-29-2008, 05:22 PM
Jinovich Jinovich is offline
 
Join Date: Mar 2005
Location: England
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-29-2008, 07:06 PM
kirstyd kirstyd is offline
 
Join Date: Aug 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 10-29-2008, 07:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 10-29-2008, 07:26 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Of course wrap it in your conditions.
Reply With Quote
  #6  
Old 10-30-2008, 08:19 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is your condition to place the new user in 1 or the other usergroup?
Reply With Quote
  #7  
Old 10-30-2008, 09:45 AM
kirstyd kirstyd is offline
 
Join Date: Aug 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noppid View Post
$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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:03 PM.


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.04015 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete