Skip to:
Content

BuddyPress.org

Changeset 2925 for trunk/bp-core.php


Ignore:
Timestamp:
04/15/2010 11:59:40 AM (14 years ago)
Author:
apeatling
Message:

Merging 1.2 branch with trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r2919 r2925  
    460460        }
    461461
    462         do_action( 'bp_core_action_set_spammer_status', $errors );
     462        do_action( 'bp_core_action_delete_user', $errors );
    463463
    464464        if ( $errors )
     
    494494        'search_terms' => false, // Limit to users that match these search terms
    495495
     496        'include' => false, // Pass comma separated list of user_ids to limit to only these users
    496497        'per_page' => 20, // The number of results to return per page
    497498        'page' => 1, // The page to return if limiting per page
     
    502503    extract( $params, EXTR_SKIP );
    503504
    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 );
    505506}
    506507
     
    914915    global $wpdb;
    915916
    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 ) ) );
    918921}
    919922
     
    937940    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 ) ) );
    938941}
    939 
    940942
    941943/**
     
    14301432        return $number;
    14311433
    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 );
    14331435}
    14341436
     
    14771479            unset( $site_path[2] );
    14781480
    1479             $site_path = '/' . implode( '/', $site_path ) . '/';
     1481            if ( !count( $site_path ) )
     1482                $site_path = '/';
     1483            else
     1484                $site_path = '/' . implode( '/', $site_path ) . '/';
    14801485        }
    14811486    }
     
    14831488    return apply_filters( 'bp_core_get_site_path', $site_path );
    14841489}
    1485 
    14861490/**
    14871491 * bp_core_get_site_options()
     
    16061610 * @package BuddyPress Core
    16071611 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    1608  * @uses check_admin_referer() Checks for a valid security nonce.
    16091612 * @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
    16111616 */
    16121617function bp_core_delete_account( $user_id = false ) {
     
    16201625        return false;
    16211626
    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
    16271633        require_once( ABSPATH . '/wp-admin/includes/mu.php' );
    16281634        require_once( ABSPATH . '/wp-admin/includes/user.php' );
     
    16311637    }
    16321638
     1639    /* Single site user deletion */
    16331640    require_once( ABSPATH . '/wp-admin/includes/user.php' );
    16341641    return wp_delete_user( $user_id );
     
    17411748    ?>
    17421749
    1743 <!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->
     1750<!-- Generated in <?php timer_stop(1); ?> seconds. -->
    17441751
    17451752    <?php
     
    18121819    $user = get_userdatabylogin( $username );
    18131820
    1814     if ( (int)$user->spam )
     1821    if ( ( bp_core_is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status )
    18151822        bp_core_redirect( $bp->root_domain );
    18161823    else
Note: See TracChangeset for help on using the changeset viewer.