@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<?php
2
3final class PhabricatorAuthNeedsApprovalController
4 extends PhabricatorAuthController {
5
6 public function shouldRequireLogin() {
7 return false;
8 }
9
10 public function shouldRequireEmailVerification() {
11 return false;
12 }
13
14 public function shouldRequireEnabledUser() {
15 return false;
16 }
17
18 public function handleRequest(AphrontRequest $request) {
19 $viewer = $this->getViewer();
20
21 $instructions = $this->newCustomWaitForApprovalInstructions();
22
23 $wait_for_approval = pht(
24 "Your account has been created, but needs to be approved by an ".
25 "administrator. You'll receive an email once your account is approved.");
26
27 $dialog = $this->newDialog()
28 ->setTitle(pht('Wait for Approval'))
29 ->appendChild($wait_for_approval)
30 ->addCancelButton('/', pht('Wait Patiently'));
31
32 $crumbs = $this->buildApplicationCrumbs()
33 ->addTextCrumb(pht('Wait For Approval'))
34 ->setBorder(true);
35
36 return $this->newPage()
37 ->setTitle(pht('Wait For Approval'))
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);
53
54 if (!phutil_nonempty_string($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);
66 }
67
68}