phpBB

Code Changes

File: includes/acp/acp_users.php

  Unmodified   Added   Modified   Removed
Line 31Line 31

function main($id, $mode)
{


function main($id, $mode)
{

		global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;

		global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;

		global $phpbb_dispatcher, $request;

		global $phpbb_dispatcher, $request;

		global $phpbb_container;

		global $phpbb_container, $phpbb_log;


$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';

$error = array();


$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';

$error = array();

		$username	= utf8_normalize_nfc(request_var('username', '', true));
$user_id = request_var('u', 0);
$action = request_var('action', '');






		$username	= $request->variable('username', '', true);
$user_id = $request->variable('u', 0);
$action = $request->variable('action', '');

// Get referer to redirect user to the appropriate page after delete action
$redirect = $request->variable('redirect', '');
$redirect_tag = "redirect=$redirect";
$redirect_url = append_sid("{$phpbb_admin_path}index.$phpEx", "i=$redirect");


$submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false;



$submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false;


Line 51Line 56

// Whois (special case)
if ($action == 'whois')


// Whois (special case)
if ($action == 'whois')

 
		{
if (!function_exists('user_get_id_name'))

		{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

		{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);

 
			}


$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';



$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';


			$user_ip = phpbb_ip_normalise(request_var('user_ip', ''));

			$user_ip = phpbb_ip_normalise($request->variable('user_ip', ''));

			$domain = gethostbyaddr($user_ip);
$ipwhois = user_ipwhois($user_ip);


			$domain = gethostbyaddr($user_ip);
$ipwhois = user_ipwhois($user_ip);


Line 146Line 154
		}

$template->assign_vars(array(

		}

$template->assign_vars(array(

			'U_BACK'			=> $this->u_action,

			'U_BACK'			=> (empty($redirect)) ? $this->u_action : $redirect_url,

			'U_MODE_SELECT'		=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"),

			'U_MODE_SELECT'		=> append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"),

			'U_ACTION'			=> $this->u_action . '&u=' . $user_id,

			'U_ACTION'			=> $this->u_action . '&u=' . $user_id . ((empty($redirect)) ? '' : '&' . $redirect_tag),

			'S_FORM_OPTIONS'	=> $s_form_options,
'MANAGED_USERNAME' => $user_row['username'])
);

			'S_FORM_OPTIONS'	=> $s_form_options,
'MANAGED_USERNAME' => $user_row['username'])
);

Line 165Line 173
		{
case 'overview':


		{
case 'overview':


 
				if (!function_exists('user_get_id_name'))
{

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

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

 
				}


$user->add_lang('acp/ban');



$user->add_lang('acp/ban');


				$delete			= request_var('delete', 0);
$delete_type = request_var('delete_type', '');
$ip = request_var('ip', 'ip');
















				$delete			= $request->variable('delete', 0);
$delete_type = $request->variable('delete_type', '');
$ip = $request->variable('ip', 'ip');

/**
* Run code at beginning of ACP users overview
*
* @event core.acp_users_overview_before
* @var array user_row Current user data
* @var string mode Active module
* @var string action Module that should be run
* @var bool submit Do we display the form only
* or did the user press submit
* @var array error Array holding error messages
* @since 3.1.3-RC1
*/
$vars = array('user_row', 'mode', 'action', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_before', compact($vars)));


if ($submit)
{


if ($submit)
{

Line 179Line 205
					{
if (!$auth->acl_get('a_userdel'))
{

					{
if (!$auth->acl_get('a_userdel'))
{

 
							send_status_line(403, 'Forbidden');

							trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}


							trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}


Line 205Line 232
							{
user_delete($delete_type, $user_id, $user_row['username']);


							{
user_delete($delete_type, $user_id, $user_row['username']);


								add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));




								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DELETED', false, array($user_row['username']));
trigger_error($user->lang['USER_DELETED'] . adm_back_link(
(empty($redirect)) ? $this->u_action : $redirect_url
)
);

							}
else
{

							}
else
{

								confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(

								$delete_confirm_hidden_fields = array(

									'u'				=> $user_id,
'i' => $id,
'mode' => $mode,
'action' => $action,
'update' => true,
'delete' => 1,

									'u'				=> $user_id,
'i' => $id,
'mode' => $mode,
'action' => $action,
'update' => true,
'delete' => 1,

									'delete_type'	=> $delete_type))

									'delete_type'	=> $delete_type,

								);

								);

 

// Checks if the redirection page is specified
if (!empty($redirect))
{
$delete_confirm_hidden_fields['redirect'] = $redirect;
}

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

							}
}
else

							}
}
else

Line 261Line 299
								case 'banuser':
$ban[] = $user_row['username'];
$reason = 'USER_ADMIN_BAN_NAME_REASON';

								case 'banuser':
$ban[] = $user_row['username'];
$reason = 'USER_ADMIN_BAN_NAME_REASON';

									$log = 'LOG_USER_BAN_USER';

 
								break;

case 'banemail':
$ban[] = $user_row['user_email'];
$reason = 'USER_ADMIN_BAN_EMAIL_REASON';

								break;

case 'banemail':
$ban[] = $user_row['user_email'];
$reason = 'USER_ADMIN_BAN_EMAIL_REASON';

									$log = 'LOG_USER_BAN_EMAIL';

 
								break;

case 'banip':

								break;

case 'banip':

Line 285Line 321
									$db->sql_freeresult($result);

$reason = 'USER_ADMIN_BAN_IP_REASON';

									$db->sql_freeresult($result);

$reason = 'USER_ADMIN_BAN_IP_REASON';

									$log = 'LOG_USER_BAN_IP';

 
								break;
}


								break;
}


							$ban_reason = utf8_normalize_nfc(request_var('ban_reason', $user->lang[$reason], true));
