phpBB

Code Changes

File: includes/ucp/ucp_register.php

  Unmodified   Added   Modified   Removed
Line 30Line 30
	function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;

	function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;

		global $request, $phpbb_container;

		global $request, $phpbb_container, $phpbb_dispatcher;


//


//

		if ($config['require_activation'] == USER_ACTIVATION_DISABLE)


		if ($config['require_activation'] == USER_ACTIVATION_DISABLE ||
(in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)) && !$config['email_enable']))

		{
trigger_error('UCP_REGISTER_DISABLE');
}

		{
trigger_error('UCP_REGISTER_DISABLE');
}

Line 43Line 44
		$submit			= $request->is_set_post('submit');
$change_lang = request_var('change_lang', '');
$user_lang = request_var('lang', $user->lang_name);

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

 

/**
* Add UCP register data before they are assigned to the template or submitted
*
* To assign data to the template, use $template->assign_vars()
*
* @event core.ucp_register_requests_after
* @var bool coppa Is set coppa
* @var bool agreed Did user agree to coppa?
* @var bool submit Is set post submit?
* @var string change_lang Change language request
* @var string user_lang User language request
* @since 3.1.11-RC1
*/
$vars = array(
'coppa',
'agreed',
'submit',
'change_lang',
'user_lang',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_register_requests_after', compact($vars)));


if ($agreed)
{


if ($agreed)
{

Line 87Line 110
		if (!empty($login_link_data))
{
// Confirm that we have all necessary data

		if (!empty($login_link_data))
{
// Confirm that we have all necessary data

			$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
$auth_provider = $phpbb_container->get($auth_provider);

			$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));


$result = $auth_provider->login_link_has_necessary_data($login_link_data);
if ($result !== null)


$result = $auth_provider->login_link_has_necessary_data($login_link_data);
if ($result !== null)

Line 174Line 197
				);
}
unset($lang_row);

				);
}
unset($lang_row);

 

/**
* Allows to modify the agreements.
*
* To assign data to the template, use $template->assign_vars()
*
* @event core.ucp_register_agreement
* @since 3.1.6-RC1
*/
$phpbb_dispatcher->dispatch('core.ucp_register_agreement');


$this->tpl_name = 'ucp_agreement';
return;


$this->tpl_name = 'ucp_agreement';
return;

Line 196Line 229
			'lang'				=> basename(request_var('lang', $user->lang_name)),
'tz' => request_var('tz', $timezone),
);

			'lang'				=> basename(request_var('lang', $user->lang_name)),
'tz' => request_var('tz', $timezone),
);

 
		/**
* Add UCP register data before they are assigned to the template or submitted
*
* To assign data to the template, use $template->assign_vars()
*
* @event core.ucp_register_data_before
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp registration data
* @since 3.1.4-RC1
*/
$vars = array('submit', 'data');
extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_before', compact($vars)));


// Check and initialize some variables if needed
if ($submit)


// Check and initialize some variables if needed
if ($submit)

Line 256Line 302
					$error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
}

					$error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
}

 
			/**
* Check UCP registration data after they are submitted
*
* @event core.ucp_register_data_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 error Array with list of errors
* @since 3.1.4-RC1
*/
$vars = array('submit', 'data', 'cp_data', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars)));


if (!sizeof($error))
{


if (!sizeof($error))
{

Line 318Line 377
				{
$user_row['user_new'] = 1;
}

				{
$user_row['user_new'] = 1;
}

 
				/**
* Add into $user_row before user_add
*
* user_add allows adding more data into the users table
*
* @event core.ucp_register_user_row_after
* @var bool submit Do we display the form only
* or did the user press submit
* @var array cp_data Array with custom profile fields data
* @var array user_row Array with current ucp registration data
* @since 3.1.4-RC1
*/
$vars = array('submit', '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);


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