Changeset 2903
- Timestamp:
- 04/05/2010 01:20:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core.php
r2901 r2903 1693 1693 * @package BuddyPress Core 1694 1694 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1695 * @uses check_admin_referer() Checks for a valid security nonce.1696 1695 * @uses is_site_admin() Checks to see if the user is a site administrator. 1697 * @uses wpmu_delete_user() Deletes a user from the system. 1696 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs. 1697 * @uses wp_delete_user() Deletes a user from the system on singlesite installs. 1698 * @uses get_site_option Checks if account deletion is allowed 1698 1699 */ 1699 1700 function bp_core_delete_account( $user_id = false ) { … … 1707 1708 return false; 1708 1709 1709 /* Site admins should not be allowed to be deleted */ 1710 if ( bp_core_is_multisite() && is_site_admin( bp_core_get_username( $user_id ) ) ) 1711 return false; 1712 1713 if ( bp_core_is_multisite() && function_exists('wpmu_delete_user') ) { 1710 /* Specifically handle multi-site environment */ 1711 if ( bp_core_is_multisite() ) { 1712 /* Site admins cannot be deleted */ 1713 if ( is_site_admin( bp_core_get_username( $user_id ) ) ) 1714 return false; 1715 1714 1716 require_once( ABSPATH . '/wp-admin/includes/mu.php' ); 1715 1717 require_once( ABSPATH . '/wp-admin/includes/user.php' ); … … 1718 1720 } 1719 1721 1722 /* Single site user deletion */ 1720 1723 require_once( ABSPATH . '/wp-admin/includes/user.php' ); 1721 1724 return wp_delete_user( $user_id );
Note: See TracChangeset
for help on using the changeset viewer.