Differential D20671 Diff 49317 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 309 Lines • ▼ Show 20 Lines | if ($config) { | ||||
$sync_token = $config->getMFASyncToken(); | $sync_token = $config->getMFASyncToken(); | ||||
if ($sync_token) { | if ($sync_token) { | ||||
$sync_token->revokeToken(); | $sync_token->revokeToken(); | ||||
} | } | ||||
$log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
$viewer, | $viewer, | ||||
$user->getPHID(), | $user->getPHID(), | ||||
PhabricatorUserLog::ACTION_MULTI_ADD); | PhabricatorAddMultifactorUserLogType::LOGTYPE); | ||||
$log->save(); | $log->save(); | ||||
$user->updateMultiFactorEnrollment(); | $user->updateMultiFactorEnrollment(); | ||||
// Terminate other sessions so they must log in and survive the | // Terminate other sessions so they must log in and survive the | ||||
// multi-factor auth check. | // multi-factor auth check. | ||||
id(new PhabricatorAuthSessionEngine())->terminateLoginSessions( | id(new PhabricatorAuthSessionEngine())->terminateLoginSessions( | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | private function processDelete(AphrontRequest $request) { | ||||
} | } | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
$factor->delete(); | $factor->delete(); | ||||
$log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
$viewer, | $viewer, | ||||
$user->getPHID(), | $user->getPHID(), | ||||
PhabricatorUserLog::ACTION_MULTI_REMOVE); | PhabricatorRemoveMultifactorUserLogType::LOGTYPE); | ||||
$log->save(); | $log->save(); | ||||
$user->updateMultiFactorEnrollment(); | $user->updateMultiFactorEnrollment(); | ||||
return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
->setURI($this->getPanelURI()); | ->setURI($this->getPanelURI()); | ||||
} | } | ||||
Show All 34 Lines |