diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 5f28529e80..14039562b6 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2419,6 +2419,7 @@ phutil_register_library_map(array( 'PhabricatorAuthTryFactorAction' => 'applications/auth/action/PhabricatorAuthTryFactorAction.php', 'PhabricatorAuthUnlinkController' => 'applications/auth/controller/PhabricatorAuthUnlinkController.php', 'PhabricatorAuthValidateController' => 'applications/auth/controller/PhabricatorAuthValidateController.php', + 'PhabricatorAuthWaitForApprovalMessageType' => 'applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php', 'PhabricatorAuthWelcomeMailMessageType' => 'applications/auth/message/PhabricatorAuthWelcomeMailMessageType.php', 'PhabricatorAuthenticationConfigOptions' => 'applications/config/option/PhabricatorAuthenticationConfigOptions.php', 'PhabricatorAutoEventListener' => 'infrastructure/events/PhabricatorAutoEventListener.php', @@ -8357,6 +8358,7 @@ phutil_register_library_map(array( 'PhabricatorAuthTryFactorAction' => 'PhabricatorSystemAction', 'PhabricatorAuthUnlinkController' => 'PhabricatorAuthController', 'PhabricatorAuthValidateController' => 'PhabricatorAuthController', + 'PhabricatorAuthWaitForApprovalMessageType' => 'PhabricatorAuthMessageType', 'PhabricatorAuthWelcomeMailMessageType' => 'PhabricatorAuthMessageType', 'PhabricatorAuthenticationConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorAutoEventListener' => 'PhabricatorEventListener', diff --git a/src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php b/src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php index ba28816375..1121dfb14a 100644 --- a/src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php +++ b/src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php @@ -18,20 +18,51 @@ final class PhabricatorAuthNeedsApprovalController public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); + $instructions = $this->newCustomWaitForApprovalInstructions(); + $wait_for_approval = pht( "Your account has been created, but needs to be approved by an ". "administrator. You'll receive an email once your account is approved."); - $dialog = id(new AphrontDialogView()) - ->setUser($viewer) + $dialog = $this->newDialog() ->setTitle(pht('Wait for Approval')) ->appendChild($wait_for_approval) ->addCancelButton('/', pht('Wait Patiently')); + $crumbs = $this->buildApplicationCrumbs() + ->addTextCrumb(pht('Wait For Approval')) + ->setBorder(true); + return $this->newPage() ->setTitle(pht('Wait For Approval')) - ->appendChild($dialog); + ->setCrumbs($crumbs) + ->appendChild( + array( + $instructions, + $dialog, + )); } + private function newCustomWaitForApprovalInstructions() { + $viewer = $this->getViewer(); + + $text = PhabricatorAuthMessage::loadMessageText( + $viewer, + PhabricatorAuthWaitForApprovalMessageType::MESSAGEKEY); + + if (!strlen($text)) { + return null; + } + + $remarkup_view = new PHUIRemarkupView($viewer, $text); + + return phutil_tag( + 'div', + array( + 'class' => 'auth-custom-message', + ), + $remarkup_view); + } + } diff --git a/src/applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php b/src/applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php new file mode 100644 index 0000000000..d09dc6094e --- /dev/null +++ b/src/applications/auth/message/PhabricatorAuthWaitForApprovalMessageType.php @@ -0,0 +1,19 @@ +