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

@@ -65,7 +65,7 @@ final class PhabricatorOAuthDefaultRegistrationController
$errors[] = 'Username is required.';
} else if (!PhabricatorUser::validateUsername($username)) {
$e_username = 'Invalid';
$errors[] = 'Username must consist of only numbers and letters.';
$errors[] = PhabricatorUser::describeValidUsername();
} else {
$e_username = null;
}