Make WordPress Core

Ticket #37836: 37836.3.patch

File 37836.3.patch, 2.3 KB (added by Mista-Flo, 8 years ago)

Fix if state with promote user cap test

  • wp-admin/user-new.php

    diff --git wp-admin/user-new.php wp-admin/user-new.php
    index 38b78dd..72fba5e 100644
    if ( ! empty( $messages ) ) { 
    303303<div id="ajax-response"></div>
    304304
    305305<?php
    306 if ( is_multisite() ) {
    307         if ( $do_both )
     306if ( is_multisite() && current_user_can( 'promote_users' ) ) {
     307        if ( $do_both ) {
    308308                echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>';
    309         if ( !is_super_admin() ) {
     309        }
     310
     311        if ( ! is_super_admin() ) {
    310312                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>';
    311313                $label = __('Email');
    312314                $type  = 'email';
    do_action( 'user_new_form', 'add-existing-user' ); 
    366368} // is_multisite()
    367369
    368370if ( current_user_can( 'create_users') ) {
    369         if ( $do_both )
     371        if ( $do_both ) {
    370372                echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>';
     373        }
    371374?>
    372375<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
    373376<form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php