Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to add an existing user via username.

Props dhanendran.
Fixes #39202. See #37616.

Built from https://develop.svn.wordpress.org/trunk@39935


git-svn-id: http://core.svn.wordpress.org/trunk@39872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2017-01-20 17:49:41 +00:00
parent c22fea9120
commit 41fc0c0f5a
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
if ( false !== strpos( $user_email, '@' ) ) {
$user_details = get_user_by( 'email', $user_email );
} else {
if ( is_super_admin() ) {
if ( current_user_can( 'manage_network_users' ) ) {
$user_details = get_user_by( 'login', $user_email );
} else {
wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) );
@ -313,7 +313,7 @@ if ( ! empty( $messages ) ) {
if ( is_multisite() ) {
if ( $do_both )
echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>';
if ( !is_super_admin() ) {
if ( ! current_user_can( 'manage_network_users' ) ) {
echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';
$label = __('Email');
$type = 'email';

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-39934';
$wp_version = '4.8-alpha-39935';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.