X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..refs/tags/wordpress-4.5:/wp-admin/user-edit.php diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 29af2431..04c19fb4 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -39,7 +39,7 @@ else $profile_help = '

' . __('Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.') . '

' . '

' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '

' . '

' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '

' . - '

' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out of All Other Sessions button.' ) . '

' . + '

' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '

' . '

' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '

' . '

' . __('Remember to click the Update Profile button when you are finished.') . '

'; @@ -55,26 +55,10 @@ get_current_screen()->set_help_sidebar( '

' . __('Support Forums') . '

' ); -$wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer ); +$wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer ); $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); -/** - * Optional SSL preference that can be turned on by hooking to the 'personal_options' action. - * - * @since 2.7.0 - * - * @param object $user User data object - */ -function use_ssl_preference($user) { -?> - - - - -ID ) { - $new_email = get_option( $current_user->ID . '_new_email' ); - if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) { + $new_email = get_user_meta( $current_user->ID, '_new_email', true ); + if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) { $user = new stdClass; $user->ID = $current_user->ID; $user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) ); - if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) + if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) { $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); + } wp_update_user( $user ); - delete_option( $current_user->ID . '_new_email' ); - wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); + delete_user_meta( $current_user->ID, '_new_email' ); + wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) ); die(); + } else { + wp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) ); } -} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { - delete_option( $current_user->ID . '_new_email' ); +} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) { + check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' ); + delete_user_meta( $current_user->ID, '_new_email' ); wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); die(); } @@ -192,27 +180,34 @@ include(ABSPATH . 'wp-admin/admin-header.php');

- +

+ +
+ +

+ +
+

\n

", $errors->get_error_messages() ); ?>

-

+

- + - + -

+

-

+

@@ -301,7 +296,7 @@ do_action( 'personal_options', $profileuser ); } ?> -

+

@@ -392,17 +387,28 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
-

+

- + @@ -439,7 +445,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c ?>
ID . '_new_email' ); + $new_email = get_user_meta( $current_user->ID, '_new_email', true ); if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
-

%1$s. Cancel'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?>

+

' . esc_html( $new_email['newemail'] ) . '' + ); + printf( + ' %2$s', + esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), + __( 'Cancel' ) + ); + ?>

-

+

@@ -448,27 +454,85 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c

+ + + + + + + +
+ +

+ - + + + + + @@ -476,9 +540,9 @@ if ( $show_password_fields ) : get_all() ) === 1 ) : ?> - + get_all() ) > 1 ) : ?> - + get_all() ) : ?> - + @@ -541,7 +605,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?> * * The 'Additional Capabilities' section will only be enabled if * the number of the user's capabilities exceeds their number of - * of roles. + * roles. * * @since 2.8.0 * @@ -551,7 +615,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?> if ( count( $profileuser->caps ) > count( $profileuser->roles ) && apply_filters( 'additional_capabilities_display', true, $profileuser ) ) : ?> -

+

- -

+ +
+ + + + + + +
- +

-
-
-

+
+
  -
+

@@ -486,23 +550,23 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
  -
+

- +

  -

+

display_name ); + printf( __( 'Log %s out of all locations.' ), $profileuser->display_name ); ?>