Ticket #5374: 5374.sign-up-disabled.02.diff
File 5374.sign-up-disabled.02.diff, 5.3 KB (added by , 11 years ago) |
---|
-
bp-core/admin/bp-core-schema.php
52 52 bp_core_install_blog_tracking(); 53 53 54 54 // Install the signups table 55 if ( bp_get_signup_allowed() ) 56 bp_core_install_signups(); 55 bp_core_install_signups(); 57 56 58 57 } 59 58 -
bp-core/bp-core-update.php
342 342 function bp_update_to_2_0() { 343 343 global $wpdb; 344 344 345 /** Install activity tables for 'last_activity' **********************/ 345 /** Install activity tables for 'last_activity' ***************************/ 346 346 347 bp_core_install_activity_streams(); 347 348 348 /** Migrate 'last_activity' data ************************************* /349 /** Migrate 'last_activity' data ******************************************/ 349 350 350 351 bp_last_activity_migrate(); 351 352 352 /** Migrate signups data ********************************************* /353 /** Migrate signups data **************************************************/ 353 354 354 if ( bp_get_signup_allowed() &&! is_multisite() ) {355 if ( ! is_multisite() ) { 355 356 356 357 if ( empty( $wpdb->signups ) ) { 357 358 bp_core_install_signups(); … … 379 380 $user_login = preg_replace( '/\s+/', '', sanitize_user( $signup->user_login, true ) ); 380 381 $user_email = sanitize_email( $signup->user_email ); 381 382 382 $args =array(383 BP_Signup::add( array( 383 384 'user_login' => $user_login, 384 385 'user_email' => $user_email, 385 386 'registered' => $signup->user_registered, 386 387 'activation_key' => $signup->activation_key, 387 388 'meta' => $meta 388 ) ;389 ) ); 389 390 390 BP_Signup::add( $args );391 392 391 // Deleting these options will remove signups from users count 393 392 delete_user_option( $signup->ID, 'capabilities' ); 394 delete_user_option( $signup->ID, 'user_level' );393 delete_user_option( $signup->ID, 'user_level' ); 395 394 } 396 395 } 397 396 398 /** Add BP options to the options table ******************************/ 397 /** Add BP options to the options table ***********************************/ 398 399 399 bp_add_options(); 400 400 } 401 401 -
bp-members/admin/bp-members-classes.php
159 159 * @since BuddyPress (2.0.0) 160 160 */ 161 161 public function no_items() { 162 _e( 'No pending accounts found.', 'buddypress' ); 162 163 if ( bp_get_signup_allowed() ) { 164 esc_html_e( 'No pending accounts found.', 'buddypress' ); 165 } else { 166 $link = false; 167 168 // Specific case when BuddyPress is not network activated 169 if ( is_multisite() && current_user_can( 'manage_network_users') ) { 170 $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>'; 171 } elseif ( current_user_can( 'manage_options' ) ) { 172 $link = '<a href="' . esc_url( bp_get_admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>'; 173 } 174 175 printf( __( 'Registration is disabled. %s', 'buddypress' ), $link ); 176 } 177 163 178 } 164 179 165 180 /** … … 462 477 * @since BuddyPress (2.0.0) 463 478 */ 464 479 public function no_items() { 465 _e( 'No pending accounts found.', 'buddypress' ); 480 if ( bp_get_signup_allowed() ) { 481 esc_html_e( 'No pending accounts found.', 'buddypress' ); 482 } else { 483 $link = false; 484 485 if ( current_user_can( 'manage_network_users' ) ) { 486 $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>'; 487 } 488 489 printf( __( 'Registration is disabled. %s', 'buddypress' ), $link ); 490 } 466 491 } 467 492 468 493 /** -
bp-members/bp-members-admin.php
162 162 163 163 /** Signups **************************************************************/ 164 164 165 if ( bp_get_signup_allowed() &&is_admin() ) {165 if ( is_admin() ) { 166 166 if ( ! is_multisite() ) { 167 167 add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query'), 10, 1 ); 168 168 } 169 169 170 // Reorganise the views navigation in users.php and signups page 170 171 if ( current_user_can( $this->capability ) ) { 171 // Reorganise the views navigation in users.php and signups page172 172 add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); 173 173 add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); 174 174 } … … 195 195 ); 196 196 197 197 // Manage signups if allowed 198 if ( bp_get_signup_allowed() ) { 199 $hooks['signups'] = $this->signups_page = add_users_page( 200 __( 'Manage Signups', 'buddypress' ), 201 __( 'Manage Signups', 'buddypress' ), 202 $this->capability, 203 'bp-signups', 204 array( &$this, 'signups_admin' ) 205 ); 206 } 198 $hooks['signups'] = $this->signups_page = add_users_page( 199 __( 'Manage Signups', 'buddypress' ), 200 __( 'Manage Signups', 'buddypress' ), 201 $this->capability, 202 'bp-signups', 203 array( &$this, 'signups_admin' ) 204 ); 207 205 208 206 $edit_page = 'user-edit'; 209 207 $this->users_page = 'users';