phpBB

Code Changes

File: includes/ucp/ucp_profile.php

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

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

		global $request, $phpbb_container;

		global $request, $phpbb_container, $phpbb_dispatcher;


$user->add_lang('posting');



$user->add_lang('posting');


Line 53Line 53
					'cur_password'		=> $request->variable('cur_password', '', true),
'password_confirm' => $request->variable('password_confirm', '', true),
);

					'cur_password'		=> $request->variable('cur_password', '', true),
'password_confirm' => $request->variable('password_confirm', '', true),
);

 

/**
* Modify user registration data on editing account settings in UCP
*
* @event core.ucp_profile_reg_details_data
* @var array data Array with current or updated user registration data
* @var bool submit Flag indicating if submit button has been pressed
* @since 3.1.4-RC1
*/
$vars = array('data', 'submit');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_data', compact($vars)));


add_form_key('ucp_reg_details');



add_form_key('ucp_reg_details');


Line 102Line 113
					{
$error[] = 'FORM_INVALID';
}

					{
$error[] = 'FORM_INVALID';
}

 

/**
* Validate user data on editing registration data in UCP
*
* @event core.ucp_profile_reg_details_validate
* @var array data Array with user profile data
* @var bool submit Flag indicating if submit button has been pressed
* @var array error Array of any generated errors
* @since 3.1.4-RC1
*/
$vars = array('data', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_validate', compact($vars)));


if (!sizeof($error))
{


if (!sizeof($error))
{

Line 160Line 183

if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{


if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{

								// Grab an array of user_id's with a_user permissions ... these users can activate a user
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();

// Also include founders
$where_sql = ' WHERE user_type = ' . USER_FOUNDER;

if (sizeof($admin_ary))
{
$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
}

$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . ' ' .
$where_sql;
$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result))
{
$messenger->template('admin_activate', $row['user_lang']);
$messenger->set_addresses($row);

$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),
'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);

$messenger->send($row['user_notify_type']);
}
$db->sql_freeresult($result);

								$notifications_manager = $phpbb_container->get('notification_manager');
$notifications_manager->add_notifications('notification.type.admin_activate_user', array(
'user_id' => $user->data['user_id'],
'user_actkey' => $user_actkey,
'user_regdate' => time(), // Notification time
));


























							}

user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);

							}

user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);

Line 199Line 197
							$sql_ary['user_actkey'] = $user_actkey;
$sql_ary['user_newpasswd'] = '';
}

							$sql_ary['user_actkey'] = $user_actkey;
$sql_ary['user_newpasswd'] = '';
}

 

/**
* Modify user registration data before submitting it to the database
*
* @event core.ucp_profile_reg_details_sql_ary
* @var array data Array with current or updated user registration data
* @var array sql_ary Array with user registration data to submit to the database
* @since 3.1.4-RC1
*/
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));


if (sizeof($sql_ary))
{


if (sizeof($sql_ary))
{

Line 284Line 293
					$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}

					$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}

 

/**
* Modify user data on editing profile in UCP
*
* @event core.ucp_profile_modify_profile_info
* @var array data Array with user profile data
* @var bool submit Flag indicating if submit button has been pressed
* @since 3.1.4-RC1
*/
$vars = array('data', 'submit');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_profile_info', compact($vars)));


add_form_key('ucp_profile_info');



add_form_key('ucp_profile_info');


Line 319Line 339
					{
$error[] = 'FORM_INVALID';
}

					{
$error[] = 'FORM_INVALID';
}

 

/**
* Validate user data on editing profile in UCP
*
* @event core.ucp_profile_validate_profile_info
* @var array data Array with user profile data
* @var bool submit Flag indicating if submit button has been pressed
* @var array error Array of any generated errors
* @since 3.1.4-RC1
*/
$vars = array('data', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars)));


if (!sizeof($error))
{


if (!sizeof($error))
{

Line 340Line 372
						{
$sql_ary['user_birthday'] = $data['user_birthday'];
}

						{
$sql_ary['user_birthday'] = $data['user_birthday'];
}

 

/**
* Modify profile data in UCP before submitting to the database
*
* @event core.ucp_profile_info_modify_sql_ary
* @var array cp_data Array with the user custom profile fields data
* @var array data Array with user profile data
* @var array sql_ary user options data we update
* @since 3.1.4-RC1
*/
$vars = array('cp_data', 'data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars)));


$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 434Line 478
					if (!sizeof($error))
{
$message_parser = new parse_message($signature);

					if (!sizeof($error))
{
$message_parser = new parse_message($signature);

 

/**
* Modify user signature on editing profile in UCP
*
* @event core.ucp_profile_modify_signature
* @var bool enable_bbcode Whether or not bbcode is enabled
* @var bool enable_smilies Whether or not smilies are enabled
* @var bool enable_urls Whether or not urls are enabled
* @var string signature Users signature text
* @var object message_parser The message parser object
* @var array error Any error strings
* @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
*/
$vars = array(
'enable_bbcode',
'enable_smilies',
'enable_urls',
'signature',
'message_parser',
'error',
'submit',
'preview',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars)));


// Allowing Quote BBCode
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');


// Allowing Quote BBCode
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');

Line 460Line 530
								'user_sig_bbcode_uid'		=> (string) $message_parser->bbcode_uid,
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
);

								'user_sig_bbcode_uid'		=> (string) $message_parser->bbcode_uid,
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
);

 

/**
* Modify user registration data before submitting it to the database
*
* @event core.ucp_profile_modify_signature_sql_ary
* @var array sql_ary Array with user signature data to submit to the database
* @since 3.1.10-RC1
*/
$vars = array('sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature_sql_ary', compact($vars)));


$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 593Line 673
					}

$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type']));

					}

$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type']));

 

$template->assign_vars(array(
'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
));


foreach ($avatar_drivers as $current_driver)
{


foreach ($avatar_drivers as $current_driver)
{