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();
}
*/
function do_signup_header() {
/**
- * Fires within the <head> section of the site sign-up screen.
+ * Fires within the head section of the site sign-up screen.
*
* @since 3.0.0
*/
*
* @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() {
*
* @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() {
*
* @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
*
* @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();
*
* @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
*
* @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() {
*
* @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
*
* @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() {
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!' );