MS: Show an error if a new site slug conflicts with an existing username.

Props utkarshpatel, dipesh.kakadiya.
Fixes #33804.


git-svn-id: https://develop.svn.wordpress.org/trunk@34996 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2015-10-10 01:41:43 +00:00
parent 1758d36a88
commit ecb75a16be
1 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,10 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
$password = 'N/A';
$user_id = email_exists($email);
if ( !$user_id ) { // Create a new user with a random password
$user_id = username_exists( $domain );
if ( $user_id ) {
wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
}
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false === $user_id ) {