$ban_give_reason = utf8_normalize_nfc(request_var('ban_give_reason', '', true));

							$ban_reason = $request->variable('ban_reason', $user->lang[$reason], true);
$ban_give_reason = $request->variable('ban_give_reason', '', true);


// Log not used at the moment, we simply utilize the ban function.
$result = user_ban(substr($action, 3), $ban, 0, 0, 0, $ban_reason, $ban_give_reason);


// Log not used at the moment, we simply utilize the ban function.
$result = user_ban(substr($action, 3), $ban, 0, 0, 0, $ban_reason, $ban_give_reason);

Line 323Line 358

if ($config['email_enable'])
{


if ($config['email_enable'])
{

								include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);




								if (!class_exists('messenger'))
{
include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


$server_url = generate_board_url();



$server_url = generate_board_url();


Line 333Line 371
								if ($user_row['user_type'] == USER_NORMAL)
{
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);

								if ($user_row['user_type'] == USER_NORMAL)
{
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);


$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);

 
								}
else
{

								}
else
{

Line 346Line 379
										FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);

										FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);

									$user_actkey = (string) $db->sql_fetchfield('user_actkey');

									$user_activation_key = (string) $db->sql_fetchfield('user_actkey');

									$db->sql_freeresult($result);

									$db->sql_freeresult($result);

 

$user_actkey = empty($user_activation_key) ? $user_actkey : $user_activation_key;
}

if ($user_row['user_type'] == USER_NORMAL || empty($user_activation_key))
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);

								}

$messenger = new messenger(false);

								}

$messenger = new messenger(false);

Line 366Line 409

$messenger->send(NOTIFY_EMAIL);



$messenger->send(NOTIFY_EMAIL);


								add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');



								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_REACTIVATE', false, array($user_row['username']));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_REACTIVATE_USER', false, array(
'reportee_id' => $user_id
));


trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action . '&u=' . $user_id));
}


trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action . '&u=' . $user_id));
}

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

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

 
									/* @var $phpbb_notifications \phpbb\notification\manager */

									$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);


									$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);


									include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);




									if (!class_exists('messenger'))
{
include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}


$messenger = new messenger(false);



$messenger = new messenger(false);


Line 427Line 476
							$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';


							$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';


							add_log('admin', $log, $user_row['username']);
add_log('user', $user_id, $log . '_USER');



							$phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($user_row['username']));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, $log . '_USER', false, array(
'reportee_id' => $user_id
));


trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));



trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));


Line 451Line 502
								WHERE user_id = $user_id";
