Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/network/site-users.php.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33683. see #14530.

git-svn-id: https://develop.svn.wordpress.org/trunk@33888 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2015-09-03 09:02:13 +00:00
parent 7c32770901
commit 55bb26c58a
2 changed files with 8 additions and 3 deletions

View File

@@ -136,8 +136,13 @@ if ( $action ) {
$user_id = (int) $user_id;
// If the user doesn't already belong to the blog, bail.
if ( !is_user_member_of_blog( $user_id ) )
wp_die( __( 'Cheatin’ uh?' ), 403 );
if ( ! is_user_member_of_blog( $user_id ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403
);
}
$user = get_userdata( $user_id );
$user->set_role( $_REQUEST['new_role'] );

View File

@@ -135,7 +135,7 @@ case 'promote':
if ( is_multisite() && !is_user_member_of_blog( $id ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'One of the selected users in not a member of this site.' ) . '</p>',
'<p>' . __( 'One of the selected users is not a member of this site.' ) . '</p>',
403
);
}