Make WordPress Core


Ignore:
Timestamp:
06/25/2017 06:45:33 PM (7 years ago)
Author:
johnbillion
Message:

Users: Use more appropriate HTTP status codes for errors relating to user management.

Also re-uses one error message string.

Props tuanmh

Fixes #40230

File:
1 edited

Legend:

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

    r40780 r40940  
    1212
    1313if ( ! current_user_can('manage_sites') )
    14     wp_die(__('Sorry, you are not allowed to edit this site.'));
     14    wp_die( __( 'Sorry, you are not allowed to edit this site.' ), 403 );
    1515
    1616$wp_list_table = _get_list_table('WP_Users_List_Table');
     
    116116        case 'remove':
    117117            if ( ! current_user_can( 'remove_users' ) ) {
    118                 wp_die( __( 'Sorry, you are not allowed to remove users.' ) );
     118                wp_die( __( 'Sorry, you are not allowed to remove users.' ), 403 );
    119119            }
    120120
     
    147147
    148148            if ( empty( $editable_roles[ $role ] ) ) {
    149                 wp_die( __( 'Sorry, you are not allowed to give users that role.' ) );
     149                wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );
    150150            }
    151151
Note: See TracChangeset for help on using the changeset viewer.