$db->sql_query($sql);


								WHERE user_id = $user_id";
$db->sql_query($sql);


							add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_DEL_SIG_USER');



							$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_SIG', false, array($user_row['username']));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_SIG_USER', false, array(
'reportee_id' => $user_id
));


trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));



trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));


Line 466Line 519
							}

// Delete old avatar if present

							}

// Delete old avatar if present

 
							/* @var $phpbb_avatar_manager \phpbb\avatar\manager */

							$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$phpbb_avatar_manager->handle_avatar_delete($db, $user, $phpbb_avatar_manager->clean_row($user_row, 'user'), USERS_TABLE, 'user_');


							$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$phpbb_avatar_manager->handle_avatar_delete($db, $user, $phpbb_avatar_manager->clean_row($user_row, 'user'), USERS_TABLE, 'user_');


							add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER');



							$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_AVATAR', false, array($user_row['username']));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_AVATAR_USER', false, array(
'reportee_id' => $user_id
));


trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));
break;


trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));
break;

Line 482Line 538
								// Delete posts, attachments, etc.
delete_posts('poster_id', $user_id);


								// Delete posts, attachments, etc.
delete_posts('poster_id', $user_id);


								add_log('admin', 'LOG_USER_DEL_POSTS', $user_row['username']);

								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_POSTS', false, array($user_row['username']));

								trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

								trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

Line 502Line 558

if (confirm_box(true))
{


if (confirm_box(true))
{

								delete_attachments('user', $user_id);




								/** @var \phpbb\attachment\manager $attachment_manager */
$attachment_manager = $phpbb_container->get('attachment.manager');
$attachment_manager->delete('user', $user_id);
unset($attachment_manager);





								add_log('admin', 'LOG_USER_DEL_ATTACH', $user_row['username']);

								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_ATTACH', false, array($user_row['username']));

								trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

								trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

Line 550Line 609

delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);



delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);


									add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']);

									$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_OUTBOX', false, array($user_row['username']));


$lang = 'EMPTIED';
}


$lang = 'EMPTIED';
}

Line 579Line 638

$user->add_lang('acp/forums');



$user->add_lang('acp/forums');


							$new_forum_id = request_var('new_f', 0);

							$new_forum_id = $request->variable('new_f', 0);


if (!$new_forum_id)
{


if (!$new_forum_id)
{

Line 721Line 780
								sync('forum', 'forum_id', $forum_id_ary, false, true);
}


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


							add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);




							$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_MOVE_POSTS', false, array($user_row['username'], $forum_info['forum_name']));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_MOVE_POSTS_USER', false, array(
'reportee_id' => $user_id,
$forum_info['forum_name']
));


trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));



trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&u=' . $user_id));


Line 734Line 796
							{
remove_newly_registered($user_id, $user_row);


							{
remove_newly_registered($user_id, $user_row);


								add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']);

								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_REMOVED_NR', false, array($user_row['username']));

								trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

								trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
else

Line 766Line 828

// Handle registration info updates
$data = array(


// Handle registration info updates
$data = array(

						'username'			=> utf8_normalize_nfc(request_var('user', $user_row['username'], true)),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => strtolower(request_var('user_email', $user_row['user_email'])),

						'username'			=> $request->variable('user', $user_row['username'], true),
'user_founder' => $request->variable('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => strtolower($request->variable('user_email', $user_row['user_email'])),

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

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

Line 816Line 878
					}

// Instantiate passwords manager

					}

// Instantiate passwords manager

 
					/* @var $passwords_manager \phpbb\passwords\manager */

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

// Which updates do we need to do?

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

// Which updates do we need to do?

Line 888Line 951
							$sql_ary['username'] = $update_username;
$sql_ary['username_clean'] = utf8_clean_string($update_username);


							$sql_ary['username'] = $update_username;
$sql_ary['username_clean'] = utf8_clean_string($update_username);


							add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);





							$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_NAME', false, array(
'reportee_id' => $user_id,
$user_row['username'],
$update_username
));

						}

if ($update_email !== false)

						}

if ($update_email !== false)

Line 898Line 965
								'user_email_hash'	=> phpbb_email_hash($update_email),
);


								'user_email_hash'	=> phpbb_email_hash($update_email),
);


							add_log('user', $user_id, 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email);






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

						}

