mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
Fix an email address validation UI feedback issue when creating new users
Summary: On the "New User" web workflow, if you use an invalid email address, you get a failure with an empty message. Test Plan: - Before: Tried to create a new user with address "asdf". Got no specific guidance. - After: Got specific guidance about email address formatting and length. Differential Revision: https://secure.phabricator.com/D21264
This commit is contained in:
parent
93b08f0e83
commit
7b0db3eb54
1 changed files with 4 additions and 1 deletions
|
@ -50,9 +50,12 @@ final class PhabricatorPeopleNewController
|
||||||
if (!strlen($new_email)) {
|
if (!strlen($new_email)) {
|
||||||
$errors[] = pht('Email is required.');
|
$errors[] = pht('Email is required.');
|
||||||
$e_email = pht('Required');
|
$e_email = pht('Required');
|
||||||
} else if (!PhabricatorUserEmail::isAllowedAddress($new_email)) {
|
} else if (!PhabricatorUserEmail::isValidAddress($new_email)) {
|
||||||
|
$errors[] = PhabricatorUserEmail::describeValidAddresses();
|
||||||
$e_email = pht('Invalid');
|
$e_email = pht('Invalid');
|
||||||
|
} else if (!PhabricatorUserEmail::isAllowedAddress($new_email)) {
|
||||||
$errors[] = PhabricatorUserEmail::describeAllowedAddresses();
|
$errors[] = PhabricatorUserEmail::describeAllowedAddresses();
|
||||||
|
$e_email = pht('Not Allowed');
|
||||||
} else {
|
} else {
|
||||||
$e_email = null;
|
$e_email = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue