Skip to:
Content

BuddyPress.org

Changeset 2057


Ignore:
Timestamp:
10/26/2009 06:13:26 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1217

Location:
branches/1.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bp-core.php

    r2048 r2057  
    15461546
    15471547    /* Make sure account deletion is not disabled */
    1548     if ( ( !(int) get_site_option( 'bp-disable-account-deletion' ) && !is_site_admin() ) )
     1548    if ( ( '' != get_site_option( 'bp-disable-account-deletion' ) || (int) get_site_option( 'bp-disable-account-deletion' ) ) && !is_site_admin() )
    15491549        return false;
    15501550
  • branches/1.1/bp-core/bp-core-settings.php

    r1990 r2057  
    154154/**** DELETE ACCOUNT ****/
    155155
    156 function bp_core_screen_delete_account() {
    157     global $current_user, $bp_settings_updated, $pass_error;
    158    
    159     if ( isset( $_POST['delete-account-button'] ) ) {
     156function bp_core_screen_delete_account() { 
     157    if ( isset( $_POST['delete-account-understand'] ) ) {
    160158        check_admin_referer( 'delete-account' );
    161        
     159
    162160        // delete the users account
    163161        if ( bp_core_delete_account() )
    164162            bp_core_redirect( site_url() );
    165     }
    166    
    167     $bp_settings_updated = false;
    168     $pass_error = false;
    169    
    170     if ( isset($_POST['submit']) ) {
    171         check_admin_referer('bp_settings_general');
    172        
    173         require_once( WPINC . '/registration.php' );
    174        
    175         // Form has been submitted and nonce checks out, lets do it.
    176        
    177         if ( $_POST['email'] != '' ) {
    178             $current_user->user_email = wp_specialchars( trim( $_POST['email'] ));
    179         }
    180 
    181         if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {
    182             if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {
    183                 $current_user->user_pass = $_POST['pass1'];
    184             } else {
    185                 $pass_error = true;
    186             }
    187         } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
    188             $pass_error = true;
    189         } else {
    190             unset( $current_user->user_pass );
    191         }
    192        
    193         if ( !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )
    194             $bp_settings_updated = true;
    195163    }
    196164   
Note: See TracChangeset for help on using the changeset viewer.