WordPress.org

Make WordPress Core

Ticket #34521: pemission-messages-on-admin-network.patch

File pemission-messages-on-admin-network.patch, 10.8 KB (added by ramiy, 6 years ago)
  • wp-admin/network/index.php

     
    1717        wp_die( __( 'Multisite support is not enabled.' ) );
    1818
    1919if ( ! current_user_can( 'manage_network' ) )
    20         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     20        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    2121
    2222$title = __( 'Dashboard' );
    2323$parent_file = 'index.php';
  • wp-admin/network/settings.php

     
    1717        wp_die( __( 'Multisite support is not enabled.' ) );
    1818
    1919if ( ! current_user_can( 'manage_network_options' ) )
    20         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     20        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    2121
    2222$title = __( 'Network Settings' );
    2323$parent_file = 'settings.php';
  • wp-admin/network/site-info.php

     
    1515}
    1616
    1717if ( ! current_user_can( 'manage_sites' ) ) {
    18         wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
     18        wp_die( __( 'You are not allowed to edit this site.' ), 403 );
    1919}
    2020
    2121get_current_screen()->add_help_tab( array(
     
    4747}
    4848
    4949if ( ! can_edit_network( $details->site_id ) ) {
    50         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     50        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    5151}
    5252
    5353$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );
  • wp-admin/network/site-new.php

     
    1717        wp_die( __( 'Multisite support is not enabled.' ) );
    1818
    1919if ( ! current_user_can( 'manage_sites' ) )
    20         wp_die( __( 'You do not have sufficient permissions to add sites to this network.' ) );
     20        wp_die( __( 'You are not allowed to add sites to this network.' ), 403 );
    2121
    2222get_current_screen()->add_help_tab( array(
    2323        'id'      => 'overview',
  • wp-admin/network/site-settings.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_sites' ) )
    17         wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
     17        wp_die( __( 'You are not allowed to edit this site.' ), 403 );
    1818
    1919get_current_screen()->add_help_tab( array(
    2020        'id'      => 'overview',
     
    4444}
    4545
    4646if ( !can_edit_network( $details->site_id ) )
    47         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     47        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    4848
    4949$is_main_site = is_main_site( $id );
    5050
  • wp-admin/network/site-themes.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_sites' ) )
    17         wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
     17        wp_die( __( 'You are not allowed to manage themes for this site.' ), 403 );
    1818
    1919get_current_screen()->add_help_tab( array(
    2020        'id'      => 'overview',
     
    6767}
    6868
    6969if ( !can_edit_network( $details->site_id ) )
    70         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     70        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    7171
    7272$is_main_site = is_main_site( $id );
    7373
  • wp-admin/network/site-users.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can('manage_sites') )
    17         wp_die(__('You do not have sufficient permissions to edit this site.'));
     17        wp_die( __( 'You are not allowed to edit this site.' ), 403 );
    1818
    1919$wp_list_table = _get_list_table('WP_Users_List_Table');
    2020$wp_list_table->prepare_items();
     
    6060}
    6161
    6262if ( ! can_edit_network( $details->site_id ) )
    63         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     63        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    6464
    6565$is_main_site = is_main_site( $id );
    6666
  • wp-admin/network/sites.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_sites' ) )
    17         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     17        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    1818
    1919$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
    2020$pagenum = $wp_list_table->get_pagenum();
     
    9191                }
    9292
    9393                if ( $current_site->blog_id == $id ) {
    94                         wp_die( __( 'You are not allowed to change the current site.' ) );
     94                        wp_die( __( 'You are not allowed to change the current site.' ), 403 );
    9595                }
    9696
    9797                $site_details = get_blog_details( $id );
     
    126126
    127127                case 'deleteblog':
    128128                        if ( ! current_user_can( 'delete_sites' ) )
    129                                 wp_die( __( 'You do not have permission to access this page.' ), '', array( 'response' => 403 ) );
     129                                wp_die( __( 'You are not allowed to access this page.' ), '', array( 'response' => 403 ) );
    130130
    131131                        $updated_action = 'not_deleted';
    132132                        if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) {
     
    144144                                                switch ( $doaction ) {
    145145                                                        case 'delete':
    146146                                                                if ( ! current_user_can( 'delete_site', $val ) )
    147                                                                         wp_die( __( 'You are not allowed to delete the site.' ) );
     147                                                                        wp_die( __( 'You are not allowed to delete the site.' ), 403 );
    148148
    149149                                                                $updated_action = 'all_delete';
    150150                                                                wpmu_delete_blog( $val, true );
     
    157157                                                        break;
    158158                                                }
    159159                                        } else {
    160                                                 wp_die( __( 'You are not allowed to change the current site.' ) );
     160                                                wp_die( __( 'You are not allowed to change the current site.' ), 403 );
    161161                                        }
    162162                                }
    163163                        } else {
     
    233233                        $msg = __( 'Site deleted.' );
    234234                break;
    235235                case 'not_deleted':
    236                         $msg = __( 'You do not have permission to delete that site.' );
     236                        $msg = __( 'You are not allowed to delete that site.' );
    237237                break;
    238238                case 'archiveblog':
    239239                        $msg = __( 'Site archived.' );
  • wp-admin/network/themes.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( !current_user_can('manage_network_themes') )
    17         wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
     17        wp_die( __( 'You are not allowed to manage network themes.' ), 403 );
    1818
    1919$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
    2020$pagenum = $wp_list_table->get_pagenum();
     
    9797                        exit;
    9898                case 'delete-selected':
    9999                        if ( ! current_user_can( 'delete_themes' ) ) {
    100                                 wp_die( __('You do not have sufficient permissions to delete themes for this site.') );
     100                                wp_die( __( 'You are not allowed to delete themes for this site.' ), 403 );
    101101                        }
    102102
    103103                        check_admin_referer( 'bulk-themes' );
  • wp-admin/network/user-new.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can('create_users') )
    17         wp_die(__('You do not have sufficient permissions to add users to this network.'));
     17        wp_die( __( 'You are not allowed to add users to this network.' ), 403 );
    1818
    1919get_current_screen()->add_help_tab( array(
    2020        'id'      => 'overview',
     
    3434        check_admin_referer( 'add-user', '_wpnonce_add-user' );
    3535
    3636        if ( ! current_user_can( 'manage_network_users' ) )
    37                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     37                wp_die( __( 'You are not allowed to access this page.' ), 403 );
    3838
    3939        if ( ! is_array( $_POST['user'] ) )
    4040                wp_die( __( 'Cannot create an empty user.' ) );
  • wp-admin/network/users.php

     
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    1616if ( ! current_user_can( 'manage_network_users' ) )
    17         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     17        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    1818
    1919if ( isset( $_GET['action'] ) ) {
    2020        /** This action is documented in wp-admin/network/edit.php */
     
    2323        switch ( $_GET['action'] ) {
    2424                case 'deleteuser':
    2525                        if ( ! current_user_can( 'manage_network_users' ) )
    26                                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     26                                wp_die( __( 'You are not allowed to access this page.' ), 403 );
    2727
    2828                        check_admin_referer( 'deleteuser' );
    2929
     
    4444
    4545                case 'allusers':
    4646                        if ( !current_user_can( 'manage_network_users' ) )
    47                                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     47                                wp_die( __( 'You are not allowed to access this page.' ), 403 );
    4848
    4949                        if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
    5050                                check_admin_referer( 'bulk-users-network' );
     
    5757                                                switch ( $doaction ) {
    5858                                                        case 'delete':
    5959                                                                if ( ! current_user_can( 'delete_users' ) )
    60                                                                         wp_die( __( 'You do not have permission to access this page.' ), 403 );
     60                                                                        wp_die( __( 'You are not allowed to access this page.' ), 403 );
    6161                                                                $title = __( 'Users' );
    6262                                                                $parent_file = 'users.php';
    6363                                                                require_once( ABSPATH . 'wp-admin/admin-header.php' );
     
    106106                case 'dodelete':
    107107                        check_admin_referer( 'ms-users-delete' );
    108108                        if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
    109                                 wp_die( __( 'You do not have permission to access this page.' ), 403 );
     109                                wp_die( __( 'You are not allowed to access this page.' ), 403 );
    110110
    111111                        if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
    112112                                foreach ( $_POST['blog'] as $id => $users ) {