diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-19 21:50:03 -0500 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-19 21:50:35 -0500 |
| commit | 9a1df948c635d9dbabaff94313652c6d8d1df28d (patch) | |
| tree | 69c7ab78fd6af427e9274359d26a1fd6ecfcda1b /phpBB/includes/auth | |
| parent | 7b9092ea3b4ea63bd8c20c1b66b8bd4240e2c497 (diff) | |
| download | forums-9a1df948c635d9dbabaff94313652c6d8d1df28d.tar forums-9a1df948c635d9dbabaff94313652c6d8d1df28d.tar.gz forums-9a1df948c635d9dbabaff94313652c6d8d1df28d.tar.bz2 forums-9a1df948c635d9dbabaff94313652c6d8d1df28d.tar.xz forums-9a1df948c635d9dbabaff94313652c6d8d1df28d.zip | |
[ticket/10758] Extract obtain_user_data for the benefit of tests.
PHPBB3-10758
Diffstat (limited to 'phpBB/includes/auth')
| -rw-r--r-- | phpBB/includes/auth/auth.php | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ -103,6 +103,26 @@ class phpbb_auth } /** + * 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 */ |
