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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2009-01-06 22:00:05 +00:00
parent 69914b0ae2
commit cb38e921dc
3 changed files with 55 additions and 13 deletions

View File

@@ -39,6 +39,7 @@ if ( empty($_REQUEST) ) {
switch ($doaction) {
/* Bulk Dropdown menu Role changes */
case 'promote':
check_admin_referer('bulk-users');
@@ -47,8 +48,9 @@ case 'promote':
exit();
}
if ( !current_user_can('edit_users') )
wp_die(__('You can’t edit users.'));
$editable_roles = get_editable_roles();
if (!$editable_roles[$_REQUEST['new_role']])
wp_die(__('You can’t give users that role.'));
$userids = $_REQUEST['users'];
$update = 'promote';