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 02-13-2012, 12:32 AM
JennyKhoo JennyKhoo is offline
 
Join Date: Jan 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Code for checking if user registration fields have been filled

Hi

I have removed most of the user registration fields and now want to check if fields not displayed are being filled in by spambots. In particular, I want to check if the 'homepage' field has been filled in and then discontinue the registration procedure.

I have tried the following but it is not working -

if ($_POST['homepage'] > ''){
exit();
}

I have put this in register.php after this code >

// ############################### start add member ###############################
if ($_POST['do'] == 'addmember')
{
$vbulletin->input->clean_array_gpc('p', array(
'options' => TYPE_ARRAY_BOOL,
'username' => TYPE_STR,
'email' => TYPE_STR,
'emailconfirm' => TYPE_STR,
'parentemail' => TYPE_STR,
'password' => TYPE_STR,
'password_md5' => TYPE_STR,
'passwordconfirm' => TYPE_STR,
'passwordconfirm_md5' => TYPE_STR,
'referrername' => TYPE_NOHTML,
'imagestamp' => TYPE_STR,
'imagehash' => TYPE_STR,
'coppauser' => TYPE_BOOL,
'day' => TYPE_UINT,
'month' => TYPE_UINT,
'year' => TYPE_UINT,
'timezoneoffset' => TYPE_NUM,
'dst' => TYPE_UINT,
'userfield' => TYPE_ARRAY,
'showbirthday' => TYPE_UINT,
));

Can anyone suggest some simple code to check whether 'homepage' has been entered and where to put this code in register.php?

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

You could try:

Code:
if ($_POST['homepage'] != ''){
exit();
}
Reply With Quote
  #3  
Old 02-16-2012, 09:08 AM
JennyKhoo JennyKhoo is offline
 
Join Date: Jan 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks I tried what you suggested but that didn't work as well I think the problem might be maybe I should do the check somewhere else? Do you have any suggestion where I can do this check? Or do you think it is the correct place and the correct code? Maybe it needs different code. Thanks again.
Reply With Quote
  #4  
Old 02-16-2012, 12:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On my test site 'homepage' isn't something that's asked for on the registration page, so you can't check for it before the registration is complete. I think the best you could do is to check in profile.php and ban or delete the user at that point. (But maybe I'm missing some option that puts it on the registration page?)
Reply With Quote
  #5  
Old 02-29-2012, 12:52 AM
JennyKhoo JennyKhoo is offline
 
Join Date: Jan 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have examined profile.php and found the following line where I think 'homepage' is being entered (it says updated but I assume that includes inserted .. anyway I can check it out):

$userdata->set('homepage', $vbulletin->GPC['homepage']);

My problem is I don't understand how this code works and therefore I don't know how to examine the contents of 'homepage'.

I want to check if 'homepage' has something entered and if it does then exit().

I don't know if I need to write to a temporary variable and check the temporary variable or check something in the code here.

Would you please tell me what code I can use to check to see if 'homepage' is entered when the code in profile.php says:

$userdata->set('homepage', $vbulletin->GPC['homepage']);

The code doesn't have to be brilliant just has to get the job done. If you give me an idea what to write then I can check it you don't have to check it.

Thank you very much for your help.
Reply With Quote
  #6  
Old 02-29-2012, 01:03 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JennyKhoo View Post
I have examined profile.php and found the following line where I think 'homepage' is being entered (it says updated but I assume that includes inserted .. anyway I can check it out):

$userdata->set('homepage', $vbulletin->GPC['homepage']);

My problem is I don't understand how this code works and therefore I don't know how to examine the contents of 'homepage'.

First of all, sorry, I had "can" in my post above where I meant "can't".

The code you posted is in profile.php, at that point the user is already registered. So you could exit at that point but it will only stop the user from setting the profile. But if you want to do that, you could put:

Code:
if (!empty($vbulletin->GPC['homepage']))
{
    exit();
}

But that would also stop any user from setting a homepage.
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 08:24 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.05397 seconds
  • Memory Usage 2,213KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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