Differential D18526 Diff 44493 src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public function processRequest(AphrontRequest $request) { | ||||
$table->setDeviceVisibility( | $table->setDeviceVisibility( | ||||
array( | array( | ||||
true, | true, | ||||
false, | false, | ||||
false, | false, | ||||
true, | true, | ||||
)); | )); | ||||
$panel = new PHUIObjectBoxView(); | |||||
$header = new PHUIHeaderView(); | |||||
$help_uri = PhabricatorEnv::getDoclink( | $help_uri = PhabricatorEnv::getDoclink( | ||||
'User Guide: Multi-Factor Authentication'); | 'User Guide: Multi-Factor Authentication'); | ||||
$help_button = id(new PHUIButtonView()) | $buttons = array(); | ||||
->setText(pht('Help')) | |||||
->setHref($help_uri) | |||||
->setTag('a') | |||||
->setIcon('fa-info-circle'); | |||||
$create_button = id(new PHUIButtonView()) | $buttons[] = id(new PHUIButtonView()) | ||||
->setText(pht('Add Authentication Factor')) | |||||
->setHref($this->getPanelURI('?new=true')) | |||||
->setTag('a') | ->setTag('a') | ||||
->setIcon('fa-plus') | |||||
->setText(pht('Add Auth Factor')) | |||||
->setHref($this->getPanelURI('?new=true')) | |||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-plus'); | ->setColor(PHUIButtonView::GREY); | ||||
$header->setHeader(pht('Authentication Factors')); | |||||
$header->addActionLink($help_button); | |||||
$header->addActionLink($create_button); | |||||
$panel->setHeader($header); | $buttons[] = id(new PHUIButtonView()) | ||||
$panel->setTable($table); | ->setTag('a') | ||||
$panel->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); | ->setIcon('fa-book') | ||||
->setText(pht('Help')) | |||||
->setHref($help_uri) | |||||
->setColor(PHUIButtonView::GREY); | |||||
return $panel; | return $this->newBox(pht('Authentication Factors'), $table, $buttons); | ||||
} | } | ||||
private function processNew(AphrontRequest $request) { | private function processNew(AphrontRequest $request) { | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$user = $this->getUser(); | $user = $this->getUser(); | ||||
$token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( | $token = id(new PhabricatorAuthSessionEngine())->requireHighSecuritySession( | ||||
$viewer, | $viewer, | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |