Changeset 11881
- Timestamp:
- 03/04/2018 09:13:24 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-screens.php
r11806 r11881 225 225 } 226 226 227 $user_id = bp_displayed_user_id();228 229 227 /** 230 228 * Check user access to the activity item. … … 232 230 * @since 3.0.0 233 231 */ 234 $has_access = bp_activity_user_can_read( $activity , $user_id);232 $has_access = bp_activity_user_can_read( $activity ); 235 233 236 234 // If activity author does not match displayed user, block access. 237 235 // More info:https://buddypress.trac.wordpress.org/ticket/7048#comment:28 238 if ( true === $has_access && $user_id!== $activity->user_id ) {236 if ( true === $has_access && bp_displayed_user_id() !== $activity->user_id ) { 239 237 $has_access = false; 240 238 } … … 252 250 // Access is specifically disallowed. 253 251 if ( false === $has_access ) { 254 255 // User feedback. 256 bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); 257 258 // Redirect based on logged in status. 259 if ( is_user_logged_in() ) { 260 $url = bp_loggedin_user_domain(); 261 252 // If not logged in, prompt for login. 253 if ( ! is_user_logged_in() ) { 254 bp_core_no_access(); 255 256 // Redirect away. 262 257 } else { 263 $url = sprintf( 264 wp_login_url( 'wp-login.php?redirect_to=%s' ), 265 esc_url_raw( bp_activity_get_permalink( $action ) ) 266 ); 258 bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); 259 bp_core_redirect( bp_loggedin_user_domain() ); 267 260 } 268 269 bp_core_redirect( $url );270 261 } 271 262
Note: See TracChangeset
for help on using the changeset viewer.