Prevent users with dash in username - refs #7032

1.9.x
Yannick Warnier 10 years ago
parent 4b38533a78
commit 49154e2f21
  1. 6
      main/admin/user_import.php

@ -56,6 +56,12 @@ function validate_data($users, $checkUniqueEmail = false)
$user['error'] = get_lang('UserNameTooLong'); $user['error'] = get_lang('UserNameTooLong');
$errors[] = $user; $errors[] = $user;
} }
// 2.1.1
$hasDash = strpos($username, '-');
if ($hasDash !== false) {
$user['error'] = get_lang('UserNameHasDash');
$errors[] = $user;
}
// 2.2. Check whether the username was used twice in import file. // 2.2. Check whether the username was used twice in import file.
if (isset($usernames[$user['UserName']])) { if (isset($usernames[$user['UserName']])) {
$user['error'] = get_lang('UserNameUsedTwice'); $user['error'] = get_lang('UserNameUsedTwice');

Loading…
Cancel
Save