if ($update_password)

						}

if ($update_password)

Line 909Line 981
							);

$user->reset_login_keys($user_id);

							);

$user->reset_login_keys($user_id);

							add_log('user', $user_id, 'LOG_USER_NEW_PASSWORD', $user_row['username']);






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

						}

if (sizeof($sql_ary))

						}

if (sizeof($sql_ary))

Line 928Line 1004
						// Let the users permissions being updated
$auth->acl_clear_prefetch($user_id);


						// Let the users permissions being updated
$auth->acl_clear_prefetch($user_id);


						add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);

						$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_USER_UPDATE', false, array($data['username']));


trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}


trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}

Line 1085Line 1161
				$user->add_lang('mcp');

// Set up general vars

				$user->add_lang('mcp');

// Set up general vars

				$start		= request_var('start', 0);

				$start		= $request->variable('start', 0);

				$deletemark = (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;

				$deletemark = (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;

				$marked		= request_var('mark', array(0));
$message = utf8_normalize_nfc(request_var('message', '', true));



				$marked		= $request->variable('mark', array(0));
$message = $request->variable('message', '', true);

/* @var $pagination \phpbb\pagination */

				$pagination = $phpbb_container->get('pagination');

// Sort keys

				$pagination = $phpbb_container->get('pagination');

// Sort keys

				$sort_days	= request_var('st', 0);
$sort_key = request_var('sk', 't');
$sort_dir = request_var('sd', 'd');

				$sort_days	= $request->variable('st', 0);
$sort_key = $request->variable('sk', 't');
$sort_dir = $request->variable('sd', 'd');


// Delete entries if requested and able
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))


// Delete entries if requested and able
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))

Line 1125Line 1203
							$where_sql";
$db->sql_query($sql);


							$where_sql";
$db->sql_query($sql);


						add_log('admin', 'LOG_CLEAR_USER', $user_row['username']);

						$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CLEAR_USER', false, array($user_row['username']));

					}
}


					}
}


Line 1136Line 1214
						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}


						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}


					add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_GENERAL', $message);








					$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array($user_row['username']));
$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array(
'forum_id' => 0,
'topic_id' => 0,
$user_row['username']
));
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GENERAL', false, array(
'reportee_id' => $user_id,
$message
));


trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}


trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}

Line 1189Line 1274
				$user->add_lang('mcp');

// Set up general vars

				$user->add_lang('mcp');

// Set up general vars

				$start		= request_var('start', 0);

 
				$deletemark	= (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;

				$deletemark	= (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;

				$marked		= request_var('mark', array(0));
$message = utf8_normalize_nfc(request_var('message', '', true));

// Sort keys
$sort_days = request_var('st', 0);
$sort_key = request_var('sk', 't');
$sort_dir = request_var('sd', 'd');

				$marked		= $request->variable('mark', array(0));








// Delete entries if requested and able
if ($deletemark || $deleteall || $confirm)


// Delete entries if requested and able
if ($deletemark || $deleteall || $confirm)

Line 1207Line 1285
					if (confirm_box(true))
{
$where_sql = '';

					if (confirm_box(true))
{
$where_sql = '';

						$deletemark = request_var('delmarked', 0);
$deleteall = request_var('delall', 0);

						$deletemark = $request->variable('delmarked', 0);
$deleteall = $request->variable('delall', 0);

						if ($deletemark && $marked)
{
$where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked));

						if ($deletemark && $marked)
{
$where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked));

Line 1239Line 1317

if ($log_warnings)
{


if ($log_warnings)
{

								add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);

								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_WARNINGS_DELETED', false, array($user_row['username'], $num_warnings));

							}
else
{

							}
else
{

								add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);

								$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_WARNINGS_DELETED_ALL', false, array($user_row['username']));

							}
}
}

							}
}
}

Line 1330Line 1408

case 'profile':



case 'profile':


 
				if (!function_exists('user_get_id_name'))
{

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

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

 
				}





 
				/* @var $cp \phpbb\profilefields\manager */

				$cp = $phpbb_container->get('profilefields.manager');

