Changeset 8605 for trunk/src/bp-groups/bp-groups-loader.php
- Timestamp:
- 07/12/2014 01:26:36 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-loader.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-loader.php
r8568 r8605 269 269 } 270 270 271 // Group access control272 if ( bp_is_groups_component() && !empty( $this->current_group ) ) {273 if ( !$this->current_group->user_has_access ) {274 275 // Hidden groups should return a 404 for non-members.276 // Unset the current group so that you're not redirected277 // to the default group tab278 if ( 'hidden' == $this->current_group->status ) {279 $this->current_group = 0;280 $bp->is_single_item = false;281 bp_do_404();282 return;283 284 // Skip the no_access check on home and membership request pages285 } elseif ( !bp_is_current_action( 'home' ) && !bp_is_current_action( 'request-membership' ) ) {286 287 // Off-limits to this user. Throw an error and redirect to the group's home page288 if ( is_user_logged_in() ) {289 bp_core_no_access( array(290 'message' => __( 'You do not have access to this group.', 'buddypress' ),291 'root' => bp_get_group_permalink( $bp->groups->current_group ) . 'home/',292 'redirect' => false293 ) );294 295 // User does not have access, and does not get a message296 } else {297 bp_core_no_access();298 }299 }300 }301 302 // Protect the admin tab from non-admins303 if ( bp_is_current_action( 'admin' ) && !bp_is_item_admin() ) {304 bp_core_no_access( array(305 'message' => __( 'You are not an admin of this group.', 'buddypress' ),306 'root' => bp_get_group_permalink( $bp->groups->current_group ),307 'redirect' => false308 ) );309 }310 }311 312 271 // Preconfigured group creation steps 313 272 $this->group_creation_steps = apply_filters( 'groups_create_group_steps', array( … … 482 441 'position' => 60, 483 442 'user_has_access' => $this->current_group->user_has_access, 484 'item_css_id' => 'members' 443 'item_css_id' => 'members', 444 'no_access_url' => $group_link, 485 445 ); 486 446 … … 494 454 'item_css_id' => 'invite', 495 455 'position' => 70, 496 'user_has_access' => $this->current_group->user_has_access 456 'user_has_access' => $this->current_group->user_has_access, 457 'no_access_url' => $group_link, 497 458 ); 498 459 } … … 508 469 'position' => 1000, 509 470 'user_has_access' => true, 510 'item_css_id' => 'admin' 471 'item_css_id' => 'admin', 472 'no_access_url' => $group_link, 511 473 ); 512 474 }
Note: See TracChangeset
for help on using the changeset viewer.