Ticket #2069: anon-spectate-filterable.diff
| File anon-spectate-filterable.diff, 2.9 KB (added by , 13 years ago) |
|---|
-
includes/core/capabilities.php
176 176 $caps = array( 177 177 178 178 // Primary caps 179 'spectate' => false,179 'spectate' => true, 180 180 'participate' => false, 181 181 'moderate' => false, 182 182 'throttle' => false, -
includes/users/capabilities.php
222 222 if ( ! did_action( 'set_current_user' ) ) 223 223 return; 224 224 225 // Load up bbPress once 226 $bbp = bbpress(); 227 225 228 // Bail if not logged in or already a member of this site 226 if ( ! is_user_logged_in() ) 227 return; 229 if ( ! is_user_logged_in() ) { 230 $user_role = ''; 231 $add_to_site = false; 232 } else { 233 // Get the current user ID 234 $user_id = bbp_get_current_user_id(); 228 235 229 // Get the current user ID 230 $user_id = bbp_get_current_user_id(); 236 // Bail if user already has a forums role 237 if ( bbp_get_user_role( $user_id ) ) 238 return; 231 239 232 // Bail if user already has a forums role233 if ( bbp_get_user_role( $user_id ) )234 return;240 // Bail if user is marked as spam or is deleted 241 if ( bbp_is_user_inactive( $user_id ) ) 242 return; 235 243 236 // Bail if user is marked as spam or is deleted 237 if ( bbp_is_user_inactive( $user_id ) ) 238 return; 244 /** Ready *****************************************************************/ 239 245 240 /** Ready *****************************************************************/ 246 // Get whether or not to add a role to the user account 247 $add_to_site = bbp_allow_global_access(); 241 248 242 // Load up bbPress once 243 $bbp = bbpress(); 249 // Get the current user's WordPress role. Set to empty string if none found. 250 $user_role = bbp_get_user_blog_role( $user_id ); 251 } 244 252 245 // Get whether or not to add a role to the user account246 $add_to_site = bbp_allow_global_access();247 248 // Get the current user's WordPress role. Set to empty string if none found.249 $user_role = bbp_get_user_blog_role( $user_id );250 251 253 // Get the role map 252 254 $role_map = bbp_get_user_role_map(); 253 255 … … 295 297 'editor' => $default_role, 296 298 'author' => $default_role, 297 299 'contributor' => $default_role, 298 'subscriber' => $default_role 300 'subscriber' => $default_role, 301 '' => bbp_get_blocked_role(), 299 302 ) ); 300 303 } 301 304 -
includes/users/functions.php
1109 1109 function bbp_forum_enforce_blocked() { 1110 1110 1111 1111 // Bail if not logged in or super admin 1112 if ( ! is_user_logged_in() ||is_super_admin() ) {1112 if ( is_super_admin() ) { 1113 1113 return; 1114 1114 } 1115 1115