$cp_data = $cp_error = array();

				$cp = $phpbb_container->get('profilefields.manager');

$cp_data = $cp_error = array();

Line 1346Line 1428
				$user_row['iso_lang_id'] = $row['lang_id'];

$data = array(

				$user_row['iso_lang_id'] = $row['lang_id'];

$data = array(

					'jabber'		=> utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)),

					'jabber'		=> $request->variable('jabber', $user_row['user_jabber'], true),

					'bday_day'		=> 0,
'bday_month' => 0,
'bday_year' => 0,

					'bday_day'		=> 0,
'bday_month' => 0,
'bday_year' => 0,

Line 1357Line 1439
					list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
}


					list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
}


				$data['bday_day']		= request_var('bday_day', $data['bday_day']);
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
$data['bday_year'] = request_var('bday_year', $data['bday_year']);

				$data['bday_day']		= $request->variable('bday_day', $data['bday_day']);
$data['bday_month'] = $request->variable('bday_month', $data['bday_month']);
$data['bday_year'] = $request->variable('bday_year', $data['bday_year']);

				$data['user_birthday']	= sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $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 ACP
*
* @event core.acp_users_modify_profile
* @var array data Array with user profile data
* @var bool submit Flag indicating if submit button has been pressed
* @var int user_id The user id
* @var array user_row Array with the full user data
* @since 3.1.4-RC1
*/
$vars = array('data', 'submit', 'user_id', 'user_row');
extract($phpbb_dispatcher->trigger_event('core.acp_users_modify_profile', compact($vars)));


if ($submit)
{


if ($submit)
{

Line 1385Line 1480
					{
$error[] = 'FORM_INVALID';
}

					{
$error[] = 'FORM_INVALID';
}

 

/**
* 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 error Array with the form errors
* @since 3.1.4-RC1
*/
$vars = array('submit', 'data', 'error');
extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars)));


if (!sizeof($error))
{


if (!sizeof($error))
{

Line 1392Line 1499
							'user_jabber'	=> $data['jabber'],
'user_birthday' => $data['user_birthday'],
);

							'user_jabber'	=> $data['jabber'],
'user_birthday' => $data['user_birthday'],
);

 

/**
* Modify profile data in ACP before submitting to the database
*
* @event core.acp_users_profile_modify_sql_ary
* @var array cp_data Array with the user custom profile fields 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 sql_ary Array with sql data
* @since 3.1.4-RC1
*/
$vars = array('cp_data', 'data', 'user_id', 'user_row', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_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 1421Line 1542
					$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
}

					$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
}

				$s_birthday_year_options = '';

 

$now = getdate();
$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';


$now = getdate();
$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';

Line 1450Line 1570

case 'prefs':



case 'prefs':


 
				if (!function_exists('user_get_id_name'))
{

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

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

 
				}


$data = array(


$data = array(

					'dateformat'		=> utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
'lang' => basename(request_var('lang', $user_row['user_lang'])),
'tz' => request_var('tz', $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']),
'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']),
'massemail' => request_var('massemail', $user_row['user_allow_massemail']),
'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']),
'notifypm' => request_var('notifypm', $user_row['user_notify_pm']),
'allowpm' => request_var('allowpm', $user_row['user_allow_pm']),

					'dateformat'		=> $request->variable('dateformat', $user_row['user_dateformat'], true),
'lang' => basename($request->variable('lang', $user_row['user_lang'])),
'tz' => $request->variable('tz', $user_row['user_timezone']),
'style' => $request->variable('style', $user_row['user_style']),
'viewemail' => $request->variable('viewemail', $user_row['user_allow_viewemail']),
'massemail' => $request->variable('massemail', $user_row['user_allow_massemail']),
'hideonline' => $request->variable('hideonline', !$user_row['user_allow_viewonline']),
'notifymethod' => $request->variable('notifymethod', $user_row['user_notify_type']),
'notifypm' => $request->variable('notifypm', $user_row['user_notify_pm']),
'allowpm' => $request->variable('allowpm', $user_row['user_allow_pm']),





					'topic_sk'			=> request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
