function drush_user_create_validate

8.0.x user.drush.inc drush_user_create_validate($name)
7.x user.drush.inc drush_user_create_validate($name)
master user.drush.inc drush_user_create_validate($name)

File

commands/user/user.drush.inc, line 323
Drush User Management commands

Code

function drush_user_create_validate($name) {
  $userversion = drush_user_get_class();
  if ($mail = drush_get_option('mail')) {
    if ($userversion->load_by_mail($mail)) {
      return drush_set_error(dt('There is already a user account with the email !mail', array('!mail' => $mail)));
    }
  }
  if ($userversion->load_by_name($name)) {
    return drush_set_error(dt('There is already a user account with the name !name', array('!name' => $name)));
  }
}