General: Further improve error messages following [42648].
Props kristastevens, melchoyce. Fixes #38332 for trunk. Built from https://develop.svn.wordpress.org/trunk@42719 git-svn-id: http://core.svn.wordpress.org/trunk@42547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -12,14 +12,14 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
if ( is_multisite() ) {
|
||||
if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'You don’t have permission to do this.' ) . '</h1>' .
|
||||
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
}
|
||||
} elseif ( ! current_user_can( 'create_users' ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'You don’t have permission to do this.' ) . '</h1>' .
|
||||
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
@@ -52,7 +52,7 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) {
|
||||
|
||||
if ( ! current_user_can( 'promote_user', $user_details->ID ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'You don’t have permission to do this.' ) . '</h1>' .
|
||||
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
@@ -136,7 +136,7 @@ Please click the following link to confirm the invite:
|
||||
|
||||
if ( ! current_user_can( 'create_users' ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'You don’t have permission to do this.' ) . '</h1>' .
|
||||
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>',
|
||||
403
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user