Check create_users cap instead of edit_users wgen adding/inserting users. Props imwebgefunden. fixes #6662 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9be8f95463
commit
142146177c
@ -434,7 +434,7 @@ case 'add-meta' :
|
||||
break;
|
||||
case 'add-user' :
|
||||
check_ajax_referer( $action );
|
||||
if ( !current_user_can('edit_users') )
|
||||
if ( !current_user_can('create_users') )
|
||||
die('-1');
|
||||
require_once(ABSPATH . WPINC . '/registration.php');
|
||||
if ( !$user_id = add_user() )
|
||||
|
@ -378,6 +378,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
|
||||
?>
|
||||
|
||||
<br class="clear" />
|
||||
<?php if ( current_user_can('create_users') ) { ?>
|
||||
|
||||
<div class="wrap">
|
||||
<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
|
||||
@ -452,6 +453,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
break;
|
||||
|
||||
} // end of the $action switch
|
||||
|
Loading…
Reference in New Issue
Block a user