<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.8.11 - Licence Number VBFD291AA6
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2025 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # www.vbulletin.com | www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'register');
define('CSRF_PROTECTION', true);
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('timezone', 'user', 'register', 'cprofilefield');
// get special data templates from the datastore
$specialtemplates = array(
'smiliecache',
'bbcodecache',
'banemail',
'ranks',
);
// pre-cache templates used by all actions
$globaltemplates = array(
'humanverify',
'register',
'register_rules',
'register_verify_age',
'register_coppaform',
'userfield_textbox',
'userfield_checkbox_option',
'userfield_optional_input',
'userfield_radio',
'userfield_radio_option',
'userfield_select',
'userfield_select_option',
'userfield_select_multiple',
'userfield_textarea',
'userfield_wrapper',
'modifyoptions_timezone',
'modifyprofile_birthday',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
'requestemail' => array(
'activate_requestemail'
),
'none' => array(
'activateform'
)
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_user.php');
require_once(DIR . '/includes/functions_misc.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$vbulletin->input->clean_gpc('r', 'a', TYPE_NOHTML);
$vbulletin->input->clean_gpc('r', 'u', TYPE_NOHTML);
$coppaage = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'coppaage', TYPE_STR);
if (empty($_REQUEST['do']) AND $vbulletin->GPC['a'] == '')
{
$_REQUEST['do'] = 'signup';
}
($hook = vBulletinHook::fetch_hook('register_start')) ? eval($hook) : false;
// ############################### start checkdate ###############################
if ($_REQUEST['do'] == 'checkdate')
{
// check their birthdate
$vbulletin->input->clean_array_gpc('r', array(
'month' => TYPE_UINT,
'year' => TYPE_UINT,
'day' => TYPE_UINT,
));
$current['year'] = date('Y');
$current['month'] = date('m');
$current['day'] = date('d');
if ($vbulletin->GPC['month'] == 0 OR $vbulletin->GPC['day'] == 0 OR !preg_match('#^\d{4}$#', $vbulletin->GPC['year']) OR $vbulletin->GPC['year'] < 1901 OR $vbulletin->GPC['year'] > $current['year'])
{
eval(standard_error(fetch_error('select_valid_dob', $current['year'])));
}
($hook = vBulletinHook::fetch_hook('register_checkdate')) ? eval($hook) : false;
if ($vbulletin->options['usecoppa'] AND $vbulletin->options['checkcoppa'] AND $coppaage)
{
$dob = explode('-', $coppaage);
$month = $dob[0];
$day = $dob[1];
$year = $dob[2];
}
if ($vbulletin->GPC['year'] < 1970 OR (mktime(0, 0, 0, $vbulletin->GPC['month'], $vbulletin->GPC['day'], $vbulletin->GPC['year']) <= mktime(0, 0, 0, $current['month'], $current['day'], $current['year'] - 13)))
{
$_REQUEST['do'] = 'signup';
}
else
{
if ($vbulletin->options['checkcoppa'] AND $vbulletin->options['usecoppa'])
{
vbsetcookie('coppaage', $vbulletin->GPC['month'] . '-' . $vbulletin->GPC['day'] . '-' . $vbulletin->GPC['year'], 1);
}
if ($vbulletin->options['usecoppa'] == 2)
{
// turn away as they're under 13
eval(standard_error(fetch_error('under_thirteen_registration_denied')));
}
else
{
$_REQUEST['do'] = 'signup';
}
}
}
// ############################### start signup ###############################
if ($_REQUEST['do'] == 'signup')
{
$current['year'] = date('Y');
$current['month'] = date('m');
$current['day'] = date('d');
if (!$vbulletin->options['allowregistration'])
{
eval(standard_error(fetch_error('noregister')));
}
if ($vbulletin->userinfo['userid'] AND !$vbulletin->options['allowmultiregs'])
{
eval(standard_error(fetch_error('alreadyregistered', $vbulletin->userinfo['username'], $vbulletin->session->vars['sessionurl'])));
}
if ($vbulletin->options['usecoppa'])
{
if ($vbulletin->options['checkcoppa'] AND $coppaage)
{
$dob = explode('-', $coppaage);
$month = $dob[0];
$day = $dob[1];
$year = $dob[2];
}
else
{
$month = $vbulletin->input->clean_gpc('r', 'month', TYPE_UINT);
$year = $vbulletin->input->clean_gpc('r', 'year', TYPE_UINT);
$day = $vbulletin->input->clean_gpc('r', 'day', TYPE_UINT);
}
if (!$month OR !$day OR !$year)
{ // Show age controls
$templatename = 'register_verify_age';
}
else // verify age
{
if ($year < 1970 OR (mktime(0, 0, 0, $month, $day, $year) <= mktime(0, 0, 0, $current['month'], $current['day'], $current['year'] - 13)))
{ // this user is >13
$show['coppa'] = false;
$templatename = 'register_rules';
}
else if ($vbulletin->options['usecoppa'] == 2)
{
if ($vbulletin->options['checkcoppa'])
{
vbsetcookie('coppaage', $month . '-' . $day . '-' . $year, 1);
}
eval(standard_error(fetch_error('under_thirteen_registration_denied')));
}
else
{
if ($vbulletin->options['checkcoppa'])
{
vbsetcookie('coppaage', $month . '-' . $day . '-' . $year, 1);
}
$show['coppa'] = true;
$templatename = 'register_rules';
}
}
}
else
{
$show['coppa'] = false;
$templatename = 'register_rules';
}
($hook = vBulletinHook::fetch_hook('register_signup')) ? eval($hook) : false;
$url =& $vbulletin->url;
eval('print_output("' . fetch_template($templatename) . '");');
}Add a code snippet to your website: www.paste.org