Path: blob/master/src/applications/auth/controller/PhabricatorAuthDowngradeSessionController.php
12256 views
<?php12final class PhabricatorAuthDowngradeSessionController3extends PhabricatorAuthController {45public function handleRequest(AphrontRequest $request) {6$viewer = $this->getViewer();78$panel_uri = '/settings/panel/sessions/';910$session = $viewer->getSession();11if ($session->getHighSecurityUntil() < time()) {12return $this->newDialog()13->setTitle(pht('Normal Security Restored'))14->appendParagraph(15pht('Your session is no longer in high security.'))16->addCancelButton($panel_uri, pht('Continue'));17}1819if ($request->isFormPost()) {2021id(new PhabricatorAuthSessionEngine())22->exitHighSecurity($viewer, $session);2324return id(new AphrontRedirectResponse())25->setURI($this->getApplicationURI('session/downgrade/'));26}2728return $this->newDialog()29->setTitle(pht('Leaving High Security'))30->appendParagraph(31pht(32'Leave high security and return your session to normal '.33'security levels?'))34->appendParagraph(35pht(36'If you leave high security, you will need to authenticate '.37'again the next time you try to take a high security action.'))38->appendParagraph(39pht(40'On the plus side, that purple notification bubble will '.41'disappear.'))42->addSubmitButton(pht('Leave High Security'))43->addCancelButton($panel_uri, pht('Stay'));44}454647}484950