vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Disallow registration when cookies not enabled (https://vborg.vbsupport.ru/showthread.php?t=70483)

StewardManscat 10-11-2004 10:00 PM

Disallow registration when cookies not enabled
 
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/

???`S?LV?R???` 10-12-2004 08:38 PM

nice one

Remi 10-12-2004 09:06 PM

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 :)

nexialys 10-12-2004 10:50 PM

would be better instead of having a template loaded to have an error message....

Boofo 10-13-2004 12:35 AM

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?

nexialys 10-13-2004 09:09 AM

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' ) ) ; 


Boofo 10-13-2004 09:38 AM

I only asked so others might get the code they needed if they wanted it. ;)


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.01043 seconds
  • Memory Usage 1,745KB
  • 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
  • (7)bbcode_php_printable
  • (1)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