WordPress.org

Make WordPress Core

Ticket #39202: 39202.patch

File 39202.patch, 1.0 KB (added by dhanendran, 5 years ago)
  • src/wp-admin/user-new.php

     
    3737        if ( false !== strpos( $user_email, '@' ) ) {
    3838                $user_details = get_user_by( 'email', $user_email );
    3939        } else {
    40                 if ( is_super_admin() ) {
     40                if ( current_user_can( 'manage_network_users' ) ) {
    4141                        $user_details = get_user_by( 'login', $user_email );
    4242                } else {
    4343                        wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) );
     
    313313if ( is_multisite() ) {
    314314        if ( $do_both )
    315315                echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>';
    316         if ( !is_super_admin() ) {
     316        if ( ! current_user_can( 'manage_network_users' ) ) {
    317317                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>';
    318318                $label = __('Email');
    319319                $type  = 'email';