'topic_sd' => request_var('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'),
'topic_st' => request_var('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0),

					'topic_sk'			=> $request->variable('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
'topic_sd' => $request->variable('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'),
'topic_st' => $request->variable('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0),





					'post_sk'			=> request_var('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'),
'post_sd' => request_var('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'),
'post_st' => request_var('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0),

					'post_sk'			=> $request->variable('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'),
'post_sd' => $request->variable('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'),
'post_st' => $request->variable('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0),





					'view_images'		=> request_var('view_images', $this->optionget($user_row, 'viewimg')),
'view_flash' => request_var('view_flash', $this->optionget($user_row, 'viewflash')),
'view_smilies' => request_var('view_smilies', $this->optionget($user_row, 'viewsmilies')),
'view_sigs' => request_var('view_sigs', $this->optionget($user_row, 'viewsigs')),
'view_avatars' => request_var('view_avatars', $this->optionget($user_row, 'viewavatars')),
'view_wordcensor' => request_var('view_wordcensor', $this->optionget($user_row, 'viewcensors')),

					'view_images'		=> $request->variable('view_images', $this->optionget($user_row, 'viewimg')),
'view_flash' => $request->variable('view_flash', $this->optionget($user_row, 'viewflash')),
'view_smilies' => $request->variable('view_smilies', $this->optionget($user_row, 'viewsmilies')),
'view_sigs' => $request->variable('view_sigs', $this->optionget($user_row, 'viewsigs')),
'view_avatars' => $request->variable('view_avatars', $this->optionget($user_row, 'viewavatars')),
'view_wordcensor' => $request->variable('view_wordcensor', $this->optionget($user_row, 'viewcensors')),





					'bbcode'	=> request_var('bbcode', $this->optionget($user_row, 'bbcode')),
'smilies' => request_var('smilies', $this->optionget($user_row, 'smilies')),
'sig' => request_var('sig', $this->optionget($user_row, 'attachsig')),
'notify' => request_var('notify', $user_row['user_notify']),

					'bbcode'	=> $request->variable('bbcode', $this->optionget($user_row, 'bbcode')),
'smilies' => $request->variable('smilies', $this->optionget($user_row, 'smilies')),
'sig' => $request->variable('sig', $this->optionget($user_row, 'attachsig')),
'notify' => $request->variable('notify', $user_row['user_notify']),

				);

/**

				);

/**

Line 1499Line 1622
				if ($submit)
{
$error = validate_data($data, array(

				if ($submit)
{
$error = validate_data($data, array(

						'dateformat'	=> array('string', false, 1, 30),

						'dateformat'	=> array('string', false, 1, 64),

						'lang'			=> array('match', false, '#^[a-z_\-]{2,}$#i'),
'tz' => array('timezone'),


						'lang'			=> array('match', false, '#^[a-z_\-]{2,}$#i'),
'tz' => array('timezone'),


Line 1719Line 1842
			break;

case 'avatar':

			break;

case 'avatar':


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

 

$avatars_enabled = false;


$avatars_enabled = false;

 
				/** @var \phpbb\avatar\manager $phpbb_avatar_manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');


if ($config['allow_avatar'])
{


if ($config['allow_avatar'])
{

					$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');

 
					$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();

// This is normalised data, without the user_ prefix

					$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();

// This is normalised data, without the user_ prefix

Line 1786Line 1908
					}

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

					}

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

 

// Assign min and max values before generating avatar driver html
$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)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);

$avatars_enabled = true;


foreach ($avatar_drivers as $current_driver)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);

$avatars_enabled = true;

						$config_name = $phpbb_avatar_manager->get_driver_config_name($driver);

 
						$template->set_filenames(array(

						$template->set_filenames(array(

							'avatar' => "acp_avatar_options_{$config_name}.html",

							'avatar' => $driver->get_acp_template_name(),

						));

if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))

						));

if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))

Line 1814Line 1943
					}
}


					}
}


 
				// Avatar manager is not initialized if avatars are disabled
if (isset($phpbb_avatar_manager))
{

				// Replace "error" strings with their real, localised form
$error = $phpbb_avatar_manager->localize_errors($user, $error);

				// Replace "error" strings with their real, localised form
$error = $phpbb_avatar_manager->localize_errors($user, $error);

 
				}


$avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true);



$avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true);


Line 1826Line 1959

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



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


					'L_AVATAR_EXPLAIN'	=> sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),

					'L_AVATAR_EXPLAIN'	=> $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN', $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),


'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
));


'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
));

Line 1842Line 1975
						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}


						trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}


					$rank_id = request_var('user_rank', 0);

					$rank_id = $request->variable('user_rank', 0);


$sql = 'UPDATE ' . USERS_TABLE . "
SET user_rank = $rank_id


$sql = 'UPDATE ' . USERS_TABLE . "
SET user_rank = $rank_id

Line 1876Line 2009

case 'sig':



case 'sig':


				include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);



				if (!function_exists('display_custom_bbcodes'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}





				$enable_bbcode	= ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false;
$enable_smilies = ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false;
$enable_urls = ($config['allow_sig_links']) ? (bool) $this->optionget($user_row, 'sig_links') : false;
$signature = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true));

				$enable_bbcode	= ($config['allow_sig_bbcode']) ? $this->optionget($user_row, 'sig_bbcode') : false;
$enable_smilies = ($config['allow_sig_smilies']) ? $this->optionget($user_row, 'sig_smilies') : false;
$enable_urls = ($config['allow_sig_links']) ? $this->optionget($user_row, 'sig_links') : false;






				$preview		= (isset($_POST['preview'])) ? true : false;

				$bbcode_flags = ($enable_bbcode ? OPTION_FLAG_BBCODE : 0) + ($enable_smilies ? OPTION_FLAG_SMILIES : 0) + ($enable_urls ? OPTION_FLAG_LINKS : 0);





				if ($submit || $preview)





				$decoded_message	= generate_text_for_edit($user_row['user_sig'], $user_row['user_sig_bbcode_uid'], $bbcode_flags);
$signature = $request->variable('signature', $decoded_message['text'], true);
$signature_preview = '';

if ($submit || $request->is_set_post('preview'))

				{

				{

					include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);



					$enable_bbcode	= ($config['allow_sig_bbcode']) ? !$request->variable('disable_bbcode', false) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? !$request->variable('disable_smilies', false) : false;
$enable_urls = ($config['allow_sig_links']) ? !$request->variable('disable_magic_url', false) : false;





					$enable_bbcode	= ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
$enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;



					if (!check_form_key($form_name))
{
$error[] = 'FORM_INVALID';
}
}





					$message_parser = new parse_message($signature);

// 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');












				$bbcode_uid = $bbcode_bitfield = $bbcode_flags = '';
$warn_msg = generate_text_for_storage(
$signature,
$bbcode_uid,
$bbcode_bitfield,
$bbcode_flags,
$enable_bbcode,
$enable_urls,
$enable_smilies,
$config['allow_sig_img'],
$config['allow_sig_flash'],
true,
$config['allow_sig_links'],
'sig'
);





					if (sizeof($message_parser->warn_msg))

				if (sizeof($warn_msg))

					{

					{

						$error[] = implode('<br />', $message_parser->warn_msg);

					$error += $warn_msg;

					}


					}


					if (!check_form_key($form_name))

				if (!$submit)

					{

					{

						$error = 'FORM_INVALID';


					// Parse it for displaying
$signature_preview = generate_text_for_display($signature, $bbcode_uid, $bbcode_bitfield, $bbcode_flags);

					}

					}


if (!sizeof($error) && $submit)


				else
{
if (!sizeof($error))

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

$sql_ary = array(

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

$sql_ary = array(

							'user_sig'					=> (string) $message_parser->message,

							'user_sig'					=> $signature,

							'user_options'				=> $user_row['user_options'],

							'user_options'				=> $user_row['user_options'],

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

							'user_sig_bbcode_uid'		=> $bbcode_uid,
'user_sig_bbcode_bitfield' => $bbcode_bitfield,

						);

$sql = 'UPDATE ' . USERS_TABLE . '

						);

$sql = 'UPDATE ' . USERS_TABLE . '

Line 1928Line 2083
						$db->sql_query($sql);

trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));

						$db->sql_query($sql);

trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));

 
					}

					}

// Replace "error" strings with their real, localised form
$error = array_map(array($user, 'lang'), $error);

					}

// Replace "error" strings with their real, localised form
$error = array_map(array($user, 'lang'), $error);

				}

$signature_preview = '';

 




				if ($preview)

				if ($request->is_set_post('preview'))

				{

				{

					// Now parse it for displaying
$signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
unset($message_parser);

					$decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);



				}


				}


				decode_message($signature, $user_row['user_sig_bbcode_uid']);


				/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');


$template->assign_vars(array(
'S_SIGNATURE' => true,



$template->assign_vars(array(
'S_SIGNATURE' => true,


					'SIGNATURE'			=> $signature,

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

					'SIGNATURE_PREVIEW'	=> $signature_preview,

'S_BBCODE_CHECKED' => (!$enable_bbcode) ? ' checked="checked"' : '',
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',


					'SIGNATURE_PREVIEW'	=> $signature_preview,

'S_BBCODE_CHECKED' => (!$enable_bbcode) ? ' checked="checked"' : '',
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',


					'BBCODE_STATUS'			=> ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),

					'BBCODE_STATUS'			=> $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),

					'SMILIES_STATUS'		=> ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],

					'SMILIES_STATUS'		=> ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],

Line 1976Line 2128
			break;

case 'attach':

			break;

case 'attach':

 
				/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');





				$start		= request_var('start', 0);

				$start		= $request->variable('start', 0);

				$deletemark = (isset($_POST['delmarked'])) ? true : false;

				$deletemark = (isset($_POST['delmarked'])) ? true : false;

				$marked		= request_var('mark', array(0));
$pagination = $phpbb_container->get('pagination');

				$marked		= $request->variable('mark', array(0));



// Sort keys


// Sort keys

				$sort_key	= request_var('sk', 'a');
$sort_dir = request_var('sd', 'd');

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


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


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

Line 2019Line 2172
						}
$db->sql_freeresult($result);


						}
$db->sql_freeresult($result);


						delete_attachments('attach', $marked);




						/** @var \phpbb\attachment\manager $attachment_manager */
$attachment_manager = $phpbb_container->get('attachment.manager');
$attachment_manager->delete('attach', $marked);
unset($attachment_manager);


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



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


						add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments));

						$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 . '&amp;u=' . $user_id));
}
else

						trigger_error($message . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else

Line 2129Line 2285

case 'groups':



case 'groups':


 
				if (!function_exists('group_user_attributes'))
{

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

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

 
				}


$user->add_lang(array('groups', 'acp/groups'));


$user->add_lang(array('groups', 'acp/groups'));

				$group_id = request_var('g', 0);

				$group_id = $request->variable('g', 0);


if ($group_id)
{


if ($group_id)
{

Line 2148Line 2307
					{
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}

					{
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}

				}
else
{
$founder_manage = 0;

 
				}

switch ($action)

				}

switch ($action)

Line 2163Line 2318
						{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}

						{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}

 

if (!check_link_hash($request->variable('hash', ''), 'acp_users'))
{
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}


						group_user_attributes($action, $group_id, $user_id);

if ($action == 'default')

						group_user_attributes($action, $group_id, $user_id);

if ($action == 'default')

Line 2256Line 2417

$error = array();
}


$error = array();
}

 

/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug


$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug

Line 2301Line 2465
						continue;
}


						continue;
}


					$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';

					$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';

				}
$db->sql_freeresult($result);


				}
$db->sql_freeresult($result);


Line 2320Line 2484
					{
$template->assign_block_vars('group', array(
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),

					{
$template->assign_block_vars('group', array(
'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),

							'U_DEFAULT'			=> $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],

							'U_DEFAULT'			=> $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;hash=' . generate_link_hash('acp_users'),

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


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


Line 2345Line 2509

case 'perm':



case 'perm':


				include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);




				if (!class_exists('auth_admin'))
{
include($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
}


$auth_admin = new auth_admin();

$user->add_lang('acp/permissions');
add_permission_language();



$auth_admin = new auth_admin();

$user->add_lang('acp/permissions');
add_permission_language();


				$forum_id = request_var('f', 0);

				$forum_id = $request->variable('f', 0);


// Global Permissions
if (!$forum_id)


// Global Permissions
if (!$forum_id)