Changeset 12928
- Timestamp:
- 02/02/2010 06:00:45 PM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
-
includes/ms.php (modified) (2 diffs)
-
user-edit.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r12920 r12928 267 267 add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2); 268 268 269 function update_profile_email() {270 global $current_user, $wpdb;271 if ( isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {272 $new_email = get_option( $current_user->ID . '_new_email' );273 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {274 $user->ID = $current_user->ID;275 $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) );276 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) )277 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );278 wp_update_user( get_object_vars( $user ) );279 delete_option( $current_user->ID . '_new_email' );280 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );281 die();282 }283 }284 }285 286 269 function send_confirmation_on_profile_email() { 287 270 global $errors, $wpdb, $current_user, $current_site; … … 804 787 } 805 788 806 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) ) {807 add_action( 'admin_init', 'update_profile_email' );808 }809 810 789 function stripslashes_from_options( $blog_id ) { 811 790 global $wpdb; -
trunk/wp-admin/user-edit.php
r12842 r12928 65 65 if ( is_multisite() && !defined( "EDIT_ANY_USER" ) && !is_super_admin() && $user_id != $current_user->ID ) 66 66 wp_die( __( 'You do not have permission to edit this user.' ) ); 67 68 // Execute confirmed email change. See send_confirmation_on_profile_email(). 69 if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) { 70 $new_email = get_option( $current_user->ID . '_new_email' ); 71 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) { 72 $user->ID = $current_user->ID; 73 $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) ); 74 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) 75 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); 76 wp_update_user( get_object_vars( $user ) ); 77 delete_option( $current_user->ID . '_new_email' ); 78 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); 79 die(); 80 } 81 } 67 82 68 83 switch ($action) {
Note: See TracChangeset
for help on using the changeset viewer.