From 15ded3a93629f9d7f45c98243ca572367fdef89b Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 17 Nov 2010 19:45:10 +0000 Subject: [PATCH] Add existing user to site form. Props PeteMall, ocean90. see #15342 git-svn-id: http://svn.automattic.com/wordpress/trunk@16440 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/site-users.php | 52 +++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 12 deletions(-) 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 ''; echo ""; $user_count = 0; - // @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++; @@ -180,6 +180,34 @@ if ( is_array( $blogusers ) ) { ?> +

+

+ + + +
" . __( 'User' ) . "" . __( 'Role' ) . "" . __( 'Password' ) . "" . __( 'Remove' ) . "
+ + + + + + + + +
+ +