Changeset 3592 for trunk/bp-core/bp-core-settings.php
- Timestamp:
- 12/27/2010 10:57:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-settings.php
r3578 r3592 24 24 if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) 25 25 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 27 27 do_action( 'bp_core_settings_setup_nav' ); 28 28 } … … 45 45 46 46 // Form has been submitted and nonce checks out, lets do it. 47 47 48 48 // Validate the user again for the current password when making a big change 49 49 if ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password($_POST['pwd'], $current_user->user_pass, $current_user->ID) ) { 50 50 51 51 // Make sure changing an email address does not already exist 52 52 if ( $_POST['email'] != '' ) { 53 53 54 54 // What is missing from the profile page vs signup - lets double check the goodies 55 55 $user_email = sanitize_email( wp_specialchars( trim( $_POST['email'] ) ) ); 56 56 57 57 if ( !is_email( $user_email ) ) 58 58 $email_error = true; 59 59 60 60 $limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' ); 61 61 62 62 if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { 63 63 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 64 64 65 65 if ( in_array( $emaildomain, (array)$limited_email_domains ) == false ) { 66 66 $email_error = true; 67 67 68 68 } 69 69 } 70 70 71 71 if ( !$email_error && $current_user->user_email != $user_email ) { 72 72 73 73 //we don't want email dups in the system 74 74 if ( email_exists( $user_email ) ) 75 75 $email_error = true; 76 76 77 77 if (!$email_error) 78 78 $current_user->user_email = $user_email; 79 79 } 80 80 } 81 81 82 82 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) { 83 83 84 84 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) 85 85 $current_user->user_pass = $_POST['pass1']; 86 86 else 87 87 $pass_error = true; 88 88 89 89 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) { 90 90 $pass_error = true; … … 92 92 unset( $current_user->user_pass ); 93 93 } 94 94 95 95 if ( !$email_error && !$pass_error && wp_update_user( get_object_vars( $current_user ) ) ) 96 96 $bp_settings_updated = true; 97 97 98 98 } else { 99 99 $pwd_error = true; 100 100 } 101 101 102 102 do_action( 'bp_core_general_settings_after_save' ); 103 103 } … … 127 127 </div> 128 128 <?php } ?> 129 129 130 130 <?php if ( $pwd_error && !$bp_settings_updated ) { ?> 131 131 <div id="message" class="error fade"> … … 134 134 <?php } ?> 135 135 136 <?php 136 <?php 137 137 if ( $email_error && !$bp_settings_updated ) { ?> 138 138 <div id="message" class="error fade"> … … 153 153 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> <?php _e( 'New Password', 'buddypress' ) ?><br /> 154 154 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ) ?> 155 155 156 156 <?php do_action( 'bp_core_general_settings_before_submit' ) ?> 157 157 … … 159 159 <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ) ?>" id="submit" class="auto" /> 160 160 </div> 161 161 162 162 <?php do_action( 'bp_core_general_settings_after_submit' ) ?> 163 163 … … 184 184 185 185 $bp_settings_updated = true; 186 186 187 187 do_action( 'bp_core_notification_settings_after_save' ); 188 188 } … … 217 217 218 218 <?php do_action( 'bp_core_notification_settings_after_submit' ) ?> 219 219 220 220 <?php wp_nonce_field('bp_settings_notifications') ?> 221 221 … … 257 257 258 258 <?php do_action( 'bp_core_delete_account_before_submit' ) ?> 259 259 260 260 <div class="submit"> 261 261 <input type="submit" disabled="disabled" value="<?php _e( 'Delete My Account', 'buddypress' ) ?> →" id="delete-account-button" name="delete-account-button" /> 262 262 </div> 263 263 264 264 <?php do_action( 'bp_core_delete_account_after_submit' ) ?> 265 265
Note: See TracChangeset
for help on using the changeset viewer.