Ticket #16501: 16501.2.diff
File 16501.2.diff, 3.5 KB (added by , 13 years ago) |
---|
-
wp-admin/users.php
48 48 case 'promote': 49 49 check_admin_referer('bulk-users'); 50 50 51 if ( ! current_user_can( 'promote_users' ) ) 52 wp_die( __( 'You can’t edit that user.' ) ); 53 51 54 if ( empty($_REQUEST['users']) ) { 52 55 wp_redirect($redirect); 53 56 exit(); … … 352 355 echo esc_html( $title ); 353 356 if ( current_user_can( 'create_users' ) ) { ?> 354 357 <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a> 355 <?php } elseif ( current_user_can( 'promote_users' ) ) { ?>358 <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?> 356 359 <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a> 357 360 <?php } 358 361 -
wp-admin/includes/class-wp-users-list-table.php
132 132 function extra_tablenav( $which ) { 133 133 if ( 'top' != $which ) 134 134 return; 135 if ( ! current_user_can( 'promote_users' ) ) 136 return; 135 137 ?> 136 138 <div class="alignleft actions"> 137 139 <label class="screen-reader-text" for="new_role"><?php _e( 'Change role to…' ) ?></label> -
wp-admin/user-new.php
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can('create_users') && ! current_user_can('promote_users') ) 13 wp_die(__('Cheatin’ uh?')); 12 if ( is_multisite() ) { 13 if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) 14 wp_die( __( 'Cheatin’ uh?' ) ); 15 } elseif ( ! current_user_can( 'create_users' ) ) { 16 wp_die( __( 'Cheatin’ uh?' ) ); 17 } 14 18 15 19 if ( is_multisite() ) { 16 20 function admin_created_user_email( $text ) { -
wp-admin/menu.php
191 191 if ( current_user_can('list_users') ) { 192 192 $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. 193 193 $submenu['users.php'][5] = array(__('Users'), 'list_users', 'users.php'); 194 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php'); 194 if ( current_user_can('create_users') ) 195 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); 196 else 197 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php'); 195 198 196 199 $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php'); 197 200 } else { 198 201 $_wp_real_parent_file['users.php'] = 'profile.php'; 199 202 $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); 200 $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php'); 203 if ( current_user_can('create_users') ) 204 $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php'); 205 else 206 $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php'); 201 207 } 202 208 203 209 $menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' );