phpBB

Code Changes

File: includes/ucp/ucp_profile.php

  Unmodified   Added   Modified   Removed
Line 98Line 98
					$passwords_manager = $phpbb_container->get('passwords.manager');

// Only check the new password against the previous password if there have been no errors

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

// Only check the new password against the previous password if there have been no errors

					if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password']))

					if (!count($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password']))

					{
$error[] = 'SAME_PASSWORD_ERROR';
}

					{
$error[] = 'SAME_PASSWORD_ERROR';
}

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


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


					if (!sizeof($error))

					if (!count($error))

					{
$sql_ary = array(
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],

					{
$sql_ary = array(
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],

Line 133Line 133
							'user_email'		=> ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? $passwords_manager->hash($data['new_password']) : $user->data['user_password'],

							'user_email'		=> ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? $passwords_manager->hash($data['new_password']) : $user->data['user_password'],

							'user_passchg'		=> ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,

 
						);

if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username'])

						);

if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username'])

Line 147Line 146

if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !$passwords_manager->check($data['new_password'], $user->data['user_password']))
{


if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !$passwords_manager->check($data['new_password'], $user->data['user_password']))
{

 
							$sql_ary['user_passchg'] = time();


							$user->reset_login_keys();
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_NEW_PASSWORD', false, array(
'reportee_id' => $user->data['user_id'],

							$user->reset_login_keys();
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_NEW_PASSWORD', false, array(
'reportee_id' => $user->data['user_id'],

Line 159Line 160
							$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
'reportee_id' => $user->data['user_id'],
$user->data['username'],

							$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
'reportee_id' => $user->data['user_id'],
$user->data['username'],

								$data['user_email'],

								$user->data['user_email'],

								$data['email']
));
}

								$data['email']
));
}

Line 220Line 221
						$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));


						$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));


						if (sizeof($sql_ary))

						if (count($sql_ary))

						{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '

						{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '

Line 257Line 258
				}

$template->assign_vars(array(

				}

$template->assign_vars(array(

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

					'ERROR'				=> (count($error)) ? implode('<br />', $error) : '',


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


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

Line 343Line 344
					// validate custom profile fields
$cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error);


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


					if (sizeof($cp_error))

					if (count($cp_error))

					{
$error = array_merge($error, $cp_error);
}

					{
$error = array_merge($error, $cp_error);
}

Line 365Line 366
					$vars = array('data', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars)));


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


					if (!sizeof($error))

					if (!count($error))

					{
$data['notify'] = $user->data['user_notify_type'];


					{
$data['notify'] = $user->data['user_notify_type'];


Line 449Line 450
				}

$template->assign_vars(array(

				}

$template->assign_vars(array(

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

					'ERROR'				=> (count($error)) ? implode('<br />', $error) : '',

					'S_JABBER_ENABLED'	=> $config['jab_enable'],
'JABBER' => $data['jabber'],
));

					'S_JABBER_ENABLED'	=> $config['jab_enable'],
'JABBER' => $data['jabber'],
));

Line 469Line 470
					trigger_error('NO_AUTH_SIGNATURE');
}


					trigger_error('NO_AUTH_SIGNATURE');
}


 
				if (!function_exists('generate_smilies'))
{

				include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

				include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

 
				}

if (!function_exists('display_custom_bbcodes'))
{

				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

				include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

 
				}


$preview = $request->is_set_post('preview');



$preview = $request->is_set_post('preview');


Line 508Line 516
				* @var	bool	submit				Whether or not the form has been sumitted
* @var bool preview Whether or not the signature is being previewed
* @since 3.1.10-RC1

				* @var	bool	submit				Whether or not the form has been sumitted
* @var bool preview Whether or not the signature is being previewed
* @since 3.1.10-RC1

				* @change 3.2.0-RC2 Removed message parser

				* @changed 3.2.0-RC2 Removed message parser

				*/
$vars = array(
'enable_bbcode',

				*/
$vars = array(
'enable_bbcode',

Line 537Line 545
					'sig'
);


					'sig'
);


				if (sizeof($warn_msg))

				if (count($warn_msg))

				{
$error += $warn_msg;
}

				{
$error += $warn_msg;
}

Line 549Line 557
				}
else
{

				}
else
{

					if (!sizeof($error))

					if (!count($error))

					{
$user->optionset('sig_bbcode', $enable_bbcode);
$user->optionset('sig_smilies', $enable_smilies);

					{
$user->optionset('sig_bbcode', $enable_bbcode);
$user->optionset('sig_smilies', $enable_smilies);

Line 594Line 602
				$controller_helper = $phpbb_container->get('controller.helper');

$template->assign_vars(array(

				$controller_helper = $phpbb_container->get('controller.helper');

$template->assign_vars(array(

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

					'ERROR'				=> (count($error)) ? implode('<br />', $error) : '',

					'SIGNATURE'			=> $decoded_message['text'],
'SIGNATURE_PREVIEW' => $signature_preview,


					'SIGNATURE'			=> $decoded_message['text'],
'SIGNATURE_PREVIEW' => $signature_preview,


Line 753Line 761
				$avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true);

$template->assign_vars(array(

				$avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true);

$template->assign_vars(array(

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

					'ERROR'			=> (count($error)) ? implode('<br />', $error) : '',

					'AVATAR'		=> $avatar,

'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',

					'AVATAR'		=> $avatar,

'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',

Line 778Line 786
						$error[] = 'FORM_INVALID';
}


						$error[] = 'FORM_INVALID';
}


					if (!sizeof($error))

					if (!count($error))

					{
if (!empty($keys))
{

					{
if (!empty($keys))
{

Line 825Line 833
		}

$template->assign_vars(array(

		}

$template->assign_vars(array(

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

			'ERROR'		=> (count($error)) ? implode('<br />', $error) : '',


'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],



'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],