Ticket #11271: 11271.diff
File 11271.diff, 4.7 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/template.php
### Eclipse Workspace Patch 1.0 #P wordpress-trunk
1913 1913 if ($current_user->ID == $user_object->ID) { 1914 1914 $edit_link = 'profile.php'; 1915 1915 } else { 1916 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_ id=$user_object->ID" ) );1916 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_to_edit=$user_object->ID" ) ); 1917 1917 } 1918 1918 $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />"; 1919 1919 -
wp-admin/user-edit.php
22 22 $submenu_file = 'profile.php'; 23 23 $parent_file = 'users.php'; 24 24 25 wp_reset_vars(array('action', 'redirect', 'profile', 'user_ id', 'wp_http_referer'));25 wp_reset_vars(array('action', 'redirect', 'profile', 'user_to_edit', 'wp_http_referer')); 26 26 27 27 $wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); 28 28 29 $user_ id = (int) $user_id;29 $user_to_edit = (int) $user_to_edit; 30 30 31 if ( !$user_ id) {31 if ( !$user_to_edit ) { 32 32 if ( IS_PROFILE_PAGE ) { 33 33 $current_user = wp_get_current_user(); 34 $user_ id= $current_user->ID;34 $user_to_edit = $current_user->ID; 35 35 } else { 36 36 wp_die(__('Invalid user ID.')); 37 37 } 38 } elseif ( !get_userdata($user_ id) ) {38 } elseif ( !get_userdata($user_to_edit) ) { 39 39 wp_die( __('Invalid user ID.') ); 40 40 } 41 41 … … 71 71 72 72 case 'update': 73 73 74 check_admin_referer('update-user_' . $user_ id);74 check_admin_referer('update-user_' . $user_to_edit); 75 75 76 if ( !current_user_can('edit_user', $user_ id) )76 if ( !current_user_can('edit_user', $user_to_edit) ) 77 77 wp_die(__('You do not have permission to edit this user.')); 78 78 79 79 if ( IS_PROFILE_PAGE ) 80 do_action('personal_options_update', $user_ id);80 do_action('personal_options_update', $user_to_edit); 81 81 else 82 do_action('edit_user_profile_update', $user_ id);82 do_action('edit_user_profile_update', $user_to_edit); 83 83 84 $errors = edit_user($user_ id);84 $errors = edit_user($user_to_edit); 85 85 86 86 if ( !is_wp_error( $errors ) ) { 87 $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_ id=$user_id&"). "updated=true";87 $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_to_edit=$user_to_edit&"). "updated=true"; 88 88 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 89 89 wp_redirect($redirect); 90 90 exit; 91 91 } 92 92 93 93 default: 94 $profileuser = get_user_to_edit($user_ id);94 $profileuser = get_user_to_edit($user_to_edit); 95 95 96 if ( !current_user_can('edit_user', $user_ id) )96 if ( !current_user_can('edit_user', $user_to_edit) ) 97 97 wp_die(__('You do not have permission to edit this user.')); 98 98 99 99 include ('admin-header.php'); … … 123 123 <h2><?php echo esc_html( $title ); ?></h2> 124 124 125 125 <form id="your-profile" action="<?php if ( IS_PROFILE_PAGE ) { echo admin_url('profile.php'); } else { echo admin_url('user-edit.php'); } ?>" method="post"> 126 <?php wp_nonce_field('update-user_' . $user_ id) ?>126 <?php wp_nonce_field('update-user_' . $user_to_edit) ?> 127 127 <?php if ( $wp_http_referer ) : ?> 128 128 <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" /> 129 129 <?php endif; ?> 130 130 <p> 131 131 <input type="hidden" name="from" value="profile" /> 132 <input type="hidden" name="checkuser_id" value="<?php echo $user_ ID?>" />132 <input type="hidden" name="checkuser_id" value="<?php echo $user_to_edit ?>" /> 133 133 </p> 134 134 135 135 <h3><?php _e('Personal Options'); ?></h3> … … 146 146 <th scope="row"><?php _e('Admin Color Scheme')?></th> 147 147 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Admin Color Scheme')?></span></legend> 148 148 <?php 149 $current_color = get_user_option('admin_color', $user_ id);149 $current_color = get_user_option('admin_color', $user_to_edit); 150 150 if ( empty($current_color) ) 151 151 $current_color = 'fresh'; 152 152 foreach ( $_wp_admin_css_colors as $color => $color_info ): ?> … … 333 333 334 334 <p class="submit"> 335 335 <input type="hidden" name="action" value="update" /> 336 <input type="hidden" name="user_ id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />336 <input type="hidden" name="user_to_edit" id="user_to_edit" value="<?php echo esc_attr($user_to_edit); ?>" /> 337 337 <input type="submit" class="button-primary" value="<?php IS_PROFILE_PAGE ? esc_attr_e('Update Profile') : esc_attr_e('Update User') ?>" name="submit" /> 338 338 </p> 339 339 </form>