@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.

When non-administrators click "Change Username", explain why they can't continue

Summary: Ref T13420. This workflow currently dead-ends for non-administrators. Instead, provide explanatory text.

Test Plan:
- Clicked "Change Username" as an administrator, same workflow as always.
- Clicked "Change Username" as a non-administrator, got explanatory text.

Maniphest Tasks: T13420

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

+15
+15
src/applications/people/controller/PhabricatorPeopleRenameController.php
··· 3 3 final class PhabricatorPeopleRenameController 4 4 extends PhabricatorPeopleController { 5 5 6 + public function shouldRequireAdmin() { 7 + return false; 8 + } 9 + 6 10 public function handleRequest(AphrontRequest $request) { 7 11 $viewer = $this->getViewer(); 12 + 8 13 $id = $request->getURIData('id'); 9 14 10 15 $user = id(new PhabricatorPeopleQuery()) ··· 16 21 } 17 22 18 23 $done_uri = $this->getApplicationURI("manage/{$id}/"); 24 + 25 + if (!$viewer->getIsAdmin()) { 26 + return $this->newDialog() 27 + ->setTitle(pht('Change Username')) 28 + ->appendParagraph( 29 + pht( 30 + 'You can not change usernames because you are not an '. 31 + 'administrator. Only administrators can change usernames.')) 32 + ->addCancelButton($done_uri, pht('Okay')); 33 + } 19 34 20 35 $validation_exception = null; 21 36 $username = $user->getUsername();