Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
Disallow registration when cookies not enabled Details »»
Disallow registration when cookies not enabled
Version: 1.00, by StewardManscat StewardManscat is offline
Developer Last Online: Nov 2009 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 10-11-2004 Last Update: Never Installs: 3
 
No support by the author.

At our site we require cookies.
Avoid support issues by turning people away at the door.


In register.php find
PHP Code:
if (empty($_REQUEST['do']) AND empty($_REQUEST['a']))
{
    
$_REQUEST['do'] = 'signup';

Replace with

PHP Code:
if (empty($_REQUEST['do']) AND empty($_REQUEST['a']))
{
    
$_REQUEST['do'] = 'cookie';

Find

PHP Code:
if ($_REQUEST['do'] == 'signup'

Replace with

PHP Code:
if ($_REQUEST['do'] == 'cookie')
{
    
vbsetcookie('signup''ok'0);
    
exec_header_redirect("register.php?do=signup");
}

if (
$_REQUEST['do'] == 'signup')
{
  if (
$_COOKIE[COOKIE_PREFIX 'signup'] !=  'ok' )
  {
      eval(
'print_output("' fetch_template('manNeedsCookie') . '");');
  } 
Finally, create a template which informs the user why they cannot register. You'll want to include some links to help them out....

http://www.google.com/cookies.html
http://webmaster.info.aol.com/cookieguide.html

http://www.allaboutcookies.org/manage-cookies
http://www.cookiecentral.com/

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-12-2004, 08:38 PM
???`S?LV?R???`'s Avatar
???`S?LV?R???` ???`S?LV?R???` is offline
 
Join Date: Aug 2003
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice one
Reply With Quote
  #3  
Old 10-12-2004, 09:06 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks

Can I use the same method with browsing the forum.

and it will be fantastic if there was an option to swich it on and off from CP
Reply With Quote
  #4  
Old 10-12-2004, 10:50 PM
nexialys
Guest
 
Posts: n/a
Default

would be better instead of having a template loaded to have an error message....
Reply With Quote
  #5  
Old 10-13-2004, 12:35 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys
would be better instead of having a template loaded to have an error message....
How would you incorporate that into this?
Reply With Quote
  #6  
Old 10-13-2004, 09:09 AM
nexialys
Guest
 
Posts: n/a
Default

Boofo.. you're the one to ask... hummm

ok, let's see:
PHP Code:
    $DB_site->query "INSERT INTO " TABLE_PREFIX "phrase VALUES ( NULL, '-1', 'error_no_reg_on_disabled_cookie', 'The Administrator has required that all visitors requiring to register have their Cookies Enabled, to add more security to the board.', '1000' )" ) ; 
...this will add the error phrase... i suppose Stewart can handle this in a install script or give the mysql in the howto.
and change this:
PHP Code:
eval('print_output("' fetch_template('manNeedsCookie') . '");'); 
to this:
PHP Code:
eval ( print_standard_error 'error_no_reg_on_disabled_cookie' ) ) ; 
Reply With Quote
  #7  
Old 10-13-2004, 09:38 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I only asked so others might get the code they needed if they wanted it.
Reply With Quote
Reply

Thread Tools

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:39 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.04969 seconds
  • Memory Usage 2,264KB
  • Queries Executed 22 (?)
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
  • (7)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (6)postbit
  • (5)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_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