Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/26/2009 07:03:25 PM (17 years ago)
Author:
apeatling
Message:

Merging 1.1 branch updates with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-settings.php

    r1990 r2059  
    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.