%s' ), implode( ', ', $subdirectory_reserved_names ) ) ); } $email = sanitize_email( $blog['email'] ); $title = $blog['title']; if ( empty( $domain ) ) wp_die( __( 'Missing or invalid site address.' ) ); if ( empty( $email ) ) wp_die( __( 'Missing email address.' ) ); if ( !is_email( $email ) ) wp_die( __( 'Invalid email address.' ) ); if ( is_subdomain_install() ) { $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain ); $path = $base; } else { $newdomain = $current_site->domain; $path = $base . $domain . '/'; } $password = 'N/A'; $user_id = email_exists($email); if ( !$user_id ) { // Create a new user with a random password $password = wp_generate_password( 12, false ); $user_id = wpmu_create_user( $domain, $password, $email ); if ( false == $user_id ) wp_die( __( 'There was an error creating the user.' ) ); else wp_new_user_notification( $user_id, $password ); } $wpdb->hide_errors(); $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id ); $wpdb->show_errors(); if ( !is_wp_error( $id ) ) { if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) update_user_option( $user_id, 'primary_blog', $id, true ); $content_mail = sprintf( __( "New site created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain . $path, stripslashes( $title ) ); wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); wp_redirect( add_query_arg( array('update' => 'added'), 'site-new.php' ) ); exit; } else { wp_die( $id->get_error_message() ); } } if ( isset($_GET['update']) ) { $messages = array(); if ( 'added' == $_GET['update'] ) $messages[] = __('Site added.'); } $title = __('Add New Site'); $parent_file = 'sites.php'; require('../admin-header.php'); ?>

' . $msg . '

'; } ?>
.domain );?> domain . $current_site->path ?> ' . __( 'Only the characters a-z and 0-9 recommended.' ) . '

'; ?>