Changeset 17432
- Timestamp:
- 02/09/2011 05:30:46 PM (14 years ago)
- Location:
- branches/3.1/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/wp-admin/includes/class-wp-users-list-table.php
r17324 r17432 132 132 function extra_tablenav( $which ) { 133 133 if ( 'top' != $which ) 134 return; 135 if ( ! current_user_can( 'promote_users' ) ) 134 136 return; 135 137 ?> -
branches/3.1/wp-admin/menu.php
r17267 r17432 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'); … … 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 -
branches/3.1/wp-admin/user-new.php
r17069 r17432 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() ) { -
branches/3.1/wp-admin/users.php
r17366 r17432 48 48 case 'promote': 49 49 check_admin_referer('bulk-users'); 50 51 if ( ! current_user_can( 'promote_users' ) ) 52 wp_die( __( 'You can’t edit that user.' ) ); 50 53 51 54 if ( empty($_REQUEST['users']) ) { … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.