1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 15:45:34 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/9509] Remove section 8 from index
  [ticket/9509] Close anchor tag in coding guidelines
  [ticket/9854] Revise docs/auth_api.html to add more methods
  [ticket/9509] The VCS is now git
  [ticket/9840] Display view unread posts link for guests.

Conflicts:
	phpBB/docs/coding-guidelines.html
This commit is contained in:
Igor Wiedler 2010-10-19 13:57:43 +02:00
commit 2264f88d82
5 changed files with 52 additions and 7 deletions

View File

@ -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> =&gt; array(<em>option</em> =&gt; <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-&gt;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-&gt;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>

View File

@ -94,7 +94,6 @@
<li><a href="#commitmessage">Commit Messages and Repository Rules</a></li>
</ol>
</li>
<li><a href="#changes">Guidelines Changelog</a></li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
@ -2447,7 +2446,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<a name="commitmessage"></a><h3>7.ii. Commit Messages and Reposiory Rules</h3>
<p>Information on repository rules, such as commit messages can be found at <a href="http://wiki.phpbb.com/display/DEV/Git" title="phpBB Git Information">http://wiki.phpbb.com/display/DEV/Git</p>.
<p>Information on repository rules, such as commit messages can be found at <a href="http://wiki.phpbb.com/display/DEV/Git" title="phpBB Git Information">http://wiki.phpbb.com/display/DEV/Git</a></p>.
</div>

View File

@ -4399,7 +4399,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false,
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,
'S_LOAD_UNREADS' => ($config['load_unreads_search']) ? true : false,
'S_LOAD_UNREADS' => ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false,
'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',
'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template',

View File

@ -6,7 +6,7 @@
<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
<ul class="linklist">
<!-- IF S_DISPLAY_SEARCH -->
<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
<!-- ENDIF -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
</ul>

View File

@ -201,8 +201,8 @@ function marklist(id, name, state)
<!-- IF S_DISPLAY_SEARCH -->
<p class="searchbar">
<span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
<!-- IF S_USER_LOGGED_IN -->
<span style="float: {S_CONTENT_FLOW_END};"><!-- IF S_LOAD_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <!-- ENDIF --><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
<!-- IF S_USER_LOGGED_IN or S_LOAD_UNREADS -->
<span style="float: {S_CONTENT_FLOW_END};"><!-- IF S_LOAD_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- IF S_USER_LOGGED_IN --> | <!-- ENDIF --><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><!-- ENDIF --></span>
<!-- ENDIF -->
</p>
<!-- ENDIF -->