Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/engine/PhabricatorAuthSessionEngine.php
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | if ($request->isHTTPPost()) { | ||||
$session->setHighSecurityUntil($until); | $session->setHighSecurityUntil($until); | ||||
queryfx( | queryfx( | ||||
$session->establishConnection('w'), | $session->establishConnection('w'), | ||||
'UPDATE %T SET highSecurityUntil = %d WHERE id = %d', | 'UPDATE %T SET highSecurityUntil = %d WHERE id = %d', | ||||
$session->getTableName(), | $session->getTableName(), | ||||
$until, | $until, | ||||
$session->getID()); | $session->getID()); | ||||
$log = PhabricatorUserLog::initializeNewLog( | |||||
$viewer, | |||||
$viewer->getPHID(), | |||||
PhabricatorUserLog::ACTION_ENTER_HISEC); | |||||
$log->save(); | |||||
} | } | ||||
} | } | ||||
$token = $this->issueHighSecurityToken($session); | $token = $this->issueHighSecurityToken($session); | ||||
if ($token) { | if ($token) { | ||||
return $token; | return $token; | ||||
} | } | ||||
Show All 37 Lines | $form = id(new AphrontFormView()) | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setLabel(pht('Secret Stuff'))) | ->setLabel(pht('Secret Stuff'))) | ||||
->appendRemarkupInstructions(''); | ->appendRemarkupInstructions(''); | ||||
return $form; | return $form; | ||||
} | } | ||||
public function exitHighSecurity( | |||||
PhabricatorUser $viewer, | |||||
PhabricatorAuthSession $session) { | |||||
queryfx( | |||||
$session->establishConnection('w'), | |||||
'UPDATE %T SET highSecurityUntil = NULL WHERE id = %d', | |||||
$session->getTableName(), | |||||
$session->getID()); | |||||
$log = PhabricatorUserLog::initializeNewLog( | |||||
$viewer, | |||||
$viewer->getPHID(), | |||||
PhabricatorUserLog::ACTION_EXIT_HISEC); | |||||
$log->save(); | |||||
} | |||||
} | } |