phpBB

Code Changes

File: includes/ucp/ucp_register.php

  Unmodified   Added   Modified   Removed
Line 150Line 150
			}

// Checking amount of available languages

			}

// Checking amount of available languages

			$sql = 'SELECT lang_id
FROM ' . LANG_TABLE;


			$sql = 'SELECT lang_iso, lang_local_name
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';

			$result = $db->sql_query($sql);

			$result = $db->sql_query($sql);


$lang_row = array();
while ($row = $db->sql_fetchrow($result))
{
$lang_row[] = $row;
}

			$lang_row = (array) $db->sql_fetchrowset($result);






			$db->sql_freeresult($result);

if ($coppa === false && $config['coppa_enable'])

			$db->sql_freeresult($result);

if ($coppa === false && $config['coppa_enable'])

Line 171Line 167
				unset($now);

$template_vars = array(

				unset($now);

$template_vars = array(

					'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($user_lang) : '',

					'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($user_lang, $lang_row) : '',

					'L_COPPA_NO'		=> $user->lang('UCP_COPPA_BEFORE', $coppa_birthday),
'L_COPPA_YES' => $user->lang('UCP_COPPA_ON_AFTER', $coppa_birthday),


					'L_COPPA_NO'		=> $user->lang('UCP_COPPA_BEFORE', $coppa_birthday),
'L_COPPA_YES' => $user->lang('UCP_COPPA_ON_AFTER', $coppa_birthday),


Line 186Line 182
			else
{
$template_vars = array(

			else
{
$template_vars = array(

					'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($user_lang) : '',

					'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($user_lang, $lang_row) : '',

					'L_TERMS_OF_USE'	=> sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),

'S_SHOW_COPPA' => false,

					'L_TERMS_OF_USE'	=> sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),

'S_SHOW_COPPA' => false,

Line 304Line 300

if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
{


if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
{

					$error[] = $user->lang['TOO_MANY_REGISTERS'];

					trigger_error('TOO_MANY_REGISTERS');

				}
}


				}
}


Line 367Line 363
					$config['require_activation'] == USER_ACTIVATION_SELF ||
$config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable'])
{

					$config['require_activation'] == USER_ACTIVATION_SELF ||
$config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable'])
{

					$user_actkey = gen_rand_string(mt_rand(6, 10));

					$user_actkey = strtolower(gen_rand_string(32));

					$user_type = USER_INACTIVE;
$user_inactive_reason = INACTIVE_REGISTER;
$user_inactive_time = time();

					$user_type = USER_INACTIVE;
$user_inactive_reason = INACTIVE_REGISTER;
$user_inactive_time = time();

Line 385Line 381
				$passwords_manager = $phpbb_container->get('passwords.manager');

$user_row = array(

				$passwords_manager = $phpbb_container->get('passwords.manager');

$user_row = array(

					'username'				=> $data['username'],
'user_password' => $passwords_manager->hash($data['new_password']),
'user_email' => $data['email'],
'group_id' => (int) $group_id,
'user_timezone' => $data['tz'],
'user_lang' => $data['lang'],
'user_type' => $user_type,
'user_actkey' => $user_actkey,
'user_ip' => $user->ip,
'user_regdate' => time(),
'user_inactive_reason' => $user_inactive_reason,
'user_inactive_time' => $user_inactive_time,


					'username'					=> $data['username'],
'user_password' => $passwords_manager->hash($data['new_password']),
'user_email' => $data['email'],
'group_id' => (int) $group_id,
'user_timezone' => $data['tz'],
'user_lang' => $data['lang'],
'user_type' => $user_type,
'user_actkey' => $user_actkey,
'user_actkey_expiration' => $user::get_token_expiration(),
'user_ip' => $user->ip,
'user_regdate' => time(),
'user_inactive_reason' => $user_inactive_reason,
'user_inactive_time' => $user_inactive_time,

				);

if ($config['new_member_post_limit'])

				);

if ($config['new_member_post_limit'])

Line 411Line 408
				* @event core.ucp_register_user_row_after
* @var bool submit Do we display the form only
* or did the user press submit

				* @event core.ucp_register_user_row_after
* @var bool submit Do we display the form only
* or did the user press submit

 
				* @var	array	data		Array with current ucp registration data

				* @var	array	cp_data		Array with custom profile fields data

				* @var	array	cp_data		Array with custom profile fields data

				* @var	array	user_row	Array with current ucp registration data

				* @var	array	user_row	Array with user data that will be inserted

				* @since 3.1.4-RC1

				* @since 3.1.4-RC1

 
				* @changed 3.2.10-RC1 Added data array

				*/

				*/

				$vars = array('submit', 'cp_data', 'user_row');

				$vars = array('submit', 'data', 'cp_data', 'user_row');

				extract($phpbb_dispatcher->trigger_event('core.ucp_register_user_row_after', compact($vars)));

// Register user...
$user_id = user_add($user_row, $cp_data);

// This should not happen, because the required variables are listed above...

				extract($phpbb_dispatcher->trigger_event('core.ucp_register_user_row_after', compact($vars)));

// Register user...
$user_id = user_add($user_row, $cp_data);

// This should not happen, because the required variables are listed above...

				if ($user_id === false)

				if ((bool) $user_id === false)

				{
trigger_error('NO_USER', E_USER_ERROR);
}

				{
trigger_error('NO_USER', E_USER_ERROR);
}

Line 470Line 469
					$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

					$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

						'WELCOME_MSG'	=> htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($data['username']),
'PASSWORD' => htmlspecialchars_decode($data['new_password']),

						'WELCOME_MSG'	=> html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($data['username'], ENT_COMPAT),
'PASSWORD' => html_entity_decode($data['new_password'], ENT_COMPAT),

						'U_ACTIVATE'	=> "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);


						'U_ACTIVATE'	=> "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);


Line 630Line 629

// Assign template vars for timezone select
phpbb_timezone_select($template, $user, $data['tz'], true);


// Assign template vars for timezone select
phpbb_timezone_select($template, $user, $data['tz'], true);

 

// Checking amount of available languages
$sql = 'SELECT lang_iso, lang_local_name
FROM ' . LANG_TABLE . '
ORDER BY lang_english_name';
$result = $db->sql_query($sql);
$lang_row = (array) $db->sql_fetchrowset($result);
$db->sql_freeresult($result);


$template_vars = array(
'USERNAME' => $data['username'],


$template_vars = array(
'USERNAME' => $data['username'],

Line 638Line 645
			'EMAIL'				=> $data['email'],

'L_REG_COND' => $l_reg_cond,

			'EMAIL'				=> $data['email'],

'L_REG_COND' => $l_reg_cond,

			'L_USERNAME_EXPLAIN'		=> $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])),
'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars'])),

			'L_USERNAME_EXPLAIN'		=> $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS_XY', (int) $config['min_name_chars']), $user->lang('CHARACTERS_XY', (int) $config['max_name_chars'])),
'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS_XY', (int) $config['min_pass_chars'])),





			'S_LANG_OPTIONS'	=> language_select($data['lang']),

			'S_LANG_OPTIONS'	=> (count($lang_row) > 1) ? language_select($data['lang'], $lang_row) : '',

			'S_TZ_PRESELECT'	=> !$submit,
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,

			'S_TZ_PRESELECT'	=> !$submit,
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,