Skip to:
Content

BuddyPress.org

Changeset 5392


Ignore:
Timestamp:
11/27/2011 05:01:30 PM (13 years ago)
Author:
boonebgorges
Message:

Corrects logic for protecting hidden vs private group access in bp-groups-loader.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-loader.php

    r5373 r5392  
    163163            return;
    164164        }
     165       
     166        if ( !bp_current_action() ) {
     167            $bp->current_action = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
     168        }
    165169
    166170        // Group access control
    167171        if ( bp_is_groups_component() && !empty( $this->current_group ) ) {
    168 
    169172            if ( !$this->current_group->user_has_access ) {
    170173                if ( 'hidden' == $this->current_group->status ) {
     
    176179                    bp_do_404();
    177180                    return;
    178                 } else {
     181                } elseif ( !bp_is_current_action( 'home' ) ) {
    179182                    if ( is_user_logged_in() ) {
    180183                        // Off-limits to this user. Throw an error and redirect to the group's home page
     
    189192                    }
    190193                }
    191 
    192             // User has access. Default to a particular group extension if not specified on the URL
    193             } elseif ( !bp_current_action() ) {
    194                 $bp->current_action = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION :  'home' );
    195194            }
    196195        }
Note: See TracChangeset for help on using the changeset viewer.