Changeset 5228
- Timestamp:
- 10/09/2011 04:33:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-loader.php
r5183 r5228 165 165 166 166 // Group access control 167 if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && !$this->current_group->user_has_access ) { 168 if ( is_user_logged_in() ) { 169 // Off-limits to this user. Throw an error and redirect to the 170 // group's home page 171 bp_core_no_access( array( 172 'message' => __( 'You do not have access to this group.', 'buddypress' ), 173 'root' => bp_get_group_permalink( $bp->groups->current_group ), 174 'redirect' => false 175 ) ); 176 } else { 177 // Allow the user to log in 178 bp_core_no_access(); 167 if ( bp_is_groups_component() && !empty( $this->current_group ) ) { 168 169 if ( !empty( $bp->current_action ) && !$this->current_group->user_has_access ) { 170 if ( is_user_logged_in() ) { 171 // Off-limits to this user. Throw an error and redirect to the group's home page 172 bp_core_no_access( array( 173 'message' => __( 'You do not have access to this group.', 'buddypress' ), 174 'root' => bp_get_group_permalink( $bp->groups->current_group ), 175 'redirect' => false 176 ) ); 177 } else { 178 // Allow the user to log in 179 bp_core_no_access(); 180 } 181 182 // User has access. Default to a particular group extension if not specified on the URL 183 } elseif ( empty( $bp->current_action ) && $this->current_group->user_has_access ) { 184 $bp->current_action = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' ); 179 185 } 180 186 }
Note: See TracChangeset
for help on using the changeset viewer.