Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / auth / engineextension / PhabricatorAuthMFAEditEngineExtension.php
blobf138193d693f53582499e8aad04202ead284c6ae
1 <?php
3 final class PhabricatorAuthMFAEditEngineExtension
4 extends PhabricatorEditEngineExtension {
6 const EXTENSIONKEY = 'auth.mfa';
7 const FIELDKEY = 'mfa';
9 public function getExtensionPriority() {
10 return 12000;
13 public function isExtensionEnabled() {
14 return true;
17 public function getExtensionName() {
18 return pht('MFA');
21 public function supportsObject(
22 PhabricatorEditEngine $engine,
23 PhabricatorApplicationTransactionInterface $object) {
24 return true;
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())
36 ->setViewer($viewer)
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);
48 return array(
49 $mfa_field,