Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorSessionsSettingsPanel.php
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | $table->setColumnClasses( | ||||
'n', | 'n', | ||||
'', | '', | ||||
'right', | 'right', | ||||
'right', | 'right', | ||||
'right', | 'right', | ||||
'action', | 'action', | ||||
)); | )); | ||||
$terminate_button = id(new PHUIButtonView()) | $buttons = array(); | ||||
$buttons[] = id(new PHUIButtonView()) | |||||
->setTag('a') | |||||
->setIcon('fa-warning') | |||||
->setText(pht('Terminate All Sessions')) | ->setText(pht('Terminate All Sessions')) | ||||
->setHref('/auth/session/terminate/all/') | ->setHref('/auth/session/terminate/all/') | ||||
->setTag('a') | |||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-exclamation-triangle'); | ->setColor(PHUIButtonView::RED); | ||||
$header = id(new PHUIHeaderView()) | |||||
->setHeader(pht('Active Login Sessions')) | |||||
->addActionLink($terminate_button); | |||||
$hisec = ($viewer->getSession()->getHighSecurityUntil() - time()); | $hisec = ($viewer->getSession()->getHighSecurityUntil() - time()); | ||||
if ($hisec > 0) { | if ($hisec > 0) { | ||||
$hisec_button = id(new PHUIButtonView()) | $buttons[] = id(new PHUIButtonView()) | ||||
->setTag('a') | |||||
->setIcon('fa-lock') | |||||
->setText(pht('Leave High Security')) | ->setText(pht('Leave High Security')) | ||||
->setHref('/auth/session/downgrade/') | ->setHref('/auth/session/downgrade/') | ||||
->setTag('a') | |||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setIcon('fa-lock'); | ->setColor(PHUIButtonView::RED); | ||||
$header->addActionLink($hisec_button); | |||||
} | } | ||||
$panel = id(new PHUIObjectBoxView()) | return $this->newBox(pht('Active Login Sessions'), $table, $buttons); | ||||
->setHeader($header) | |||||
->setTable($table) | |||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY); | |||||
return $panel; | |||||
} | } | ||||
} | } |