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. Built from https://develop.svn.wordpress.org/trunk@33888 git-svn-id: http://core.svn.wordpress.org/trunk@33857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
771b29455b
commit
bc8af88903
|
@ -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’ 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'] );
|
||||
|
|
|
@ -135,7 +135,7 @@ case 'promote':
|
|||
if ( is_multisite() && !is_user_member_of_blog( $id ) ) {
|
||||
wp_die(
|
||||
'<h1>' . __( 'Cheatin’ 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
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33887';
|
||||
$wp_version = '4.4-alpha-33888';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue