phpBB

Code Changes

File: includes/acp/acp_users.php

  Unmodified   Added   Modified   Removed
Line 690Line 690
							}
$db->sql_freeresult($result);


							}
$db->sql_freeresult($result);


							if (sizeof($topic_id_ary))

							if (count($topic_id_ary))

							{
$sql = 'SELECT topic_id, forum_id, topic_title, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment
FROM ' . TOPICS_TABLE . '

							{
$sql = 'SELECT topic_id, forum_id, topic_title, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment
FROM ' . TOPICS_TABLE . '

Line 718Line 718
							}

// Entire topic comprises posts by this user, move these topics

							}

// Entire topic comprises posts by this user, move these topics

							if (sizeof($move_topic_ary))

							if (count($move_topic_ary))

							{
move_topics($move_topic_ary, $new_forum_id, false);
}


							{
move_topics($move_topic_ary, $new_forum_id, false);
}


							if (sizeof($move_post_ary))

							if (count($move_post_ary))

							{
// Create new topic
// Update post_ids, report_ids, attachment_ids

							{
// Create new topic
// Update post_ids, report_ids, attachment_ids

Line 769Line 769
							$forum_id_ary = array_unique($forum_id_ary);
$topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary));


							$forum_id_ary = array_unique($forum_id_ary);
$topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary));


							if (sizeof($topic_id_ary))

							if (count($topic_id_ary))

							{
sync('topic_reported', 'topic_id', $topic_id_ary);
sync('topic', 'topic_id', $topic_id_ary);
}


							{
sync('topic_reported', 'topic_id', $topic_id_ary);
sync('topic', 'topic_id', $topic_id_ary);
}


							if (sizeof($forum_id_ary))

							if (count($forum_id_ary))

							{
sync('forum', 'forum_id', $forum_id_ary, false, true);
}

							{
sync('forum', 'forum_id', $forum_id_ary, false, true);
}

Line 813Line 813
						break;

default:

						break;

default:

 
							$u_action = $this->u_action;


							/**
* Run custom quicktool code
*
* @event core.acp_users_overview_run_quicktool

							/**
* Run custom quicktool code
*
* @event core.acp_users_overview_run_quicktool

							* @var	array	user_row	Current user data

 
							* @var	string	action		Quick tool that should be run

							* @var	string	action		Quick tool that should be run

 
							* @var	array	user_row	Current user data
* @var string u_action The u_action link

							* @since 3.1.0-a1

							* @since 3.1.0-a1

 
							* @changed 3.2.2-RC1 Added u_action

							*/

							*/

							$vars = array('action', 'user_row');

							$vars = array('action', 'user_row', 'u_action');

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

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

 

unset($u_action);

						break;
}


						break;
}


Line 886Line 892
					$update_password = $data['new_password'] && !$passwords_manager->check($data['new_password'], $user_row['user_password']);
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;


					$update_password = $data['new_password'] && !$passwords_manager->check($data['new_password'], $user_row['user_password']);
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;


					if (!sizeof($error))

					if (!count($error))

					{
$sql_ary = array();


					{
$sql_ary = array();


Line 988Line 994
							));
}


							));
}


						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 1341Line 1347
						{
$s_hidden_fields['delall'] = 1;
}

						{
$s_hidden_fields['delall'] = 1;
}

						if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked)))

						if (isset($_POST['delall']) || (isset($_POST['delmarked']) && count($marked)))

						{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
}

						{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
}

Line 1377Line 1383
							{
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
// It doesn't matter if we add more arguments than placeholders

							{
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
// It doesn't matter if we add more arguments than placeholders

								if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0)

								if ((substr_count($row['action'], '%') - count($log_data_ary)) > 0)

								{

								{

									$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), ''));

									$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - count($log_data_ary), ''));

								}
$row['action'] = vsprintf($row['action'], $log_data_ary);
$row['action'] = bbcode_nl2br(censor_text($row['action']));

								}
$row['action'] = vsprintf($row['action'], $log_data_ary);
$row['action'] = bbcode_nl2br(censor_text($row['action']));

Line 1472Line 1478
					// validate custom profile fields
$cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error);


					// validate custom profile fields
