From 2c922569f544c74d172dce8cd88642ecb3e908b5 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 6 Jul 2006 15:20:20 +0000 Subject: Check if users is a site_admin befoer checking if they're a member of current blog git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@641 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/users.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'wp-admin/users.php') diff --git a/wp-admin/users.php b/wp-admin/users.php index 854449c..f99a2f8 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -345,7 +345,8 @@ case 'addexistinguser': /* checking that username has been typed */ if ( !empty($new_user_email) ) { if ( $user_id = email_exists( $new_user_email ) ) { - if ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) { + $username = $wpdb->get_var( "SELECT user_login FROM {$wpdb->users} WHERE ID='$user_id'" ); + if( ($username != null && is_site_admin( $username ) == false ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { $location = 'users.php?update=add_existing'; } else { add_user_to_blog('', $user_id, $_POST[ 'new_role' ]); -- cgit