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:
parent
1758d36a88
commit
ecb75a16be
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user