Skip to:
Content

bbPress.org

Changeset 4367


Ignore:
Timestamp:
11/09/2012 09:44:35 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Reverse logic in bbp_user_has_profile().
  • Assume all users have profiles, and they must be explicitly disabled.
  • This is a more natural default behavior, as rarely will a site need to restrict a user's profile to a specific central site.
  • See #1939.
File:
1 edited

Legend:

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

    r4363 r4367  
    594594function bbp_user_has_profile( $user_id = 0 ) {
    595595
     596    // Assume every user has a profile
     597    $retval  = true;
     598
    596599    // Validate user ID, default to displayed or current user
    597600    $user_id = bbp_get_user_id( $user_id, true, true );
     
    604607        $retval = false;
    605608
    606     // User found
    607     } else {
    608 
    609         // User is inactive, and current user is not a super admin
    610         if ( ! is_super_admin() && bbp_is_user_inactive( $user->ID ) ) {
    611             $retval = false;
    612 
    613         // Check for site caps
    614         } else {
    615             $retval  = (bool) bbp_get_user_role( $user_id );
    616         }
     609    // User is inactive, and current user is not a super admin
     610    } elseif ( ! is_super_admin() && bbp_is_user_inactive( $user->ID ) ) {
     611        $retval = false;
    617612    }
    618613
Note: See TracChangeset for help on using the changeset viewer.