X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-signup.php diff --git a/wp-signup.php b/wp-signup.php index 94722e34..3373f8ec 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -7,7 +7,7 @@ add_action( 'wp_head', 'wp_no_robots' ); require( dirname( __FILE__ ) . '/wp-blog-header.php' ); -if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { +if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) { wp_redirect( network_home_url() ); die(); } @@ -19,7 +19,7 @@ if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && */ function do_signup_header() { /** - * Fires within the section of the site sign-up screen. + * Fires within the head section of the site sign-up screen. * * @since 3.0.0 */ @@ -153,8 +153,6 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { * * @since MU * - * @uses wp_get_current_user() to retrieve the current user - * @uses wpmu_validate_blog_signup() to validate new site signup for the current user * @return array Contains the new site data and error messages. */ function validate_blog_form() { @@ -208,7 +206,6 @@ function show_user_form($user_name = '', $user_email = '', $errors = '') { * * @since MU * - * @uses wpmu_validate_user_signup() to retrieve an array of user data * @return array Contains username, email, and error messages. */ function validate_user_form() { @@ -220,7 +217,6 @@ function validate_user_form() { * * @since MU * - * @uses wp_get_current_user() to get the current user * @param string $blogname The new site name * @param string $blog_title The new blog title * @param array $errors @@ -303,16 +299,15 @@ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { * * @since MU * - * @uses wp_get_current_user() to retrieve the current user - * @uses wpmu_create_blog() to add a new site - * @uses confirm_another_blog_signup() to confirm the user's new site signup - * @return bool True if blog signup was validated, false if error + * @return null|bool True if blog signup was validated, false if error. + * The function halts all execution if the user is not logged in. */ function validate_another_blog_signup() { global $wpdb, $blogname, $blog_title, $errors, $domain, $path; $current_user = wp_get_current_user(); - if ( !is_user_logged_in() ) + if ( ! is_user_logged_in() ) { die(); + } $result = validate_blog_form(); @@ -394,8 +389,6 @@ function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $ * * @since MU * - * @uses apply_filters() filter $filtered_results - * @uses show_user_form() to display the user registration form * @param string $user_name The username * @param string $user_email The user's email * @param array $errors @@ -467,9 +460,6 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { * * @since MU * - * @uses validate_user_form() to retrieve an array of the user data - * @uses wpmu_signup_user() to signup the new user - * @uses confirm_user_signup() to confirm the new user signup * @return bool True if new user signup was validated, false if error */ function validate_user_signup() { @@ -519,8 +509,6 @@ function confirm_user_signup($user_name, $user_email) { * * @since MU * - * @uses apply_filters() to filter $filtered_results - * @uses show_blog_form() to display the blog signup form * @param string $user_name The username * @param string $user_email The user's email address * @param string $blogname The site name @@ -584,11 +572,6 @@ function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_ti * * @since MU * - * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors - * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors - * @uses apply_filters() to make signup $meta filterable - * @uses signup_user() to signup a new user - * @uses signup_blog() to signup a the new user to a new site * @return bool True if the site signup was validated, false if error */ function validate_blog_signup() { @@ -717,9 +700,9 @@ if ( $active_signup == 'none' ) { do_action( 'preprocess_signup_form' ); if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) signup_another_blog($newblogname); - elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) + elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) signup_user( $newblogname, $user_email ); - elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) + elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) _e( 'Sorry, new registrations are not allowed at this time.' ); else _e( 'You are logged in already. No need to register again!' );