Make WordPress Core


Ignore:
Timestamp:
02/09/2011 05:30:46 PM (14 years ago)
Author:
ryan
Message:

Add additional promote_users checks. Show Add existing button only for multisite. Don't show bulk actions if user can't promote users. Show add new user menu if user has create_users but not promote_users. Props nacin. fixes #16501 for 3.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/wp-admin/users.php

    r17366 r17432  
    4848case 'promote':
    4949    check_admin_referer('bulk-users');
     50
     51    if ( ! current_user_can( 'promote_users' ) )
     52        wp_die( __( 'You can’t edit that user.' ) );
    5053
    5154    if ( empty($_REQUEST['users']) ) {
     
    353356if ( current_user_can( 'create_users' ) ) { ?>
    354357    <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' ) ) { ?>
    356359    <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
    357360<?php }
Note: See TracChangeset for help on using the changeset viewer.