Changes in trunk/wp-admin/user-edit.php [17381:15135]
- File:
-
- 1 edited
-
trunk/wp-admin/user-edit.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r17381 r15135 25 25 26 26 wp_enqueue_script('user-profile'); 27 wp_enqueue_script('password-strength-meter'); 27 28 28 29 $title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User'); … … 31 32 else 32 33 $submenu_file = 'profile.php'; 33 34 if ( current_user_can('edit_users') && !is_user_admin() ) 35 $parent_file = 'users.php'; 36 else 37 $parent_file = 'profile.php'; 34 $parent_file = 'users.php'; 38 35 39 36 // contextual help - choose Help on the top right of admin panel to preview this. … … 88 85 wp_update_user( get_object_vars( $user ) ); 89 86 delete_option( $current_user->ID . '_new_email' ); 90 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );87 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); 91 88 die(); 92 89 } 93 90 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 94 91 delete_option( $current_user->ID . '_new_email' ); 95 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );92 wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); 96 93 die(); 97 94 } 98 95 99 96 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 100 105 case 'update': 101 106 … … 124 129 if ( $user_id != $current_user->ID ) { 125 130 $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:{}'" ); 126 if ( !is_network_admin() &&null == $cap && $_POST[ 'role' ] == '' ) {131 if ( null == $cap && $_POST[ 'role' ] == '' ) { 127 132 $_POST[ 'role' ] = 'contributor'; 128 133 $delete_role = true; … … 134 139 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 135 140 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 ) )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 ) ) 137 142 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 138 143 } … … 140 145 if ( !is_wp_error( $errors ) ) { 141 146 $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; 142 if ( $wp_http_referer ) 143 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 147 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 144 148 wp_redirect($redirect); 145 149 exit; … … 152 156 wp_die(__('You do not have permission to edit this user.')); 153 157 154 include ( ABSPATH . 'wp-admin/admin-header.php');158 include ('admin-header.php'); 155 159 ?> 156 160 … … 162 166 <p><strong><?php _e('User updated.') ?></strong></p> 163 167 <?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?> 164 <p><a href=" <?php echo esc_url( $wp_http_referer ); ?>"><?php _e('← Back to Authors and Users'); ?></a></p>168 <p><a href="users.php"><?php _e('← Back to Authors and Users'); ?></a></p> 165 169 <?php endif; ?> 166 170 </div> … … 174 178 <h2><?php echo esc_html( $title ); ?></h2> 175 179 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'); ?>>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'); ?>> 177 181 <?php wp_nonce_field('update-user_' . $user_id) ?> 178 182 <?php if ( $wp_http_referer ) : ?> … … 203 207 <tr> 204 208 <th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th> 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); ?> 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 ?> 220 215 </table> 221 216 <?php … … 232 227 </tr> 233 228 234 <?php if ( !IS_PROFILE_PAGE && !is_network_admin() ): ?>229 <?php if ( !IS_PROFILE_PAGE ): ?> 235 230 <tr><th><label for="role"><?php _e('Role:') ?></label></th> 236 231 <td><select name="role" id="role"> … … 251 246 ?> 252 247 </select> 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; ?> 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> 250 <?php } ?> 263 251 </td></tr> 264 <?php }?>252 <?php endif; //!IS_PROFILE_PAGE ?> 265 253 266 254 <tr> … … 320 308 if ( $new_email && $new_email != $current_user->user_email ) : ?> 321 309 <div class="updated inline"> 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>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> 323 311 </div> 324 312 <?php endif; ?> … … 332 320 333 321 <?php 334 foreach (_wp_get_user_contactmethods( $profileuser) as $name => $desc) {322 foreach (_wp_get_user_contactmethods() as $name => $desc) { 335 323 ?> 336 324 <tr> … … 348 336 <tr> 349 337 <th><label for="description"><?php _e('Biographical Info'); ?></label></th> 350 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped?></textarea><br />338 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description); ?></textarea><br /> 351 339 <span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td> 352 340 </tr> … … 394 382 <?php } ?> 395 383 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 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> 401 389 </form> 402 390 </div> … … 411 399 </script> 412 400 <?php 413 include( ABSPATH . 'wp-admin/admin-footer.php');414 ?> 401 include('./admin-footer.php'); 402 ?>
Note: See TracChangeset
for help on using the changeset viewer.