X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..0278c4b31e94c74bb5da5832653ad26e14a7b275:/wp-admin/users.php diff --git a/wp-admin/users.php b/wp-admin/users.php index aeaabc3b..73ff238a 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -7,37 +7,29 @@ */ /** WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( './admin.php' ); -/** WordPress Registration API */ -require_once( ABSPATH . WPINC . '/registration.php'); - -if ( !current_user_can('list_users') ) - wp_die(__('Cheatin’ uh?')); +if ( ! current_user_can( 'list_users' ) ) + wp_die( __( 'Cheatin’ uh?' ) ); +$wp_list_table = _get_list_table('WP_Users_List_Table'); +$pagenum = $wp_list_table->get_pagenum(); $title = __('Users'); $parent_file = 'users.php'; +add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); + // contextual help - choose Help on the top right of admin panel to preview this. add_contextual_help($current_screen, - '
' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options when they are logged in, based on their role.') . '
' . + '' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '
' . '' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '
' . '' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '
' . '' . __('For more information:') . '
' . - '' . __('Documentation on Authors and Users') . '
' . - '' . __('Roles and Capabilities Descriptions') . '
' . + '' . __('Documentation on Managing Users') . '
' . + '' . __('Descriptions of Roles and Capabilities') . '
' . '' . __('Support Forums') . '
' ); -$update = $doaction = ''; -if ( isset($_REQUEST['action']) ) - $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2']; - -if ( empty($doaction) ) { - if ( isset($_GET['changeit']) && !empty($_GET['new_role']) ) - $doaction = 'promote'; -} - if ( empty($_REQUEST) ) { $referer = ''; } elseif ( isset($_REQUEST['wp_http_referer']) ) { @@ -48,12 +40,17 @@ if ( empty($_REQUEST) ) { $referer = ''; } -switch ($doaction) { +$update = ''; + +switch ( $wp_list_table->current_action() ) { /* Bulk Dropdown menu Role changes */ case 'promote': check_admin_referer('bulk-users'); + if ( ! current_user_can( 'promote_users' ) ) + wp_die( __( 'You can’t edit that user.' ) ); + if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); @@ -178,18 +175,6 @@ case 'delete': $go_delete = true; } } - // @todo Delete is always for !is_multisite(). Use API. - if ( !is_multisite() ) { - $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); - } else { - // WPMU only searches users of current blog - $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ORDER BY user_login"); - } - $user_dropdown = ''; ?> @@ -198,10 +183,11 @@ case 'delete':