437
* Processes new user registrations.
439
* Checks the data provided by the user during signup. Verifies
440
* the validity and uniqueness of user names and user email addresses,
441
* and checks email addresses against admin-provided domain
442
* whitelists and blacklists.
444
* The hook 'wpmu_validate_user_signup' provides an easy way
445
* to modify the signup process. The value $result, which is passed
446
* to the hook, contains both the user-provided info and the error
447
* messages created by the function. 'wpmu_validate_user_signup' allows
448
* you to process the data in any way you'd like, and unset the
449
* relevant errors if necessary.
437
* Sanitize and validate data required for a user sign-up.
439
* Verifies the validity and uniqueness of user names and user email addresses,
440
* and checks email addresses against admin-provided domain whitelists and blacklists.
442
* The {@see 'wpmu_validate_user_signup'} hook provides an easy way to modify the sign-up
443
* process. The value $result, which is passed to the hook, contains both the user-provided
444
* info and the error messages created by the function. {@see 'wpmu_validate_user_signup'}
445
* allows you to process the data in any way you'd like, and unset the relevant errors if
453
* @param string $user_name The login name provided by the user.
450
* @param string $user_name The login name provided by the user.
454
451
* @param string $user_email The email provided by the user.
455
452
* @return array Contains username, email, and error messages.
1438
1435
$welcome_email = get_site_option( 'welcome_email' );
1439
1436
if ( $welcome_email == false )
1440
$welcome_email = __( 'Dear User,
1437
$welcome_email = __( 'Howdy USERNAME,
1442
1439
Your new SITE_NAME site has been successfully set up at:
1804
1801
$global_id = $wpdb->insert_id;
1806
1803
} elseif ( $global_id != $term_id ) {
1807
$local_id = $wpdb->get_row( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
1808
if ( null != $local_id )
1809
$local_id = global_terms( $local_id );
1810
if ( 10 < $global_terms_recurse )
1804
$local_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
1805
if ( null != $local_id ) {
1806
global_terms( $local_id );
1807
if ( 10 < $global_terms_recurse ) {
1811
1808
$global_id = $term_id;
1814
1813
if ( $global_id != $term_id ) {
1935
1934
if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) )
1936
1935
wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), home_url() ) );
1938
wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ) );
1937
wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ), array( 'response' => 200 ) );
2007
2006
function is_user_spammy( $user = null ) {
2008
if ( ! is_a( $user, 'WP_User' ) ) {
2007
if ( ! ( $user instanceof WP_User ) ) {
2010
2009
$user = get_user_by( 'login', $user );
2012
2011
$user = wp_get_current_user();
2015
2015
return $user && isset( $user->spam ) && 1 == $user->spam;
2028
2028
function update_blog_public( $old_value, $value ) {
2029
2029
update_blog_status( get_current_blog_id(), 'public', (int) $value );
2031
add_action('update_option_blog_public', 'update_blog_public', 10, 2);
2034
2033
* Check whether a usermeta key has to do with the current blog.
2082
2080
function welcome_user_msg_filter( $text ) {
2083
2081
if ( !$text ) {
2084
2082
remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
2085
$text = __( 'Dear User,
2083
$text = __( 'Howdy USERNAME,
2087
2085
Your new account is set up.