Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/27/2010 10:57:31 PM (14 years ago)
Author:
djpaul
Message:

Removes trailing whitespace. Fixes #2965, props cnorris23

File:
1 edited

Legend:

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

    r3578 r3592  
    2424    if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) )
    2525        bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_my_profile() ) );
    26    
     26
    2727    do_action( 'bp_core_settings_setup_nav' );
    2828}
     
    4545
    4646        // Form has been submitted and nonce checks out, lets do it.
    47        
     47
    4848        // Validate the user again for the current password when making a big change
    4949        if ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password($_POST['pwd'], $current_user->user_pass, $current_user->ID) ) {
    50  
     50
    5151            // Make sure changing an email address does not already exist
    5252            if ( $_POST['email'] != '' ) {
    53  
     53
    5454                // What is missing from the profile page vs signup - lets double check the goodies
    5555                $user_email = sanitize_email( wp_specialchars( trim( $_POST['email'] ) ) );
    56  
     56
    5757                if ( !is_email( $user_email ) )
    5858                    $email_error = true;
    59  
     59
    6060                $limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' );
    61  
     61
    6262                if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
    6363                    $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
    64  
     64
    6565                    if ( in_array( $emaildomain, (array)$limited_email_domains ) == false ) {
    6666                        $email_error = true;
    67                        
     67
    6868                    }
    6969                }
    70  
     70
    7171                if ( !$email_error && $current_user->user_email != $user_email  ) {
    72                
     72
    7373                    //we don't want email dups in the system
    7474                    if ( email_exists( $user_email ) )
    7575                        $email_error = true;
    76                        
     76
    7777                    if (!$email_error)
    7878                        $current_user->user_email = $user_email;
    7979                }
    8080            }
    81  
     81
    8282            if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {
    83            
     83
    8484                if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) )
    8585                    $current_user->user_pass = $_POST['pass1'];
    8686                else
    8787                    $pass_error = true;
    88  
     88
    8989            } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
    9090                $pass_error = true;
     
    9292                unset( $current_user->user_pass );
    9393            }
    94  
     94
    9595            if ( !$email_error && !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )
    9696                $bp_settings_updated = true;
    97            
     97
    9898        } else {
    9999            $pwd_error = true;
    100100        }
    101        
     101
    102102        do_action( 'bp_core_general_settings_after_save' );
    103103    }
     
    127127        </div>
    128128    <?php } ?>
    129    
     129
    130130    <?php if ( $pwd_error && !$bp_settings_updated ) { ?>
    131131        <div id="message" class="error fade">
     
    134134    <?php } ?>
    135135
    136     <?php 
     136    <?php
    137137    if ( $email_error && !$bp_settings_updated ) { ?>
    138138        <div id="message" class="error fade">
     
    153153        <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?><br />
    154154        <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ) ?>
    155        
     155
    156156        <?php do_action( 'bp_core_general_settings_before_submit' ) ?>
    157157
     
    159159            <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto" />
    160160        </div>
    161        
     161
    162162        <?php do_action( 'bp_core_general_settings_after_submit' ) ?>
    163163
     
    184184
    185185        $bp_settings_updated = true;
    186        
     186
    187187        do_action( 'bp_core_notification_settings_after_save' );
    188188    }
     
    217217
    218218        <?php do_action( 'bp_core_notification_settings_after_submit' ) ?>
    219        
     219
    220220        <?php wp_nonce_field('bp_settings_notifications') ?>
    221221
     
    257257
    258258        <?php do_action( 'bp_core_delete_account_before_submit' ) ?>
    259        
     259
    260260        <div class="submit">
    261261            <input type="submit" disabled="disabled" value="<?php _e( 'Delete My Account', 'buddypress' ) ?> &rarr;" id="delete-account-button" name="delete-account-button" />
    262262        </div>
    263        
     263
    264264        <?php do_action( 'bp_core_delete_account_after_submit' ) ?>
    265265
Note: See TracChangeset for help on using the changeset viewer.