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

Add support for custom "Wait for Approval" instructions

Summary:
See PHI1229. An install has a somewhat duct-taped registration flow which can dump users on the "Wait for Approval" screen without clear guidance. The desired guidance is something like "this is totally normal, just wait a bit for a bot to approve you".

Adding guidance here is generally reasonable and consistent with the intent of this feature.

Test Plan: {F6426583}

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: kylec

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

+55 -3
+2
src/__phutil_library_map__.php
··· 2419 2419 'PhabricatorAuthTryFactorAction' => 'applications/auth/action/PhabricatorAuthTryFactorAction.php', 2420 2420 'PhabricatorAuthUnlinkController' => 'applications/auth/controller/PhabricatorAuthUnlinkController.php', 2421 2421 'PhabricatorAuthValidateController' => 'applications/auth/controller/PhabricatorAuthValidateController.php', 2422 + 'PhabricatorAuthWaitForApprovalMessageType' => 'applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php', 2422 2423 'PhabricatorAuthWelcomeMailMessageType' => 'applications/auth/message/PhabricatorAuthWelcomeMailMessageType.php', 2423 2424 'PhabricatorAuthenticationConfigOptions' => 'applications/config/option/PhabricatorAuthenticationConfigOptions.php', 2424 2425 'PhabricatorAutoEventListener' => 'infrastructure/events/PhabricatorAutoEventListener.php', ··· 8357 8358 'PhabricatorAuthTryFactorAction' => 'PhabricatorSystemAction', 8358 8359 'PhabricatorAuthUnlinkController' => 'PhabricatorAuthController', 8359 8360 'PhabricatorAuthValidateController' => 'PhabricatorAuthController', 8361 + 'PhabricatorAuthWaitForApprovalMessageType' => 'PhabricatorAuthMessageType', 8360 8362 'PhabricatorAuthWelcomeMailMessageType' => 'PhabricatorAuthMessageType', 8361 8363 'PhabricatorAuthenticationConfigOptions' => 'PhabricatorApplicationConfigOptions', 8362 8364 'PhabricatorAutoEventListener' => 'PhabricatorEventListener',
+34 -3
src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php
··· 18 18 public function handleRequest(AphrontRequest $request) { 19 19 $viewer = $this->getViewer(); 20 20 21 + $instructions = $this->newCustomWaitForApprovalInstructions(); 22 + 21 23 $wait_for_approval = pht( 22 24 "Your account has been created, but needs to be approved by an ". 23 25 "administrator. You'll receive an email once your account is approved."); 24 26 25 - $dialog = id(new AphrontDialogView()) 26 - ->setUser($viewer) 27 + $dialog = $this->newDialog() 27 28 ->setTitle(pht('Wait for Approval')) 28 29 ->appendChild($wait_for_approval) 29 30 ->addCancelButton('/', pht('Wait Patiently')); 30 31 32 + $crumbs = $this->buildApplicationCrumbs() 33 + ->addTextCrumb(pht('Wait For Approval')) 34 + ->setBorder(true); 35 + 31 36 return $this->newPage() 32 37 ->setTitle(pht('Wait For Approval')) 33 - ->appendChild($dialog); 38 + ->setCrumbs($crumbs) 39 + ->appendChild( 40 + array( 41 + $instructions, 42 + $dialog, 43 + )); 44 + 45 + } 46 + 47 + private function newCustomWaitForApprovalInstructions() { 48 + $viewer = $this->getViewer(); 49 + 50 + $text = PhabricatorAuthMessage::loadMessageText( 51 + $viewer, 52 + PhabricatorAuthWaitForApprovalMessageType::MESSAGEKEY); 34 53 54 + if (!strlen($text)) { 55 + return null; 56 + } 57 + 58 + $remarkup_view = new PHUIRemarkupView($viewer, $text); 59 + 60 + return phutil_tag( 61 + 'div', 62 + array( 63 + 'class' => 'auth-custom-message', 64 + ), 65 + $remarkup_view); 35 66 } 36 67 37 68 }
+19
src/applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthWaitForApprovalMessageType 4 + extends PhabricatorAuthMessageType { 5 + 6 + const MESSAGEKEY = 'auth.wait-for-approval'; 7 + 8 + public function getDisplayName() { 9 + return pht('Wait For Approval Instructions'); 10 + } 11 + 12 + public function getShortDescription() { 13 + return pht( 14 + 'Instructions on the "Wait For Approval" screen, shown to users who '. 15 + 'have registered an account that has not yet been approved by an '. 16 + 'administrator.'); 17 + } 18 + 19 + }