Make WordPress Core

Ticket #33804: 33804_1.diff

File 33804_1.diff, 663 bytes (added by dipesh.kakadiya, 9 years ago)

username_exists check added

  • src/wp-admin/network/site-new.php

     
    9090        $user_id = email_exists($email);
    9191        if ( !$user_id ) { // Create a new user with a random password
    9292                $password = wp_generate_password( 12, false );
     93                $user_name_id = username_exists($domain);
     94                if ( $user_name_id ) {
     95                        wp_die( __( 'Username already existed.' ) );
     96                }
    9397                $user_id = wpmu_create_user( $domain, $password, $email );
    9498                if ( false === $user_id )
    9599                        wp_die( __( 'There was an error creating the user.' ) );