/*
# UBB.threads, Version 6
# Official Release Date for UBB.threads Version6: 06/05/2002
# First version of UBB.threads created July 30, 1996 (by Rick Baker).
# This entire program is copyright Infopop Corporation, 2002.
# For more info on the UBB.threads and other Infopop
# Products/Services, visit: http://www.infopop.com
# Program Author: Rick Baker.
# You may not distribute this program in any manner, modified or otherwise,
# without the express, written written consent from Infopop Corporation.
# Note: if you modify ANY code within UBB.threads, we at Infopop Corporation
# cannot offer you support-- thus modify at your own peril :)
# ---------------------------------------------------------------------------
*/
// Require the library
require ("main.inc.php");
require ("languages/${$config['cookieprefix']."w3t_language"}/newuser.php");
$html = new html;
// -------------
// Get the input
$Cat = get_input("Cat","get");
$p = get_input("p","get");
// -------------------------------------------
// Make sure we have a minlength and maxlength
if (!isset($config['minlength'])) { $config['minlength'] = '3'; }
if (!isset($config['maxlength'])) { $config['maxlength'] = '3'; }
// -------------------------------------------------------------------------
// Security check, make sure install, createtable, altertable files are gone
$query = "
SELECT COUNT(U_Username)
FROM {$config['tbprefix']}Users
";
$sth = $dbh -> do_query($query);
list($usercheck) = $dbh -> fetch_array($sth);
if ($usercheck < 2) {
$alterarray = array(
"altertable-5.2-5.3.php",
"altertable-5.3-5.4.php",
"altertable-5.4.1-5.4.2.php",
"altertable-5.4.2-5.4.3.php",
"altertable-5.4.3-5.4.4.php",
"altertable-5.4.4-5.4.5.php",
"altertable-5.4.6-5.5.php",
"altertable-5.5-6.0.php",
"altertable-6.1-6.2.php"
);
if (file_exists("install.php")) {
$html -> not_right("You need to delete the install.php script before creating your admin user.",$Cat);
}
elseif (file_exists("createtable.php")) {
$html -> not_right("You need to delete the createtable.php script before creating your admin user.",$Cat);
}
$asize = sizeof($alterarray);
for ($i=0;$i<$asize;$i++) {
if (file_exists($alterarray[$i])) {
//$html -> not_right("You need to delete all altertable scripts before creating your admin user.",$Cat);
}
}
}
// ------------------------------------------------------
// If we are checking ages, the we need to do this first
if ( ($config['checkage']) && ($p != "y") ) {
$html -> send_header($ubbt_lang['AGE_VER'],$Cat,0,0,0,0);
$currentyear = date("Y");
if (isset(${$config['cookieprefix']."ubbt_dob"})) {
list($month,$day,$year) = split("/",${$config['cookieprefix']."ubbt_dob"});
$months = array('','January','February','March','April','May','June','July','August','September','October','November','December');
$formprint = "
{$ubbt_lang['DOB_EXIST']}
$months[$month] $day, $year
";
}
else {
$formprint = "
{$ubbt_lang['DOB']}
";
}
// ---------------------
// Grab the tablewrapper
list($tbopen,$tbclose) = $html -> table_wrapper();
include("$thispath/templates/$tempstyle/newuser_checkage.tmpl");
$html -> send_footer();
exit;
}
// ---------------------
// Send the page to them
$html -> send_header($ubbt_lang['NEW_USER'],$Cat,0,0,0,0);
// ---------------------------------------
// Let's see if we are giving board rules
if ($config['boardrules']) {
$boardrules = <<
EOF;
}
else {
$boardrules = "";
}
// ----------------------------------------------------------------------
// If we are allowing the user to create their own password, then we give
// them a form
if ($config['userpass']) {
$choosepassword = "
{$ubbt_lang['OPT_PASS']}