Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2009, 09:48 AM
Largo .//npc Largo .//npc is offline
 
Join Date: May 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Ban user on registration is string matches?

This is the first time I've coded anything for vB. I can do SMF easily, but vB is a bit more complex imo.

So anyway, I want to ban a user if a certain string is in a custom user field.

I'd like to have the user banned right away. How would I go about doing this?

I don't want to simply stop them registering, I want to let them register and ban them instantly.

I was going to use a cron job for this, but it wouldn't work out.

The reason for this is that Spammers keep registering on our site and leaving a certain drop down box on it's default setting, so we added a new default value for that drop down box and the spammers are now using that where-as anyone registering who SHOULD be on the site uses the correct selection.

These spammers are not bots. We have plenty of bot protection. I've noticed they're mainly form china. A good way would be to ban all Chinese addresses but we do have a chinese member and may get more.

Essentially, I need something like:

if (field7 == "String")
ban_user($userid)

but obviously changed to work with vB and to run when the user registers their account.

Cheers
Reply With Quote
  #2  
Old 12-01-2009, 12:38 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone asked something similar a while back - I think you could create a plugin using the hook location 'register_addmember_process', and make the code

PHP Code:
if (user should be banned)
{
   
$userdata->set('usergroupid'8);  


The call for that hook is in register.php around line 385. You can probably look at the code in there to figure out what the condition should be.

(BTW, why is the thread title 'Database Queries'?)
Reply With Quote
  #3  
Old 12-01-2009, 03:15 PM
Largo .//npc Largo .//npc is offline
 
Join Date: May 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll take a look at that later then. Thanks

as for the topic title. I was going to ask something else but figured it out myself and got stuck again but forgot to change the title. Tried to edit it but couldn't on my iPod so will try later when I get to a proper machine.
Reply With Quote
  #4  
Old 12-03-2009, 01:49 PM
ckgreenman ckgreenman is offline
 
Join Date: Feb 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Largo. Please let us know if you make any headway on this. I for one would be GREATLY interested in such a hack. I'm constantly getting spammers who log in and post URLs in various profile fields.

I was originally looking for a method of denying URLs in those using a regular expression but so far I haven't been able to figure that one out.
Reply With Quote
Reply


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 03:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03790 seconds
  • Memory Usage 2,184KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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