// Adding an existing user to this blog.
$new_user_email = array
();
$redirect = 'user-new.php';
$username =
$user_details->user_login;
$user_id =
$user_details->ID;
if ( null !=
$username &&
array_key_exists( $blog_id,
get_blogs_of_user( $user_id ) ) ) { $redirect =
add_query_arg( array
( 'update' => 'addexisting'
), 'user-new.php'
);
} else { if ( isset( $_POST['noconfirmation'
] ) &&
current_user_can( 'manage_network_users'
) ) { $result =
add_existing_user_to_blog( array
( 'user_id' =>
$user_id,
'role' =>
$_REQUEST['role'
],
) );
if ( !
is_wp_error( $result ) ) { $redirect =
add_query_arg( array
( 'update' => 'addnoconfirmation',
'user_id' =>
$user_id,
),