Differential D20828 Diff 49658 src/applications/people/controller/PhabricatorPeopleRenameController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/controller/PhabricatorPeopleRenameController.php
Show All 17 Lines | $user = id(new PhabricatorPeopleQuery()) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$user) { | if (!$user) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$done_uri = $this->getApplicationURI("manage/{$id}/"); | $done_uri = $this->getApplicationURI("manage/{$id}/"); | ||||
if (!$viewer->getIsAdmin()) { | if (!$viewer->getIsAdmin()) { | ||||
return $this->newDialog() | $dialog = $this->newDialog() | ||||
->setTitle(pht('Change Username')) | ->setTitle(pht('Change Username')) | ||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'You can not change usernames because you are not an '. | 'You can not change usernames because you are not an '. | ||||
'administrator. Only administrators can change usernames.')) | 'administrator. Only administrators can change usernames.')) | ||||
->addCancelButton($done_uri, pht('Okay')); | ->addCancelButton($done_uri, pht('Okay')); | ||||
$message_body = PhabricatorAuthMessage::loadMessageText( | |||||
$viewer, | |||||
PhabricatorAuthChangeUsernameMessageType::MESSAGEKEY); | |||||
if (strlen($message_body)) { | |||||
$dialog->appendRemarkup($message_body); | |||||
} | |||||
return $dialog; | |||||
} | } | ||||
$validation_exception = null; | $validation_exception = null; | ||||
$username = $user->getUsername(); | $username = $user->getUsername(); | ||||
if ($request->isFormOrHisecPost()) { | if ($request->isFormOrHisecPost()) { | ||||
$username = $request->getStr('username'); | $username = $request->getStr('username'); | ||||
$xactions = array(); | $xactions = array(); | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |