Differential D20958 Diff 49933 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
| Show First 20 Lines • Show All 5,146 Lines • ▼ Show 20 Lines | private function requireMFA(PhabricatorLiskDAO $object, array $xactions) { | ||||
| if ($cancel_uri === null) { | if ($cancel_uri === null) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'This transaction group requires MFA to apply, but the Editor was '. | 'This transaction group requires MFA to apply, but the Editor was '. | ||||
| 'not configured with a Cancel URI. This workflow can not perform '. | 'not configured with a Cancel URI. This workflow can not perform '. | ||||
| 'an MFA check.')); | 'an MFA check.')); | ||||
| } | } | ||||
| id(new PhabricatorAuthSessionEngine()) | $token = id(new PhabricatorAuthSessionEngine()) | ||||
| ->setWorkflowKey($workflow_key) | ->setWorkflowKey($workflow_key) | ||||
| ->requireHighSecurityToken($actor, $request, $cancel_uri); | ->requireHighSecurityToken($actor, $request, $cancel_uri); | ||||
| if (!$token->getIsUnchallengedToken()) { | |||||
| foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
| $xaction->setIsMFATransaction(true); | $xaction->setIsMFATransaction(true); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| private function newMFATransactions( | private function newMFATransactions( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| $has_engine = ($object instanceof PhabricatorEditEngineMFAInterface); | $has_engine = ($object instanceof PhabricatorEditEngineMFAInterface); | ||||
| if ($has_engine) { | if ($has_engine) { | ||||
| $engine = PhabricatorEditEngineMFAEngine::newEngineForObject($object) | $engine = PhabricatorEditEngineMFAEngine::newEngineForObject($object) | ||||
| ▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines | |||||