Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14441942
D20890.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20890.diff
View Options
diff --git a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php
--- a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php
+++ b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php
@@ -71,21 +71,30 @@
}
if (!strlen($new)) {
- $errors[] = $this->newRequiredError(
- pht('New username is required.'), $xaction);
+ $errors[] = $this->newInvalidError(
+ pht('New username is required.'),
+ $xaction);
} else if (!PhabricatorUser::validateUsername($new)) {
$errors[] = $this->newInvalidError(
- PhabricatorUser::describeValidUsername(), $xaction);
+ PhabricatorUser::describeValidUsername(),
+ $xaction);
}
$user = id(new PhabricatorPeopleQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withUsernames(array($new))
->executeOne();
-
if ($user) {
- $errors[] = $this->newInvalidError(
- pht('Another user already has that username.'), $xaction);
+ // See T13446. We may be changing the letter case of a username, which
+ // is a perfectly fine edit.
+ $is_self = ($user->getPHID() === $object->getPHID());
+ if (!$is_self) {
+ $errors[] = $this->newInvalidError(
+ pht(
+ 'Another user already has the username "%s".',
+ $new),
+ $xaction);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 7:20 AM (4 h, 34 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6930523
Default Alt Text
D20890.diff (1 KB)
Attached To
Mode
D20890: Allow username changes which modify letter case to go through as valid
Attached
Detach File
Event Timeline
Log In to Comment