Skip to:
Content

bbPress.org

Changeset 5087


Ignore:
Timestamp:
08/24/2013 02:12:45 PM (11 years ago)
Author:
johnjamesjacoby
Message:

In bbp_user_can_view_forum(), pass the $user_id into bbp_is_user_keymaster().

Fixes issue where bbp_user_can_view_forum() may return incorrect results for users with the Keymaster role.

Props alex-ye. Fixes #2393.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/users/template.php

    r5064 r5087  
    15061506
    15071507    // Validate parsed values
    1508     $user_id  = bbp_get_user_id ( $r['user_id'], false, false );
     1508    $user_id  = bbp_get_user_id( $r['user_id'], false, false );
    15091509    $forum_id = bbp_get_forum_id( $r['forum_id'] );
    15101510    $retval   = false;
    15111511
    15121512    // User is a keymaster
    1513     if ( bbp_is_user_keymaster() ) {
     1513    if ( bbp_is_user_keymaster( $user_id ) ) {
    15141514        $retval = true;
    15151515
    15161516    // Forum is public, and user can read forums or is not logged in
    1517     } elseif ( bbp_is_forum_public ( $forum_id, $r['check_ancestors'] ) ) {
     1517    } elseif ( bbp_is_forum_public( $forum_id, $r['check_ancestors'] ) ) {
    15181518        $retval = true;
    15191519
Note: See TracChangeset for help on using the changeset viewer.