aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth/auth.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-12-25 15:18:47 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-12-25 15:18:47 +0100
commitcb7f6deb07ba2869c62a80584d81feb3d3baf682 (patch)
treef30e45ace777ecc2a1b1db2ec2ab8449bc7486ac /phpBB/includes/auth/auth.php
parent21b9ac6c880cbee7c8bda263871b24414671672a (diff)
parent8707a3413504b0cf922086daa6fc497ccf090448 (diff)
downloadforums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.gz
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.bz2
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.tar.xz
forums-cb7f6deb07ba2869c62a80584d81feb3d3baf682.zip
Merge remote-tracking branch 'p/ticket/10758' into develop
* p/ticket/10758: [ticket/10758] Add return to the other compat function. [ticket/10758] Add periods. [ticket/10758] Yes, only one empty line. [ticket/10758] Add deprecated tags. [ticket/10758] Add compat functions. [ticket/10758] Admin is not working yet. [ticket/10758] Test moderator and admin permissions. [ticket/10758] Check that acl was changed in the test. [ticket/10758] Extract obtain_user_data for the benefit of tests. [ticket/10758] Functional test for changing a user's permission. [ticket/10758] Spelling fix. [ticket/10758] Add a test for acp login. [ticket/10758] Dependency inject parameters into update_foes. [ticket/10758] Dependency inject parameters into cache_moderators.
Diffstat (limited to 'phpBB/includes/auth/auth.php')
-rw-r--r--phpBB/includes/auth/auth.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/phpBB/includes/auth/auth.php b/phpBB/includes/auth/auth.php
index e3bccaf47b..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
*/
@@ -191,7 +211,7 @@ class phpbb_auth
/**
* Get forums with the specified permission setting
- * if the option is prefixed with !, then the result becomes nagated
+ * if the option is prefixed with !, then the result becomes negated
*
* @param bool $clean set to true if only values needs to be returned which are set/unset
*/