Changeset 4311
- Timestamp:
- 11/03/2012 07:06:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/users/capabilities.php
r4308 r4311 50 50 // What capability is being checked? 51 51 switch ( $cap ) { 52 53 // Minimum required cap to read any forum content 54 case 'spectate' : 55 56 // Minimum required cap to create any forum content 52 case 'spectate' : 57 53 case 'participate' : 58 59 // Inactive users cannot participate 54 case 'moderate' : 55 56 // Do not allow inactive users 60 57 if ( bbp_is_user_inactive( $user_id ) ) { 61 58 $caps = array( 'do_not_allow' ); 62 59 63 60 // Moderators are always participants 64 } else if ( user_can( $user_id, 'moderate' ) ){61 } else { 65 62 $caps = array( $cap ); 66 67 // Map to read68 } else {69 $caps = array( 'read' );70 }71 72 break;73 74 case 'moderate' :75 76 // All admins are moderators77 if ( user_can( $user_id, 'administrator' ) ) {78 $caps = array( 'read' );79 63 } 80 64 … … 259 243 260 244 // Bail if not logged in or already a member of this site 261 if ( ! is_user_logged_in() || current_user_can( 'read' ) ) 245 if ( ! is_user_logged_in() ) 246 return; 247 248 // Get the current user ID 249 $user_id = get_current_user_id(); 250 251 // Bail if user already has a forums role 252 if ( bbp_get_user_role( $user_id ) ) 262 253 return; 263 254 264 255 // Bail if user is marked as spam or is deleted 265 if ( bbp_is_user_inactive( ) )256 if ( bbp_is_user_inactive( $user_id ) ) 266 257 return; 267 258
Note: See TracChangeset
for help on using the changeset viewer.