Make WordPress Core

Ticket #33804: 33804_2.diff

File 33804_2.diff, 694 bytes (added by utkarshpatel, 9 years ago)

move condition before generating pass

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

    diff --git wp-admin/network/site-new.php wp-admin/network/site-new.php
    index 5876037..2bca827 100644
    if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { 
    8787        }
    8888
    8989        $password = 'N/A';
    90         $user_id = email_exists($email);
    91         if ( !$user_id ) { // Create a new user with a random password
     90        $user_id = email_exists( $email );
     91        $user_name_id = username_exists( $domain );
     92        if ( !$user_id && !$user_name_id ) { // Create a new user with a random password
    9293                $password = wp_generate_password( 12, false );
    9394                $user_id = wpmu_create_user( $domain, $password, $email );
    9495                if ( false === $user_id )