@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow installs to provide "Request a Username Change" instructions

Summary: Fixes T13420. Allow installs to provide username change instructions if there's someone you should contact to get this done.

Test Plan: {F6885027}

Maniphest Tasks: T13420

Differential Revision: https://secure.phabricator.com/D20828

+41 -1
+2
src/__phutil_library_map__.php
··· 2268 2268 'PhabricatorAuthChallengeStatusController' => 'applications/auth/controller/mfa/PhabricatorAuthChallengeStatusController.php', 2269 2269 'PhabricatorAuthChallengeUpdate' => 'applications/auth/view/PhabricatorAuthChallengeUpdate.php', 2270 2270 'PhabricatorAuthChangePasswordAction' => 'applications/auth/action/PhabricatorAuthChangePasswordAction.php', 2271 + 'PhabricatorAuthChangeUsernameMessageType' => 'applications/auth/message/PhabricatorAuthChangeUsernameMessageType.php', 2271 2272 'PhabricatorAuthConduitAPIMethod' => 'applications/auth/conduit/PhabricatorAuthConduitAPIMethod.php', 2272 2273 'PhabricatorAuthConduitTokenRevoker' => 'applications/auth/revoker/PhabricatorAuthConduitTokenRevoker.php', 2273 2274 'PhabricatorAuthConfirmLinkController' => 'applications/auth/controller/PhabricatorAuthConfirmLinkController.php', ··· 8455 8456 'PhabricatorAuthChallengeStatusController' => 'PhabricatorAuthController', 8456 8457 'PhabricatorAuthChallengeUpdate' => 'Phobject', 8457 8458 'PhabricatorAuthChangePasswordAction' => 'PhabricatorSystemAction', 8459 + 'PhabricatorAuthChangeUsernameMessageType' => 'PhabricatorAuthMessageType', 8458 8460 'PhabricatorAuthConduitAPIMethod' => 'ConduitAPIMethod', 8459 8461 'PhabricatorAuthConduitTokenRevoker' => 'PhabricatorAuthRevoker', 8460 8462 'PhabricatorAuthConfirmLinkController' => 'PhabricatorAuthController',
+29
src/applications/auth/message/PhabricatorAuthChangeUsernameMessageType.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthChangeUsernameMessageType 4 + extends PhabricatorAuthMessageType { 5 + 6 + const MESSAGEKEY = 'user.edit.username'; 7 + 8 + public function getDisplayName() { 9 + return pht('Username Change Instructions'); 10 + } 11 + 12 + public function getShortDescription() { 13 + return pht( 14 + 'Guidance in the "Change Username" dialog for requesting a '. 15 + 'username change.'); 16 + } 17 + 18 + public function getFullDescription() { 19 + return pht( 20 + 'When users click the "Change Username" action on their profile pages '. 21 + 'but do not have the required permissions, they will be presented with '. 22 + 'a message explaining that they are not authorized to make the edit.'. 23 + "\n\n". 24 + 'You can optionally provide additional instructions here to help users '. 25 + 'request a username change, if there is someone specific they should '. 26 + 'contact or a particular workflow they should use.'); 27 + } 28 + 29 + }
+10 -1
src/applications/people/controller/PhabricatorPeopleRenameController.php
··· 23 23 $done_uri = $this->getApplicationURI("manage/{$id}/"); 24 24 25 25 if (!$viewer->getIsAdmin()) { 26 - return $this->newDialog() 26 + $dialog = $this->newDialog() 27 27 ->setTitle(pht('Change Username')) 28 28 ->appendParagraph( 29 29 pht( 30 30 'You can not change usernames because you are not an '. 31 31 'administrator. Only administrators can change usernames.')) 32 32 ->addCancelButton($done_uri, pht('Okay')); 33 + 34 + $message_body = PhabricatorAuthMessage::loadMessageText( 35 + $viewer, 36 + PhabricatorAuthChangeUsernameMessageType::MESSAGEKEY); 37 + if (strlen($message_body)) { 38 + $dialog->appendRemarkup($message_body); 39 + } 40 + 41 + return $dialog; 33 42 } 34 43 35 44 $validation_exception = null;