From 06bf76e44f92da10873088fc4e48c6addf5b5f4d Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 14 Nov 2010 18:19:07 +0000 Subject: [PATCH] Handle sites that hard-code roles rather than storing them in the DB. Temp hack. see #15411 git-svn-id: http://svn.automattic.com/wordpress/trunk@16370 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/site-users.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index e7815bafa4..641e87e462 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -134,8 +134,15 @@ if ( is_array( $blogusers ) ) { echo ''; echo ""; $user_count = 0; - $blog_prefix = $wpdb->get_blog_prefix( $id ); - $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); + // @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) ) { + // If using the DB to store roles, consult the user_roles option. + $blog_prefix = $wpdb->get_blog_prefix( $id ); + $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); + } else { + // Roles are stored in memory, not the DB. + $editblog_roles = $wp_roles->roles; + } foreach ( $blogusers as $user_id => $user_object ) { $user_count++;
" . __( 'User' ) . "" . __( 'Role' ) . "" . __( 'Password' ) . "" . __( 'Remove' ) . "