Changeset 2925 for trunk/bp-core.php
- Timestamp:
- 04/15/2010 11:59:40 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r2919 r2925 460 460 } 461 461 462 do_action( 'bp_core_action_ set_spammer_status', $errors );462 do_action( 'bp_core_action_delete_user', $errors ); 463 463 464 464 if ( $errors ) … … 494 494 'search_terms' => false, // Limit to users that match these search terms 495 495 496 'include' => false, // Pass comma separated list of user_ids to limit to only these users 496 497 'per_page' => 20, // The number of results to return per page 497 498 'page' => 1, // The page to return if limiting per page … … 502 503 extract( $params, EXTR_SKIP ); 503 504 504 return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $ search_terms, $populate_extras ), &$params );505 return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras ), &$params ); 505 506 } 506 507 … … 914 915 global $wpdb; 915 916 916 if ( !empty( $username ) ) 917 return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) ); 917 if ( empty( $username ) ) 918 return false; 919 920 return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) ); 918 921 } 919 922 … … 937 940 return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_nicename = %s", $user_nicename ) ) ); 938 941 } 939 940 942 941 943 /** … … 1430 1432 return $number; 1431 1433 1432 return apply_filters( 'bp_core_ bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );1434 return apply_filters( 'bp_core_number_format', number_format( $number, $decimals ), $number, $decimals ); 1433 1435 } 1434 1436 … … 1477 1479 unset( $site_path[2] ); 1478 1480 1479 $site_path = '/' . implode( '/', $site_path ) . '/'; 1481 if ( !count( $site_path ) ) 1482 $site_path = '/'; 1483 else 1484 $site_path = '/' . implode( '/', $site_path ) . '/'; 1480 1485 } 1481 1486 } … … 1483 1488 return apply_filters( 'bp_core_get_site_path', $site_path ); 1484 1489 } 1485 1486 1490 /** 1487 1491 * bp_core_get_site_options() … … 1606 1610 * @package BuddyPress Core 1607 1611 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1608 * @uses check_admin_referer() Checks for a valid security nonce.1609 1612 * @uses is_site_admin() Checks to see if the user is a site administrator. 1610 * @uses wpmu_delete_user() Deletes a user from the system. 1613 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs. 1614 * @uses wp_delete_user() Deletes a user from the system on singlesite installs. 1615 * @uses get_site_option Checks if account deletion is allowed 1611 1616 */ 1612 1617 function bp_core_delete_account( $user_id = false ) { … … 1620 1625 return false; 1621 1626 1622 /* Site admins should not be allowed to be deleted */ 1623 if ( bp_core_is_multisite() && is_site_admin( bp_core_get_username( $user_id ) ) ) 1624 return false; 1625 1626 if ( bp_core_is_multisite() && function_exists('wpmu_delete_user') ) { 1627 /* Specifically handle multi-site environment */ 1628 if ( bp_core_is_multisite() ) { 1629 /* Site admins cannot be deleted */ 1630 if ( is_site_admin( bp_core_get_username( $user_id ) ) ) 1631 return false; 1632 1627 1633 require_once( ABSPATH . '/wp-admin/includes/mu.php' ); 1628 1634 require_once( ABSPATH . '/wp-admin/includes/user.php' ); … … 1631 1637 } 1632 1638 1639 /* Single site user deletion */ 1633 1640 require_once( ABSPATH . '/wp-admin/includes/user.php' ); 1634 1641 return wp_delete_user( $user_id ); … … 1741 1748 ?> 1742 1749 1743 <!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q)-->1750 <!-- Generated in <?php timer_stop(1); ?> seconds. --> 1744 1751 1745 1752 <?php … … 1812 1819 $user = get_userdatabylogin( $username ); 1813 1820 1814 if ( ( int)$user->spam)1821 if ( ( bp_core_is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status ) 1815 1822 bp_core_redirect( $bp->root_domain ); 1816 1823 else
Note: See TracChangeset
for help on using the changeset viewer.