@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert "Empower" from state-based MFA to one-shot MFA

Summary: Ref T13382. Currently, the "Make Administrator" action in the web UI does state-based MFA. Convert it to one-shot MFA.

Test Plan: Empowered and unempowered a user from the web UI, got one-shot MFA'd. Empowered a user from the CLI, no MFA issues.

Maniphest Tasks: T13382

Differential Revision: https://secure.phabricator.com/D20729

+10 -8
+3 -8
src/applications/people/controller/PhabricatorPeopleEmpowerController.php
··· 17 17 18 18 $done_uri = $this->getApplicationURI("manage/{$id}/"); 19 19 20 - id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( 21 - $viewer, 22 - $request, 23 - $done_uri); 24 - 25 20 $validation_exception = null; 26 - 27 - if ($request->isFormPost()) { 21 + if ($request->isFormOrHisecPost()) { 28 22 $xactions = array(); 29 23 $xactions[] = id(new PhabricatorUserTransaction()) 30 24 ->setTransactionType( ··· 34 28 $editor = id(new PhabricatorUserTransactionEditor()) 35 29 ->setActor($viewer) 36 30 ->setContentSourceFromRequest($request) 37 - ->setContinueOnMissingFields(true); 31 + ->setContinueOnMissingFields(true) 32 + ->setCancelURI($done_uri); 38 33 39 34 try { 40 35 $editor->applyTransactions($user, $xactions);
+7
src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php
··· 86 86 87 87 return null; 88 88 } 89 + 90 + public function shouldTryMFA( 91 + $object, 92 + PhabricatorApplicationTransaction $xaction) { 93 + return true; 94 + } 95 + 89 96 }