diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index 641e87e462..f1806163ce 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -27,14 +27,22 @@ if ( $details->site_id != $wpdb->siteid ) $is_main_site = is_main_site( $id ); +// get blog prefix +$blog_prefix = $wpdb->get_blog_prefix( $id ); + +// @todo This is a hack. Eventually, add API to WP_Roles allowing retrieval of roles for a particular blog. +if ( ! empty($wp_roles->use_db) ) { + $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); +} else { + // Roles are stored in memory, not the DB. + $editblog_roles = $wp_roles->roles; +} + if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] ) { check_admin_referer( 'edit-site' ); switch_to_blog( $id ); - // get blog prefix - $blog_prefix = $wpdb->get_blog_prefix( $id ); - // user roles if ( isset( $_POST['role'] ) && is_array( $_POST['role'] ) == true ) { $newroles = $_POST['role']; @@ -130,19 +138,11 @@ if ( ! empty( $messages ) ) { $id, 'number' => 20 ) ); + if ( is_array( $blogusers ) ) { echo '
" . __( 'User' ) . " | " . __( 'Role' ) . " | " . __( 'Password' ) . " | " . __( 'Remove' ) . " |
---|