diff --git src/bp-core/bp-core-catchuri.php src/bp-core/bp-core-catchuri.php
index a0dcb8a..c76b253 100644
|
|
|
function bp_core_set_uri_globals() { |
| 269 | 269 | return; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | | // If the displayed user is marked as a spammer, 404 (unless logged- |
| 273 | | // in user is a super admin) |
| 274 | | if ( bp_displayed_user_id() && bp_is_user_spammer( bp_displayed_user_id() ) ) { |
| 275 | | if ( bp_current_user_can( 'bp_moderate' ) ) { |
| 276 | | bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'warning' ); |
| 277 | | } else { |
| | 272 | // If the displayed user is marked as a spammer, the account is not active or user is deleted, 404 |
| | 273 | // (unless logged-in user is a super admin if the user is marked as spammer) |
| | 274 | if ( bp_displayed_user_id() ) { |
| | 275 | |
| | 276 | // Do not display a "not activated" signup or deleted user as a member |
| | 277 | if ( bp_is_user_deleted( bp_displayed_user_id() ) ) { |
| 278 | 278 | bp_do_404(); |
| 279 | 279 | return; |
| 280 | 280 | } |
| | 281 | |
| | 282 | // Only display spammer if the user is a super admin |
| | 283 | if ( bp_is_user_spammer( bp_displayed_user_id() ) ) { |
| | 284 | if ( bp_current_user_can( 'bp_moderate' ) ) { |
| | 285 | bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'warning' ); |
| | 286 | } else { |
| | 287 | bp_do_404(); |
| | 288 | return; |
| | 289 | } |
| | 290 | } |
| 281 | 291 | } |
| 282 | 292 | |
| 283 | 293 | // Bump the offset |
diff --git src/bp-members/bp-members-loader.php src/bp-members/bp-members-loader.php
index ecdf91e..41cb432 100644
|
|
|
class BP_Members_Component extends BP_Component { |
| 199 | 199 | // users without the cap trying to access a spammer's subnav page will get |
| 200 | 200 | // redirected to the root of the spammer's profile page. this occurs by |
| 201 | 201 | // by removing the component in the canonical stack. |
| 202 | | if ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) { |
| | 202 | if ( ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) || bp_is_user_deleted( bp_displayed_user_id() ) ) { |
| 203 | 203 | unset( $bp->canonical_stack['component'] ); |
| 204 | 204 | } |
| 205 | 205 | } |