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

Applications: try Multi-Factor Auth to Disable/Enable apps

Summary:
If the Phorge install has an MFA provider configured at http://phorge.localhost/auth/mfa/, then MFA is required when trying to "Enable" or "Disable" any application.

Note that, in case of issues with an MFA step, you can disable a non-functioning MFA using the command './bin/auth strip' - as usual.

This change is a continuation of the work of Cigaryno in https://we.phorge.it/D25935

Closes T15490

Test Plan:
* Have an administrator without MFA activated
** Disable or Enable a random application, like "Nuance": http://phorge.localhost/applications/view/PhabricatorNuanceApplication/
** You still see the question: "Really disable the Nuance application?"
** The "Cancel" button still works.
** The "Disable" button still works.
** The "Enable" button still works.
* Have an administrator with at least one MFA activated and try again:
** http://phorge.localhost/applications/view/PhabricatorNuanceApplication/
** You still see the same question: "Really disable the Nuance application?"
** The "Cancel" button still works.
** The "Disable" button leads to MFA. Then it works.
** The "Enable" button leads to MFA. Then it works.
** If during the MFA you click "Cancel", it just "Cancel".
In all cases, you still see the transactions:
* "FooAdminName disabled this application."
* "FooAdminName enabled this application."

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15490

Differential Revision: https://we.phorge.it/D26613

+9 -1
+2 -1
src/applications/meta/controller/PhabricatorApplicationUninstallController.php
··· 43 43 return id(new AphrontDialogResponse())->setDialog($dialog); 44 44 } 45 45 46 - if ($request->isDialogFormPost()) { 46 + if ($request->isFormOrHisecPost()) { 47 47 $xactions = array(); 48 48 $template = $application->getApplicationTransactionTemplate(); 49 49 $xactions[] = id(clone $template) ··· 54 54 $editor = id(new PhabricatorApplicationEditor()) 55 55 ->setActor($user) 56 56 ->setContentSourceFromRequest($request) 57 + ->setCancelURI($view_uri) 57 58 ->setContinueOnNoEffect(true) 58 59 ->setContinueOnMissingFields(true); 59 60
+7
src/applications/meta/xactions/PhabricatorApplicationUninstallTransaction.php
··· 81 81 } 82 82 } 83 83 84 + public function shouldTryMFA( 85 + $object, 86 + PhabricatorApplicationTransaction $xaction) { 87 + // Installing or uninstalling applications is a big deal. 88 + return true; 89 + } 90 + 84 91 }