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

Add a warning about MFA requirements to edit forms

Summary:
Depends on D20044. Ref T13242. Similar to D20044, add reminder text to edit forms.

It would be nice to "workflow" these so the MFA flow happens inline, but Maniphest's inline edit behavior currently conflicts with this. Set it aside for now since the next workboards iteration (triggers) is probably a good opportunity to revisit it.

Test Plan: {F6164496}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13242

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

+27
+27
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 1279 1279 1280 1280 $fields = $this->willBuildEditForm($object, $fields); 1281 1281 1282 + $request_path = $request->getRequestURI() 1283 + ->setQueryParams(array()); 1284 + 1282 1285 $form = id(new AphrontFormView()) 1283 1286 ->setUser($viewer) 1287 + ->setAction($request_path) 1284 1288 ->addHiddenInput('editEngine', 'true'); 1285 1289 1286 1290 foreach ($this->contextParameters as $param) { 1287 1291 $form->addHiddenInput($param, $request->getStr($param)); 1292 + } 1293 + 1294 + $requires_mfa = false; 1295 + if ($object instanceof PhabricatorEditEngineMFAInterface) { 1296 + $mfa_engine = PhabricatorEditEngineMFAEngine::newEngineForObject($object) 1297 + ->setViewer($viewer); 1298 + $requires_mfa = $mfa_engine->shouldRequireMFA(); 1299 + } 1300 + 1301 + if ($requires_mfa) { 1302 + $message = pht( 1303 + 'You will be required to provide multi-factor credentials to make '. 1304 + 'changes.'); 1305 + $form->appendChild( 1306 + id(new PHUIInfoView()) 1307 + ->setSeverity(PHUIInfoView::SEVERITY_MFA) 1308 + ->setErrors(array($message))); 1309 + 1310 + // TODO: This should also set workflow on the form, so the user doesn't 1311 + // lose any form data if they "Cancel". However, Maniphest currently 1312 + // overrides "newEditResponse()" if the request is Ajax and returns a 1313 + // bag of view data. This can reasonably be cleaned up when workboards 1314 + // get their next iteration. 1288 1315 } 1289 1316 1290 1317 foreach ($fields as $field) {