Check create_users cap instead of edit_users wgen adding/inserting users. Props imwebgefunden. fixes #6662 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@7660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b9b5291c18
commit
4c9d2e9dfa
|
@ -434,7 +434,7 @@ case 'add-meta' :
|
||||||
break;
|
break;
|
||||||
case 'add-user' :
|
case 'add-user' :
|
||||||
check_ajax_referer( $action );
|
check_ajax_referer( $action );
|
||||||
if ( !current_user_can('edit_users') )
|
if ( !current_user_can('create_users') )
|
||||||
die('-1');
|
die('-1');
|
||||||
require_once(ABSPATH . WPINC . '/registration.php');
|
require_once(ABSPATH . WPINC . '/registration.php');
|
||||||
if ( !$user_id = add_user() )
|
if ( !$user_id = add_user() )
|
||||||
|
|
|
@ -378,6 +378,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
|
<?php if ( current_user_can('create_users') ) { ?>
|
||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
|
<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
|
||||||
|
@ -452,6 +453,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} // end of the $action switch
|
} // end of the $action switch
|
||||||
|
|
Loading…
Reference in New Issue