WordPress.org

Make WordPress Core

Changeset 33885


Ignore:
Timestamp:
09/03/15 08:53:23 (2 years ago)
Author:
SergeyBiryukov
Message:

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

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

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/users.php

    r33434 r33885  
    1010require_once( dirname( __FILE__ ) . '/admin.php' ); 
    1111 
    12 if ( ! current_user_can( 'list_users' ) ) 
    13     wp_die( __( 'Cheatin’ uh?' ), 403 ); 
     12if ( ! current_user_can( 'list_users' ) ) { 
     13    wp_die( 
     14        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . 
     15        '<p>' . __( 'You are not allowed to browse users.' ) . '</p>', 
     16        403 
     17    ); 
     18} 
    1419 
    1520$wp_list_table = _get_list_table('WP_Users_List_Table'); 
     
    128133 
    129134        // If the user doesn't already belong to the blog, bail. 
    130         if ( is_multisite() && !is_user_member_of_blog( $id ) ) 
    131             wp_die( __( 'Cheatin&#8217; uh?' ), 403 ); 
     135        if ( is_multisite() && !is_user_member_of_blog( $id ) ) { 
     136            wp_die( 
     137                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . 
     138                '<p>' . __( 'One of the selected users in not a member of this site.' ) . '</p>', 
     139                403 
     140            ); 
     141        } 
    132142 
    133143        $user = get_userdata( $id ); 
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r33861 r33885  
    24122412 
    24132413        if ( ! current_user_can( 'list_users' ) ) 
    2414             return new IXR_Error( 401, __( 'Sorry, you cannot list users.' ) ); 
     2414            return new IXR_Error( 401, __( 'You are not allowed to browse users.' ) ); 
    24152415 
    24162416        $query = array( 'fields' => 'all_with_meta' ); 
Note: See TracChangeset for help on using the changeset viewer.