From 9a1df948c635d9dbabaff94313652c6d8d1df28d Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 19 Dec 2012 21:50:03 -0500 Subject: [ticket/10758] Extract obtain_user_data for the benefit of tests. PHPBB3-10758 --- phpBB/includes/auth/auth.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'phpBB/includes/auth') diff --git a/phpBB/includes/auth/auth.php b/phpBB/includes/auth/auth.php index 1ad9f94d26..2535247571 100644 --- a/phpBB/includes/auth/auth.php +++ b/phpBB/includes/auth/auth.php @@ -102,6 +102,26 @@ class phpbb_auth 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 * @access private -- cgit v1.2.1