Changes in trunk/wp-admin/user-edit.php [15135:17381]
- File:
-
- 1 edited
-
trunk/wp-admin/user-edit.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r15135 r17381 25 25 26 26 wp_enqueue_script('user-profile'); 27 wp_enqueue_script('password-strength-meter');28 27 29 28 $title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User'); … … 32 31 else 33 32 $submenu_file = 'profile.php'; 34 $parent_file = 'users.php'; 33 34 if ( current_user_can('edit_users') && !is_user_admin() ) 35 $parent_file = 'users.php'; 36 else 37 $parent_file = 'profile.php'; 35 38 36 39 // contextual help - choose Help on the top right of admin panel to preview this. … … 85 88 wp_update_user( get_object_vars( $user ) ); 86 89 delete_option( $current_user->ID . '_new_email' ); 87 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );90 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); 88 91 die(); 89 92 } 90 93 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 91 94 delete_option( $current_user->ID . '_new_email' ); 92 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) );95 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); 93 96 die(); 94 97 } 95 98 96 99 switch ($action) { 97 case 'switchposts':98 99 check_admin_referer();100 101 /* TODO: Switch all posts from one user to another user */102 103 break;104 105 100 case 'update': 106 101 … … 129 124 if ( $user_id != $current_user->ID ) { 130 125 $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" ); 131 if ( null == $cap && $_POST[ 'role' ] == '' ) {126 if ( !is_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) { 132 127 $_POST[ 'role' ] = 'contributor'; 133 128 $delete_role = true; … … 139 134 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 140 135 141 if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )136 if ( is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) 142 137 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 143 138 } … … 145 140 if ( !is_wp_error( $errors ) ) { 146 141 $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; 147 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 142 if ( $wp_http_referer ) 143 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 148 144 wp_redirect($redirect); 149 145 exit; … … 156 152 wp_die(__('You do not have permission to edit this user.')); 157 153 158 include ( 'admin-header.php');154 include (ABSPATH . 'wp-admin/admin-header.php'); 159 155 ?> 160 156 … … 166 162 <p><strong><?php _e('User updated.') ?></strong></p> 167 163 <?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?> 168 <p><a href=" users.php"><?php _e('← Back to Authors and Users'); ?></a></p>164 <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('← Back to Authors and Users'); ?></a></p> 169 165 <?php endif; ?> 170 166 </div> … … 178 174 <h2><?php echo esc_html( $title ); ?></h2> 179 175 180 <form id="your-profile" action="<?php echo esc_url( admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>176 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>> 181 177 <?php wp_nonce_field('update-user_' . $user_id) ?> 182 178 <?php if ( $wp_http_referer ) : ?> … … 207 203 <tr> 208 204 <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th> 209 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts">More information</a>'); ?></td> 210 </tr> 211 <?php 212 endif; 213 do_action('personal_options', $profileuser); 214 ?> 205 <td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td> 206 </tr> 207 <?php endif; ?> 208 <tr class="show-admin-bar"> 209 <th scope="row"><?php _e('Show Admin Bar')?></th> 210 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Show Admin Bar') ?></span></legend> 211 <label for="admin_bar_front"> 212 <input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> /> 213 <?php /* translators: Show admin bar when viewing site */ _e( 'when viewing site' ); ?></label><br /> 214 <label for="admin_bar_admin"> 215 <input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> /> 216 <?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard' ); ?></label> 217 </td> 218 </tr> 219 <?php do_action('personal_options', $profileuser); ?> 215 220 </table> 216 221 <?php … … 227 232 </tr> 228 233 229 <?php if ( !IS_PROFILE_PAGE ): ?>234 <?php if ( !IS_PROFILE_PAGE && !is_network_admin() ) : ?> 230 235 <tr><th><label for="role"><?php _e('Role:') ?></label></th> 231 236 <td><select name="role" id="role"> … … 246 251 ?> 247 252 </select> 248 <?php if ( is_multisite() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 249 <p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.'); ?></label></p> 253 <?php endif; //!IS_PROFILE_PAGE 254 255 if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 256 <tr><th><label for="role"><?php _e('Super Admin'); ?></label></th> 257 <td> 258 <?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?> 259 <p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p> 260 <?php else : ?> 261 <p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p> 262 <?php endif; ?> 263 </td></tr> 250 264 <?php } ?> 251 </td></tr>252 <?php endif; //!IS_PROFILE_PAGE ?>253 265 254 266 <tr> … … 308 320 if ( $new_email && $new_email != $current_user->user_email ) : ?> 309 321 <div class="updated inline"> 310 <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>322 <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p> 311 323 </div> 312 324 <?php endif; ?> … … 320 332 321 333 <?php 322 foreach (_wp_get_user_contactmethods( ) as $name => $desc) {334 foreach (_wp_get_user_contactmethods( $profileuser ) as $name => $desc) { 323 335 ?> 324 336 <tr> … … 336 348 <tr> 337 349 <th><label for="description"><?php _e('Biographical Info'); ?></label></th> 338 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description);?></textarea><br />350 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea><br /> 339 351 <span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td> 340 352 </tr> … … 382 394 <?php } ?> 383 395 384 < p class="submit">385 <input type="hidden" name="action" value="update" />386 <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" /> 387 <input type="submit" class="button-primary" value="<?php IS_PROFILE_PAGE ? esc_attr_e('Update Profile') : esc_attr_e('Update User') ?>" name="submit" />388 </p> 396 <input type="hidden" name="action" value="update" /> 397 <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" /> 398 399 <?php submit_button( IS_PROFILE_PAGE ? __('Update Profile') : __('Update User') ); ?> 400 389 401 </form> 390 402 </div> … … 399 411 </script> 400 412 <?php 401 include( './admin-footer.php');402 ?> 413 include( ABSPATH . 'wp-admin/admin-footer.php'); 414 ?>
Note: See TracChangeset
for help on using the changeset viewer.