3 final class PhabricatorAuthMFAEditEngineExtension
4 extends PhabricatorEditEngineExtension
{
6 const EXTENSIONKEY
= 'auth.mfa';
7 const FIELDKEY
= 'mfa';
9 public function getExtensionPriority() {
13 public function isExtensionEnabled() {
17 public function getExtensionName() {
21 public function supportsObject(
22 PhabricatorEditEngine
$engine,
23 PhabricatorApplicationTransactionInterface
$object) {
27 public function buildCustomEditFields(
28 PhabricatorEditEngine
$engine,
29 PhabricatorApplicationTransactionInterface
$object) {
31 $mfa_type = PhabricatorTransactions
::TYPE_MFA
;
33 $viewer = $engine->getViewer();
35 $mfa_field = id(new PhabricatorApplyEditField())
37 ->setKey(self
::FIELDKEY
)
38 ->setLabel(pht('MFA'))
39 ->setIsFormField(false)
40 ->setCommentActionLabel(pht('Sign With MFA'))
41 ->setCanApplyWithoutEditCapability(true)
42 ->setCommentActionOrder(12000)
43 ->setActionDescription(
44 pht('You will be prompted to provide MFA when you submit.'))
45 ->setDescription(pht('Sign this transaction group with MFA.'))
46 ->setTransactionType($mfa_type);