phpBB

Code Changes

File: includes/acp/acp_users.php

  Unmodified   Added   Modified   Removed
Line 172Line 172

if ($submit)
{


if ($submit)
{

					// You can't delete the founder
if ($delete && $user_row['user_type'] != USER_FOUNDER)

					if ($delete)


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

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

Line 184Line 183
						if ($user_id == ANONYMOUS)
{
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);

						if ($user_id == ANONYMOUS)
{
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);

 
						}

// Founders can not be deleted.
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_REMOVE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);

						}

if ($user_id == $user->data['user_id'])

						}

if ($user_id == $user->data['user_id'])

Line 1007Line 1012
						AND post_approved = 0';
$result = $db->sql_query($sql);
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');

						AND post_approved = 0';
$result = $db->sql_query($sql);
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');

 
				$db->sql_freeresult($result);

$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
WHERE poster_id = '. $user_id;
$result = $db->sql_query_limit($sql, 1);
$user_row['user_has_posts'] = (bool) $db->sql_fetchfield('post_id');

				$db->sql_freeresult($result);

$template->assign_vars(array(

				$db->sql_freeresult($result);

$template->assign_vars(array(

Line 1025Line 1037
					'U_SHOW_IP'		=> $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',

					'U_SHOW_IP'		=> $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',

 
					'U_SEARCH_USER'	=> ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$user_row['user_id']}&sr=posts") : '',


'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '',



'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '',


Line 1036Line 1049
					'USER_EMAIL'		=> $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],

					'USER_EMAIL'		=> $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],

 
					'USER_HAS_POSTS'	=> $user_row['user_has_posts'],

					'USER_INACTIVE_REASON'	=> $inactive_reason,
));


					'USER_INACTIVE_REASON'	=> $inactive_reason,
));


Line 2001Line 2015
					WHERE a.poster_id = ' . $user_id . "
AND a.is_orphan = 0
ORDER BY $order_by";

					WHERE a.poster_id = ' . $user_id . "
AND a.is_orphan = 0
ORDER BY $order_by";

				$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);

				$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);


while ($row = $db->sql_fetchrow($result))
{


while ($row = $db->sql_fetchrow($result))
{

Line 2339Line 2353
	}

/**

	}

/**

	* Optionset replacement for this module based on $user->optionset













	* Set option bit field for user options in a user row array.
*
* Optionset replacement for this module based on $user->optionset.
*
* @param array $user_row Row from the users table.
* @param int $key Option key, as defined in $user->keyoptions property.
* @param bool $value True to set the option, false to clear the option.
* @param int $data Current bit field value, or false to use $user_row['user_options']
* @return int|bool If $data is false, the bit field is modified and
* written back to $user_row['user_options'], and
* return value is true if the bit field changed and
* false otherwise. If $data is not false, the new
* bitfield value is returned.

	*/
function optionset(&$user_row, $key, $value, $data = false)
{
global $user;


	*/
function optionset(&$user_row, $key, $value, $data = false)
{
global $user;


		$var = ($data) ? $data : $user_row['user_options'];

		$var = ($data !== false) ? $data : $user_row['user_options'];





		if ($value && !($var & 1 << $user->keyoptions[$key]))



		$new_var = phpbb_optionset($user->keyoptions[$key], $value, $var);

if ($data === false)

		{

		{

			$var += 1 << $user->keyoptions[$key];
}
else if (!$value && ($var & 1 << $user->keyoptions[$key]))

			if ($new_var != $var)



		{

		{

			$var -= 1 << $user->keyoptions[$key];


				$user_row['user_options'] = $new_var;
return true;

		}
else
{

		}
else
{

			return ($data) ? $var : false;

				return false;

		}

		}


if (!$data)
{
$user_row['user_options'] = $var;
return true;

 
		}
else
{

		}
else
{

			return $var;

			return $new_var;

		}
}

/**

		}
}

/**

	* Optionget replacement for this module based on $user->optionget








	* Get option bit field from user options in a user row array.
*
* Optionget replacement for this module based on $user->optionget.
*
* @param array $user_row Row from the users table.
* @param int $key option key, as defined in $user->keyoptions property.
* @param int $data bit field value to use, or false to use $user_row['user_options']
* @return bool true if the option is set in the bit field, false otherwise

	*/
function optionget(&$user_row, $key, $data = false)
{
global $user;


	*/
function optionget(&$user_row, $key, $data = false)
{
global $user;


		$var = ($data) ? $data : $user_row['user_options'];
return ($var & 1 << $user->keyoptions[$key]) ? true : false;

		$var = ($data !== false) ? $data : $user_row['user_options'];
return phpbb_optionget($user->keyoptions[$key], $var);

	}
}


	}
}