Nonces are already per-user. see #22862.

Built from https://develop.svn.wordpress.org/trunk@26793


git-svn-id: http://core.svn.wordpress.org/trunk@26680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-12-08 07:05:10 +00:00
parent 31c6f909d2
commit 7dbfca1778
2 changed files with 5 additions and 7 deletions

View File

@ -2249,9 +2249,7 @@ function wp_ajax_get_revision_diffs() {
function wp_ajax_save_user_color_scheme() {
global $_wp_admin_css_colors;
$user_id = get_current_user_id();
check_ajax_referer( 'save-color-scheme_' . $user_id, 'nonce' );
check_ajax_referer( 'save-color-scheme', 'nonce' );
$color_scheme = sanitize_key( $_POST['color_scheme'] );
@ -2259,6 +2257,6 @@ function wp_ajax_save_user_color_scheme() {
wp_send_json_error();
}
update_user_meta( $user_id, 'admin_color', $color_scheme );
update_user_meta( get_current_user_id(), 'admin_color', $color_scheme );
wp_send_json_success();
}

View File

@ -562,7 +562,7 @@ function saveDomDocument($doc, $filename) {
* @since 3.0.0
*/
function admin_color_scheme_picker() {
global $_wp_admin_css_colors, $user_id;
global $_wp_admin_css_colors;
ksort( $_wp_admin_css_colors );
@ -571,7 +571,7 @@ function admin_color_scheme_picker() {
$_wp_admin_css_colors = array_merge( array( 'fresh' => '', 'light' => '' ), $_wp_admin_css_colors );
}
$current_color = get_user_option( 'admin_color', $user_id );
$current_color = get_user_option( 'admin_color' );
if ( empty( $current_color ) || ! isset( $_wp_admin_css_colors[ $current_color ] ) ) {
$current_color = 'fresh';
@ -581,7 +581,7 @@ function admin_color_scheme_picker() {
<fieldset id="color-picker" class="scheme-list">
<legend class="screen-reader-text"><span><?php _e( 'Admin Color Scheme' ); ?></span></legend>
<?php
wp_nonce_field( 'save-color-scheme_' . $user_id, 'color-nonce', false );
wp_nonce_field( 'save-color-scheme', 'color-nonce', false );
foreach ( $_wp_admin_css_colors as $color => $color_info ) :
?>