Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorSettingsPanelConduit.php
Show All 28 Lines | if ($request->isFormPost()) { | ||||
$dialog->appendChild(phutil_tag('p', array(), pht( | $dialog->appendChild(phutil_tag('p', array(), pht( | ||||
'Really destroy the old certificate? Any established '. | 'Really destroy the old certificate? Any established '. | ||||
'sessions will be terminated.'))); | 'sessions will be terminated.'))); | ||||
return id(new AphrontDialogResponse()) | return id(new AphrontDialogResponse()) | ||||
->setDialog($dialog); | ->setDialog($dialog); | ||||
} | } | ||||
$conn = $user->establishConnection('w'); | $sessions = id(new PhabricatorAuthSessionQuery()) | ||||
queryfx( | ->setViewer($user) | ||||
$conn, | ->withIdentityPHIDs(array($user->getPHID())) | ||||
'DELETE FROM %T WHERE userPHID = %s AND type LIKE %>', | ->withSessionTypes(array('conduit')) | ||||
PhabricatorUser::SESSION_TABLE, | ->execute(); | ||||
$user->getPHID(), | foreach ($sessions as $session) { | ||||
'conduit'); | $session->delete(); | ||||
} | |||||
// This implicitly regenerates the certificate. | // This implicitly regenerates the certificate. | ||||
$user->setConduitCertificate(null); | $user->setConduitCertificate(null); | ||||
$user->save(); | $user->save(); | ||||
return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
->setURI($this->getPanelURI('?regenerated=true')); | ->setURI($this->getPanelURI('?regenerated=true')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |