Ticket #5374: 5374.not-network-activated.diff
File 5374.not-network-activated.diff, 2.2 KB (added by , 11 years ago) |
---|
-
bp-members/bp-members-admin.php
102 102 $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin CSS URL 103 103 $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin CSS URL 104 104 105 // Capability depends on config 106 $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; 105 107 // The Edit Profile Screen id 106 108 $this->user_page = ''; 107 109 … … 122 124 $this->signups_page = ''; 123 125 $this->users_url = bp_get_admin_url( 'users.php' ); 124 126 $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users'; 127 128 // Specific config: BuddyPress is not network activated 129 $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated(); 130 131 if ( ! empty( $this->subsite_activated ) ) { 132 $this->capability = 'manage_network_options'; 133 } 125 134 } 126 135 127 136 /** … … 151 160 152 161 /** Signups **************************************************************/ 153 162 154 if ( bp_get_signup_allowed() ) {155 if ( ! is_multisite() && is_admin()) {163 if ( bp_get_signup_allowed() && is_admin() ) { 164 if ( ! is_multisite() ) { 156 165 add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query'), 10, 1 ); 157 166 } 158 167 159 // Reorganise the views navigation in users.php and signups page 160 add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); 161 add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); 168 if ( current_user_can( $this->capability ) ) { 169 // Reorganise the views navigation in users.php and signups page 170 add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); 171 add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); 172 } 162 173 } 163 174 } 164 175 … … 184 195 $hooks['signups'] = $this->users_page = add_users_page( 185 196 __( 'Manage Signups', 'buddypress' ), 186 197 __( 'Manage Signups', 'buddypress' ), 187 'bp_moderate',198 $this->capability, 188 199 'bp-signups', 189 200 array( &$this, 'signups_admin' ) 190 201 );