1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
if($mybb->input['action'] == "do_register" && $mybb->request_method == "post")
{
if($mybb->settings['regtype'] == "randompass")
{
$mybb->input['password'] = random_str();
$mybb->input['password2'] = $mybb->input['password'];
}
if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->input['coppa'] == 1)
{
$usergroup = 5;
}
else
{
$usergroup = 2;
}
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("insert");
$user = array(
"username" => $mybb->input['username'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2'],
"email" => $mybb->input['email'],
"email2" => $mybb->input['email2'],
"usergroup" => $usergroup,
"referrer" => $mybb->input['referrername'],
"timezone" => $mybb->input['timezoneoffset'],
"language" => $mybb->input['language'],
"profile_fields" => $mybb->input['profile_fields'],
"regip" => $session->ipaddress,
"longregip" => my_ip2long($session->ipaddress),
"coppa_user" => intval($mybb->cookies['coppauser']),
);
if(isset($mybb->input['regcheck1']) && isset($mybb->input['regcheck2']))
{
$user['regcheck1'] = $mybb->input['regcheck1'];
$user['regcheck2'] = $mybb->input['regcheck2'];
}
if($mybb->cookies['coppadob'])
{
list($dob_day, $dob_month, $dob_year) = explode("-", $mybb->cookies['coppadob']);
$user['birthday'] = array(
"day" => $dob_day,
"month" => $dob_month,
"year" => $dob_year
);
}
$user['options'] = array(
"allownotices" => $mybb->input['allownotices'],
"hideemail" => $mybb->input['hideemail'],
"subscriptionmethod" => $mybb->input['subscriptionmethod'],
"receivepms" => $mybb->input['receivepms'],
"pmnotice" => $mybb->input['pmnotice'],
"emailpmnotify" => $mybb->input['emailpmnotify'],
"invisible" => $mybb->input['invisible'],
"dstcorrection" => $mybb->input['dstcorrection']
);
$userhandler->set_data($user);
$errors = "";
if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();
}
|