Make WordPress Core

Changeset 17440


Ignore:
Timestamp:
02/10/2011 08:38:04 PM (16 years ago)
Author:
ryan
Message:

Disallow and hide user removal (as opposed to deletion) for single site installs. Removal is a multisite concept. Props nacin. fixes #16501 for 3.1

Location:
branches/3.1/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/wp-admin/includes/class-wp-users-list-table.php

    r17432 r17440  
    122122                $actions = array();
    123123
    124                 if ( !is_multisite() && current_user_can( 'delete_users' ) )
    125                         $actions['delete'] = __( 'Delete' );
    126                 else
    127                         $actions['remove'] = __( 'Remove' );
     124                if ( is_multisite() ) {
     125                        if ( current_user_can( 'remove_users' ) )
     126                                $actions['remove'] = __( 'Remove' );
     127                } else {
     128                        if ( current_user_can( 'delete_users' ) )
     129                                $actions['delete'] = __( 'Delete' );
     130                }
    128131
    129132                return $actions;
  • branches/3.1/wp-admin/users.php

    r17432 r17440  
    201201        check_admin_referer('remove-users');
    202202
     203        if ( ! is_multisite() )
     204                wp_die( __( 'You can’t remove users.' ) );
     205
    203206        if ( empty($_REQUEST['users']) ) {
    204207                wp_redirect($redirect);
    … …  
    206209        }
    207210
    208         if ( !current_user_can('remove_users') )
    209                 die(__('You can’t remove users.'));
     211        if ( ! current_user_can( 'remove_users' ) )
     212                wp_die( __( 'You can’t remove users.' ) );
    210213
    211214        $userids = $_REQUEST['users'];
    … …  
    234237
    235238        check_admin_referer('bulk-users');
     239
     240        if ( ! is_multisite() )
     241                wp_die( __( 'You can’t remove users.' ) );
    236242
    237243        if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) {
Note: See TracChangeset for help on using the changeset viewer.