Changeset 8148 for trunk/bp-members/bp-members-admin.php
- Timestamp:
- 03/20/2014 10:01:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-admin.php
r8136 r8148 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'; 107 105 108 // The Edit Profile Screen id 106 109 $this->user_page = ''; … … 123 126 $this->users_url = bp_get_admin_url( 'users.php' ); 124 127 $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users'; 128 129 // Specific config: BuddyPress is not network activated 130 $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated(); 131 132 // When BuddyPress is not network activated, only Super Admin can moderate signups 133 if ( ! empty( $this->subsite_activated ) ) { 134 $this->capability = 'manage_network_options'; 135 } 125 136 } 126 137 … … 152 163 /** Signups **************************************************************/ 153 164 154 if ( bp_get_signup_allowed() ) {155 if ( ! is_multisite() && is_admin()) {165 if ( bp_get_signup_allowed() && is_admin() ) { 166 if ( ! is_multisite() ) { 156 167 add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query'), 10, 1 ); 157 168 } 158 169 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 ); 170 if ( current_user_can( $this->capability ) ) { 171 // Reorganise the views navigation in users.php and signups page 172 add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); 173 add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); 174 } 162 175 } 163 176 } … … 182 195 ); 183 196 184 $hooks['signups'] = $this-> users_page = add_users_page(197 $hooks['signups'] = $this->signups_page = add_users_page( 185 198 __( 'Manage Signups', 'buddypress' ), 186 199 __( 'Manage Signups', 'buddypress' ), 187 'bp_moderate',200 $this->capability, 188 201 'bp-signups', 189 202 array( &$this, 'signups_admin' ) … … 203 216 204 217 foreach ( $hooks as $key => $hook ) { 205 add_action( "load-$hook", 218 add_action( "load-$hook", array( $this, $key . '_admin_load' ) ); 206 219 } 207 220
Note: See TracChangeset
for help on using the changeset viewer.