Changeset 11761
- Timestamp:
- 12/06/2017 03:46:07 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-screens.php
r11698 r11761 231 231 } 232 232 233 // Check to see if the group is not public, if so, check the 234 // user has access to see this activity. 233 // Check to see if the user has access to to the activity's parent group. 235 234 if ( $group = groups_get_group( $activity->item_id ) ) { 236 237 // Group is not public. 238 if ( 'public' != $group->status ) { 239 240 // User is not a member of group. 241 if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { 242 $has_access = false; 243 } 244 } 235 $has_access = $group->user_has_access; 245 236 } 246 237 } -
trunk/src/bp-groups/bp-groups-actions.php
r11393 r11761 42 42 $current_group = groups_get_current_group(); 43 43 $user_has_access = $current_group->user_has_access; 44 $is_visible = $current_group->is_visible; 44 45 $no_access_args = array(); 45 46 46 if ( ! $user_has_access && 'hidden' !== $current_group->status ) { 47 // The user can know about the group but doesn't have full access. 48 if ( ! $user_has_access && $is_visible ) { 47 49 // Always allow access to home and request-membership. 48 50 if ( bp_is_current_action( 'home' ) || bp_is_current_action( 'request-membership' ) ) { … … 91 93 } 92 94 93 // Hidden groupsshould return a 404 for non-members.95 // Groups that the user cannot know about should return a 404 for non-members. 94 96 // Unset the current group so that you're not redirected 95 97 // to the default group tab. 96 if ( 'hidden' == $current_group->status) {98 if ( ! $is_visible ) { 97 99 buddypress()->groups->current_group = 0; 98 100 buddypress()->is_single_item = false; … … 489 491 } 490 492 491 $redirect = bp_get_group_permalink( groups_get_current_group() ); 492 493 if( 'hidden' == $bp->groups->current_group->status ) { 493 $group = groups_get_current_group(); 494 $redirect = bp_get_group_permalink( $group ); 495 496 if ( ! $group->is_visible ) { 494 497 $redirect = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ); 495 498 } -
trunk/src/bp-groups/bp-groups-template.php
r11703 r11761 486 486 } 487 487 488 if ( 'public' == $group->status) {488 if ( ! empty( $group->is_visible ) ) { 489 489 return true; 490 } else {491 if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {492 return true;493 }494 490 } 495 491
Note: See TracChangeset
for help on using the changeset viewer.