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 166Line 170
					->format($user->lang['DATE_FORMAT'], true);
unset($now);


					->format($user->lang['DATE_FORMAT'], true);
unset($now);


				$template->assign_vars(array(
'S_LANG_OPTIONS' => (sizeof($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'),

				$template_vars = array(
'S_LANG_OPTIONS' => (count($lang_row) > 1) ? language_select($user_lang) : '',
'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 180Line 181

'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],


'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],

				));

				);

			}
else
{

			}
else
{

				$template->assign_vars(array(
'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '',

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

					'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 195Line 196

'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],


'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],

					)

 
				);
}

				);
}

 

$tpl_name = 'ucp_agreement';

/**
* Allows to modify the agreements.
*
* @event core.ucp_register_agreement_modify_template_data
* @var string tpl_name Template file
* @var array template_vars Array with data about to be assigned to the template
* @var array s_hidden_fields Array with hidden form elements
* @var array lang_row Array with available languages, read only
* @since 3.2.2-RC1
*/
$vars = array('tpl_name', 'template_vars', 's_hidden_fields', 'lang_row');
extract($phpbb_dispatcher->trigger_event('core.ucp_register_agreement_modify_template_data', compact($vars)));


			unset($lang_row);

			unset($lang_row);

 

$template_vars = array_merge($template_vars, array(
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
));

$template->assign_vars($template_vars);


/**
* Allows to modify the agreements.


/**
* Allows to modify the agreements.

Line 207Line 229
			*
* @event core.ucp_register_agreement
* @since 3.1.6-RC1

			*
* @event core.ucp_register_agreement
* @since 3.1.6-RC1

 
			* @deprecated 3.2.2-RC1 Replaced by core.ucp_register_agreement_modify_template_data and to be removed in 3.3.0-RC1

			*/
$phpbb_dispatcher->dispatch('core.ucp_register_agreement');


			*/
$phpbb_dispatcher->dispatch('core.ucp_register_agreement');


			$this->tpl_name = 'ucp_agreement';

			$this->tpl_name = $tpl_name;

			return;
}


			return;
}


Line 297Line 320
			// validate custom profile fields
$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);


			// validate custom profile fields
$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);


			if (!sizeof($error))

			if (!count($error))

			{
if ($data['new_password'] != $data['password_confirm'])
{

			{
if ($data['new_password'] != $data['password_confirm'])
{

Line 318Line 341
			$vars = array('submit', 'data', 'cp_data', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars)));


			$vars = array('submit', 'data', 'cp_data', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars)));


			if (!sizeof($error))

			if (!count($error))

			{
$server_url = generate_board_url();


			{
$server_url = generate_board_url();


Line 458Line 481
							'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 485Line 534
						$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);

Line 505Line 578
		{
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
}

		{
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
}

		$s_hidden_fields = build_hidden_fields($s_hidden_fields);

 

// Visual Confirmation - Show images
if ($config['enable_confirm'])


// Visual Confirmation - Show images
if ($config['enable_confirm'])

Line 531Line 603
		// 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);


		$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',

		$template_vars = array(


			'USERNAME'			=> $data['username'],
'PASSWORD' => $data['new_password'],
'PASSWORD_CONFIRM' => $data['password_confirm'],

			'USERNAME'			=> $data['username'],
'PASSWORD' => $data['new_password'],
'PASSWORD_CONFIRM' => $data['password_confirm'],

Line 547Line 618
			'S_CONFIRM_REFRESH'	=> ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,
'S_COPPA' => $coppa,

			'S_CONFIRM_REFRESH'	=> ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
'S_REGISTRATION' => true,
'S_COPPA' => $coppa,

			'S_HIDDEN_FIELDS'	=> $s_hidden_fields,

 
			'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),

'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],

			'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),

'COOKIE_NAME' => $config['cookie_name'],
'COOKIE_PATH' => $config['cookie_path'],

 
		);

$tpl_name = 'ucp_register';

/**
* Modify template data on the registration page
*
* @event core.ucp_register_modify_template_data
* @var array template_vars Array with template data
* @var array data Array with user data, read only
* @var array error Array with errors
* @var array s_hidden_fields Array with hidden field elements
* @var string tpl_name Template name
* @since 3.2.2-RC1
*/
$vars = array(
'template_vars',
'data',
'error',
's_hidden_fields',
'tpl_name',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_register_modify_template_data', compact($vars)));

$template_vars = array_merge($template_vars, array(
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),

		));

		));

 

$template->assign_vars($template_vars);


//
$user->profile_fields = array();


//
$user->profile_fields = array();

Line 561Line 660
		$cp->generate_profile_fields('register', $user->get_iso_lang_id());

//

		$cp->generate_profile_fields('register', $user->get_iso_lang_id());

//

		$this->tpl_name = 'ucp_register';
$this->page_title = 'UCP_REGISTRATION';

		$this->tpl_name = $tpl_name;


	}

/**

	}

/**