Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/auth/controller/PhabricatorAuthNeedsApprovalController.php
12262 views
1
<?php
2
3
final 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 activated by an ".
25
"administrator. Due to lots of spam accounts, in order to have it activated, " .
26
"Please send an email to <phabric-admin AT FreeBSD.org> " .
27
"from the registered email address and briefly describe your plan for using your account " .
28
"as https://reviews.FreeBSD.org/auth/register/ described. " .
29
"You'll receive an email once your account is approved.");
30
31
$dialog = $this->newDialog()
32
->setTitle(pht('Wait for Approval'))
33
->appendChild($wait_for_approval)
34
->addCancelButton('/', pht('Wait Patiently'));
35
36
$crumbs = $this->buildApplicationCrumbs()
37
->addTextCrumb(pht('Wait For Approval'))
38
->setBorder(true);
39
40
return $this->newPage()
41
->setTitle(pht('Wait For Approval'))
42
->setCrumbs($crumbs)
43
->appendChild(
44
array(
45
$instructions,
46
$dialog,
47
));
48
49
}
50
51
private function newCustomWaitForApprovalInstructions() {
52
$viewer = $this->getViewer();
53
54
$text = PhabricatorAuthMessage::loadMessageText(
55
$viewer,
56
PhabricatorAuthWaitForApprovalMessageType::MESSAGEKEY);
57
58
if (!strlen($text)) {
59
return null;
60
}
61
62
$remarkup_view = new PHUIRemarkupView($viewer, $text);
63
64
return phutil_tag(
65
'div',
66
array(
67
'class' => 'auth-custom-message',
68
),
69
$remarkup_view);
70
}
71
72
}
73
74