WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/06/2009 10:00:05 PM (10 years ago)
Author:
ryan
Message:

Add get_editable_roles() and role filtering. Props jeremyclarke. fixes #8770

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r10053 r10323  
    4040switch ($doaction) {
    4141
     42/* Bulk Dropdown menu Role changes */
    4243case 'promote':
    4344    check_admin_referer('bulk-users');
     
    4849    }
    4950
    50     if ( !current_user_can('edit_users') )
    51         wp_die(__('You can’t edit users.'));
     51    $editable_roles = get_editable_roles();
     52    if (!$editable_roles[$_REQUEST['new_role']])
     53        wp_die(__('You can’t give users that role.'));
    5254
    5355    $userids = $_REQUEST['users'];
Note: See TracChangeset for help on using the changeset viewer.