phpBB

Code Changes

File: includes/ucp/ucp_register.php

  Unmodified   Added   Modified   Removed
Line 39Line 39
			trigger_error('UCP_REGISTER_DISABLE');
}


			trigger_error('UCP_REGISTER_DISABLE');
}


		$coppa			= $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false;


		$coppa			= $request->is_set('coppa_yes') ? 1 : ($request->is_set('coppa_no') ? 0 : false);
$coppa = $request->is_set('coppa') ? $request->variable('coppa', 0) : $coppa;

		$agreed			= $request->variable('agreed', false);
$submit = $request->is_set_post('submit');
$change_lang = $request->variable('change_lang', '');
$user_lang = $request->variable('lang', $user->lang_name);

		$agreed			= $request->variable('agreed', false);
$submit = $request->is_set_post('submit');
$change_lang = $request->variable('change_lang', '');
$user_lang = $request->variable('lang', $user->lang_name);

 

if ($agreed && !check_form_key('ucp_register'))
{
$agreed = false;
}

if ($coppa !== false && !check_form_key('ucp_register'))
{
$coppa = false;
}


/**
* Add UCP register data before they are assigned to the template or submitted


/**
* Add UCP register data before they are assigned to the template or submitted

Line 67Line 78
		);
extract($phpbb_dispatcher->trigger_event('core.ucp_register_requests_after', compact($vars)));


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


		if ($agreed)
{

 
			add_form_key('ucp_register');

			add_form_key('ucp_register');

		}
else
{
add_form_key('ucp_register_terms');
}

 

if ($change_lang || $user_lang != $config['default_lang'])
{


if ($change_lang || $user_lang != $config['default_lang'])
{

Line 168Line 172

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


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

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

'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'),
'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1'),

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





'S_SHOW_COPPA' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),


'S_SHOW_COPPA' => true,
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),

Line 410Line 411
				* @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...

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

// Register user...

Line 480Line 483
							'EMAIL_ADDRESS'	=> $data['email'])
);
}

							'EMAIL_ADDRESS'	=> $data['email'])
);
}

 

/**
* Modify messenger data before welcome mail is sent
*
* @event core.ucp_register_welcome_email_before
* @var array user_row Array with user registration data
* @var array cp_data Array with custom profile fields data
* @var array data Array with current ucp registration data
* @var string message Message to be displayed to the user after registration
* @var string server_url Server URL
* @var int user_id New user ID
* @var string user_actkey User activation key
* @var messenger messenger phpBB Messenger
* @since 3.2.4-RC1
*/
$vars = array(
'user_row',
'cp_data',
'data',
'message',
'server_url',
'user_id',
'user_actkey',
'messenger',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_register_welcome_email_before', compact($vars)));


$messenger->send(NOTIFY_EMAIL);
}


$messenger->send(NOTIFY_EMAIL);
}

Line 507Line 536
						$message = $message . '<br /><br />' . $user->lang[$result];
}
}

						$message = $message . '<br /><br />' . $user->lang[$result];
}
}

 

/**
* Perform additional actions after user registration
*
* @event core.ucp_register_register_after
* @var array user_row Array with user registration data
* @var array cp_data Array with custom profile fields data
* @var array data Array with current ucp registration data
* @var string message Message to be displayed to the user after registration
* @var string server_url Server URL
* @var int user_id New user ID
* @var string user_actkey User activation key
* @since 3.2.4-RC1
*/
$vars = array(
'user_row',
'cp_data',
'data',
'message',
'server_url',
'user_id',
'user_actkey',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_register_register_after', compact($vars)));


$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);


$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);