diff options
author | Josh Woody <a_jelly_doughnut@phpbb.com> | 2010-10-17 15:47:41 -0500 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2010-10-19 12:31:18 +0200 |
commit | 9950fa34c6b3a0aeac6140e0b8eb671529824ea4 (patch) | |
tree | ff3a77b3d25492dcdb1e42123e300be804fd1c0f /phpBB/docs/auth_api.html | |
parent | acabe5a0139057a7c5fb5a6b98cbfa1a06424e2e (diff) | |
download | forums-9950fa34c6b3a0aeac6140e0b8eb671529824ea4.tar forums-9950fa34c6b3a0aeac6140e0b8eb671529824ea4.tar.gz forums-9950fa34c6b3a0aeac6140e0b8eb671529824ea4.tar.bz2 forums-9950fa34c6b3a0aeac6140e0b8eb671529824ea4.tar.xz forums-9950fa34c6b3a0aeac6140e0b8eb671529824ea4.zip |
[ticket/9854] Revise docs/auth_api.html to add more methods
Notably, the auth_admin class is still missing documentation.
PHPBB3-9854
Diffstat (limited to 'phpBB/docs/auth_api.html')
-rw-r--r-- | phpBB/docs/auth_api.html | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index c83aaadc2d..50d73d4485 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -61,6 +61,9 @@ <li><a href="#acl_getf">acl_getf</a></li> <li><a href="#acl_getf_global">acl_getf_global</a></li> <li><a href="#acl_cache">acl_cache</a></li> + <li><a href="#acl_clear_prefetch">acl_clear_prefetch</a></li> + <li><a href="#acl_get_list">acl_get_list</a></li> + <li><a href="#misc">Miscellaneous</a></li> </ol> </li> <li><a href="#admin_related">Admin related functions</a></li> @@ -176,7 +179,7 @@ array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <e <p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p> <div class="codebox"><pre> -$result = acl_getf_global(<code>option</code>) +$result = $auth->acl_getf_global(<code>option</code>) </pre></div> <p>As with the previous methods option is a string specifying the permission which has to be checked.</p> @@ -187,6 +190,49 @@ $result = acl_getf_global(<code>option</code>) <p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p> + <a name="acl_clear_prefetch"></a><h3>2.vii. acl_clear_prefetch</h3> + + <p>This method clears the user_permissions column in the users table for the given user. If the user ID passed is zero, the permissions cache is cleared for all users. This method should be called whenever permissions are set.</p> + + <div class="codebox"><pre> +// clear stored permissions for user 2 +$user_id = 2; +$auth->acl_clear_prefetch($user_id); +</pre></div> + + <p>This method returns void.</p> + + <a name="acl_get_list"></a><h3>2.viii. acl_get_list</h3> + + <p>This method returns an an array describing which users have permissions in given fora. The resultant array contains an entry for permission that every user has in every forum when no arguments are passed.</p> + + <div class="codebox"><pre> +$user_id = array(2, 53); +$permissions = array('f_list', 'f_read'); +$forum_id = array(1, 2, 3); +$result = $auth->acl_get_list($user_id, $permissions, $forum_id); +</pre></div> + + <p>The parameters may be of the following legal types:</p> + <ul> + <li><strong>$user_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li> + <li><strong>$permissions</strong>: <code>false</code>, string, array(string, string, ...)</li> + <li><strong>$forum_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li> + </ul> + + <a name="misc"></a><h3>2.ix. Miscellaneous</h3> + + <p>There are other methods defined in the auth class which serve mostly as private methods, but are available for use if needed. Each of them is used to pull data directly from the database tables. They are:</p> + <ul> + <li><pre>function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)</pre></li> + <li><pre>function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li> + <li><pre>function acl_raw_data_single_user($user_id)</pre></li> + <li><pre>function acl_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li> + <li><pre>function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)</pre></li> + </ul> + + <p>Of these, <code>acl_raw_data</code> is the most general, but the others will be faster if you need a smaller amount of data.</p> + </div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> |