$cp->submit_cp_field('profile', $user_row['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 1485Line 1491
					* Validate profile data in ACP before submitting to the database
*
* @event core.acp_users_profile_validate

					* Validate profile data in ACP before submitting to the database
*
* @event core.acp_users_profile_validate

					* @var	bool	submit		Flag indicating if submit button has been pressed

 
					* @var	array	data		Array with user profile data

					* @var	array	data		Array with user profile data

 
					* @var	int		user_id		The user id
* @var array user_row Array with the full user data

					* @var	array	error		Array with the form errors
* @since 3.1.4-RC1

					* @var	array	error		Array with the form errors
* @since 3.1.4-RC1

 
					* @changed 3.1.12-RC1		Removed submit, added user_id, user_row

					*/

					*/

					$vars = array('submit', 'data', 'error');

					$vars = array('data', 'user_id', 'user_row', 'error');

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


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


					if (!sizeof($error))

					if (!count($error))

					{
$sql_ary = array(
'user_jabber' => $data['jabber'],

					{
$sql_ary = array(
'user_jabber' => $data['jabber'],

Line 1637Line 1645
						$error[] = 'FORM_INVALID';
}


						$error[] = 'FORM_INVALID';
}


					if (!sizeof($error))

					if (!count($error))

					{
$this->optionset($user_row, 'viewimg', $data['view_images']);
$this->optionset($user_row, 'viewflash', $data['view_flash']);

					{
$this->optionset($user_row, 'viewimg', $data['view_images']);
$this->optionset($user_row, 'viewflash', $data['view_flash']);

Line 1688Line 1696
						$vars = array('data', 'user_row', 'sql_ary', 'error');
extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_sql', compact($vars)));


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


						if (!sizeof($error))

						if (!count($error))

						{
$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 2052Line 2060
					'sig'
);


					'sig'
);


				if (sizeof($warn_msg))

				if (count($warn_msg))

				{
$error += $warn_msg;
}

				{
$error += $warn_msg;
}

Line 2064Line 2072
				}
else
{

				}
else
{

					if (!sizeof($error))

					if (!count($error))

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

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

Line 2139Line 2147
				$sort_key	= $request->variable('sk', 'a');
$sort_dir = $request->variable('sd', 'd');


				$sort_key	= $request->variable('sk', 'a');
$sort_dir = $request->variable('sd', 'd');


				if ($deletemark && sizeof($marked))

				if ($deletemark && count($marked))

				{
$sql = 'SELECT attach_id
FROM ' . ATTACHMENTS_TABLE . '

				{
$sql = 'SELECT attach_id
FROM ' . ATTACHMENTS_TABLE . '

Line 2156Line 2164
					$db->sql_freeresult($result);
}


					$db->sql_freeresult($result);
}


				if ($deletemark && sizeof($marked))

				if ($deletemark && count($marked))

				{
if (confirm_box(true))
{

				{
if (confirm_box(true))
{

Line 2177Line 2185
						$attachment_manager->delete('attach', $marked);
unset($attachment_manager);


						$attachment_manager->delete('attach', $marked);
unset($attachment_manager);


						$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];

						$message = (count($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];


$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode($user->lang['COMMA_SEPARATOR'], $log_attachments)));
trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id));


$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode($user->lang['COMMA_SEPARATOR'], $log_attachments)));
trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id));

Line 2447Line 2455
				// Select box for other groups
$sql = 'SELECT group_id, group_name, group_type, group_founder_manage
FROM ' . GROUPS_TABLE . '

				// Select box for other groups
$sql = 'SELECT group_id, group_name, group_type, group_founder_manage
FROM ' . GROUPS_TABLE . '

					' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '

					' . ((count($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '

					ORDER BY group_type DESC, group_name ASC';
$result = $db->sql_query($sql);


					ORDER BY group_type DESC, group_name ASC';
$result = $db->sql_query($sql);


Line 2489Line 2497
							'U_DELETE'			=> $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '',


							'U_DELETE'			=> $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '',


							'GROUP_NAME'		=> ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'],

							'GROUP_NAME'		=> $group_helper->get_name($data['group_name']),

							'L_DEMOTE_PROMOTE'	=> ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],

'S_IS_MEMBER' => ($group_type != 'pending') ? true : false,

							'L_DEMOTE_PROMOTE'	=> ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],

'S_IS_MEMBER' => ($group_type != 'pending') ? true : false,

Line 2576Line 2584

break;



break;


 
			default:

/**
* Additional modes provided by extensions
*
* @event core.acp_users_mode_add
* @var string mode New mode
* @var int user_id User id of the user to manage
* @var array user_row Array with user data
* @var array error Array with errors data
* @since 3.2.2-RC1
*/
$vars = array('mode', 'user_id', 'user_row', 'error');
extract($phpbb_dispatcher->trigger_event('core.acp_users_mode_add', compact($vars)));

break;

		}

// Assign general variables
$template->assign_vars(array(

		}

// Assign general variables
$template->assign_vars(array(

			'S_ERROR'			=> (sizeof($error)) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '')

			'S_ERROR'			=> (count($error)) ? true : false,
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '')

		);
}


		);
}