Changeset 5986
- Timestamp:
- 04/13/2012 04:31:42 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
bp-core/bp-core-cache.php (modified) (4 diffs)
-
bp-members/bp-members-functions.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-cache.php
r5683 r5986 55 55 function bp_update_meta_cache( $args = array() ) { 56 56 global $wpdb; 57 57 58 58 $defaults = array( 59 59 'object_ids' => array(), // Comma-separated list or array of item ids … … 66 66 $r = wp_parse_args( $args, $defaults ); 67 67 extract( $r ); 68 68 69 69 if ( empty( $object_ids ) || empty( $object_type ) || empty( $meta_table ) ) { 70 70 return false; 71 71 } 72 72 73 73 if ( empty( $cache_key_prefix ) ) { 74 74 $cache_key_prefix = $meta_table; 75 75 } 76 76 77 77 if ( empty( $object_column ) ) { 78 78 $object_column = $object_type . '_id'; … … 87 87 88 88 $cache = array(); 89 89 90 90 // Get meta info 91 91 $id_list = join( ',', $object_ids ); … … 108 108 } 109 109 } 110 110 111 111 foreach ( $object_ids as $id ) { 112 112 if ( ! isset($cache[$id]) ) 113 113 $cache[$id] = array(); 114 114 115 115 foreach( $cache[$id] as $meta_key => $meta_value ) { 116 116 wp_cache_set( $cache_key_prefix . '_' . $id . '_' . $meta_key, $meta_value, 'bp' ); -
trunk/bp-members/bp-members-functions.php
r5927 r5986 501 501 function bp_core_process_spammer_status( $user_id, $status ) { 502 502 global $wpdb; 503 503 504 504 // Only super admins can currently spam users 505 505 if ( !is_super_admin() || bp_is_my_profile() ) … … 509 509 if ( empty( $user_id ) ) 510 510 return; 511 511 512 512 // Bail if user ID is super admin 513 513 if ( is_super_admin( $user_id ) ) 514 514 return; 515 515 516 516 // Get the functions file 517 517 if ( is_multisite() ) { … … 530 530 // Get the blogs for the user 531 531 $blogs = get_blogs_of_user( $user_id, true ); 532 532 533 533 foreach ( (array) $blogs as $key => $details ) { 534 534 535 535 // Do not mark the main or current root blog as spam 536 536 if ( 1 == $details->userblog_id || bp_get_root_blog_id() == $details->userblog_id ) { 537 537 continue; 538 538 } 539 539 540 540 // Update the blog status 541 541 update_blog_status( $details->userblog_id, 'spam', $is_spam ); 542 542 } 543 543 544 544 // Finally, mark this user as a spammer 545 545 if ( is_multisite() ) { 546 546 update_user_status( $user_id, 'spam', $is_spam ); 547 547 } 548 548 549 549 // Always set single site status 550 550 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) ); 551 551 552 552 // Call multisite actions in single site mode for good measure 553 553 if ( !is_multisite() ) { … … 568 568 // Allow plugins to do neat things 569 569 do_action( 'bp_core_process_spammer_status', $user_id, $is_spam ); 570 570 571 571 return true; 572 572 } … … 576 576 * 577 577 * @since BuddyPress (1.6) 578 * 578 * 579 579 * @param int $user_id The user id passed from the make_spam_user hook 580 580 */ … … 588 588 * 589 589 * @since BuddyPress (1.6) 590 * 590 * 591 591 * @param int $user_id The user id passed from the make_ham_user hook 592 592 */ … … 673 673 /** 674 674 * Checks if user is active 675 * 675 * 676 676 * @since BuddyPress (1.6) 677 * 677 * 678 678 * @uses is_user_logged_in() To check if user is logged in 679 679 * @uses bp_loggedin_user_id() To get current user ID … … 708 708 /** 709 709 * Checks if user is not active. 710 * 710 * 711 711 * @since BuddyPress (1.6) 712 * 712 * 713 713 * @uses is_user_logged_in() To check if user is logged in 714 714 * @uses bp_get_displayed_user_id() To get current user ID … … 1054 1054 $current_field = $usermeta["field_{$field_id}"]; 1055 1055 xprofile_set_field_data( $field_id, $user_id, $current_field ); 1056 1056 1057 1057 // Save the visibility level 1058 1058 $visibility_level = !empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public'; … … 1116 1116 if ( !empty( $current_field ) ) 1117 1117 xprofile_set_field_data( $field_id, $user_id, $current_field ); 1118 1118 1119 1119 // Save the visibility level 1120 1120 $visibility_level = !empty( $user['meta']['field_' . $field_id . '_visibility'] ) ? $user['meta']['field_' . $field_id . '_visibility'] : 'public'; … … 1260 1260 if ( is_admin() || is_network_admin() ) 1261 1261 return; 1262 1262 1263 1263 // Not at the WP core signup page and action is not register 1264 1264 if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) )
Note: See TracChangeset
for help on using the changeset viewer.