Allow usernames to include ".", "-" and "_"

Summary:
See T1303, which presents a reasonable case for inclusion of these characters in valid usernames.

Also, unify username validity handling.

Test Plan: Created a new user with a valid name. Tried to create a new user with an invalid name. Ran unit tests.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1303

Differential Revision: https://secure.phabricator.com/D2651
This commit is contained in:
epriestley
2012-06-06 07:09:05 -07:00
parent 489303a057
commit 0a7b4591ef
7 changed files with 47 additions and 15 deletions

View File

@@ -29,8 +29,8 @@ if (!strlen($username)) {
}
if (!PhabricatorUser::validateUsername($username)) {
echo "The username '{$username}' is invalid. Usernames must consist of only ".
"numbers and letters.\n";
$valid = PhabricatorUser::describeValidUsername();
echo "The username '{$username}' is invalid. {$valid}\n";
exit(1);
}