mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/10758] Extract obtain_user_data for the benefit of tests.
PHPBB3-10758
This commit is contained in:
parent
7b9092ea3b
commit
9a1df948c6
@ -952,12 +952,7 @@ class acp_permissions
|
|||||||
|
|
||||||
if ($user_id != $user->data['user_id'])
|
if ($user_id != $user->data['user_id'])
|
||||||
{
|
{
|
||||||
$sql = 'SELECT user_id, username, user_permissions, user_type
|
$userdata = $auth->obtain_user_data($user_id);
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_id = ' . $user_id;
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$userdata = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -102,6 +102,26 @@ class phpbb_auth
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves data wanted by acl function from the database for the
|
||||||
|
* specified user.
|
||||||
|
*
|
||||||
|
* @param int $user_id User ID
|
||||||
|
* @return array User attributes
|
||||||
|
*/
|
||||||
|
public function obtain_user_data($user_id)
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$sql = 'SELECT user_id, username, user_permissions, user_type
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_id = ' . $user_id;
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$user_data = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
return $user_data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill ACL array with relevant bitstrings from user_permissions column
|
* Fill ACL array with relevant bitstrings from user_permissions column
|
||||||
* @access private
|
* @access private
|
||||||
|
Loading…
x
Reference in New Issue
Block a user