Differential D20023 Diff 47820 src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/contact/PhabricatorAuthContactNumberPrimaryController.php
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| ->setNewValue(true); | ->setNewValue(true); | ||||
| $editor = id(new PhabricatorAuthContactNumberEditor()) | $editor = id(new PhabricatorAuthContactNumberEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setContinueOnMissingFields(true); | ->setContinueOnMissingFields(true); | ||||
| try { | |||||
| $editor->applyTransactions($number, $xactions); | $editor->applyTransactions($number, $xactions); | ||||
| } catch (PhabricatorApplicationTransactionValidationException $ex) { | |||||
| // This happens when you try to make a number into your primary | |||||
| // number, but you have contact number MFA on your account. | |||||
| return $this->newDialog() | |||||
| ->setTitle(pht('Unable to Make Primary')) | |||||
| ->setValidationException($ex) | |||||
| ->addCancelButton($cancel_uri); | |||||
| } | |||||
| return id(new AphrontRedirectResponse())->setURI($cancel_uri); | return id(new AphrontRedirectResponse())->setURI($cancel_uri); | ||||
| } | } | ||||
| $number_display = phutil_tag( | $number_display = phutil_tag( | ||||
| 'strong', | 'strong', | ||||
| array(), | array(), | ||||
| $number->getDisplayName()); | $number->getDisplayName()); | ||||
| Show All 12 Lines | |||||