Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/auth/controller/PhabricatorAuthDowngradeSessionController.php
12256 views
1
<?php
2
3
final class PhabricatorAuthDowngradeSessionController
4
extends PhabricatorAuthController {
5
6
public function handleRequest(AphrontRequest $request) {
7
$viewer = $this->getViewer();
8
9
$panel_uri = '/settings/panel/sessions/';
10
11
$session = $viewer->getSession();
12
if ($session->getHighSecurityUntil() < time()) {
13
return $this->newDialog()
14
->setTitle(pht('Normal Security Restored'))
15
->appendParagraph(
16
pht('Your session is no longer in high security.'))
17
->addCancelButton($panel_uri, pht('Continue'));
18
}
19
20
if ($request->isFormPost()) {
21
22
id(new PhabricatorAuthSessionEngine())
23
->exitHighSecurity($viewer, $session);
24
25
return id(new AphrontRedirectResponse())
26
->setURI($this->getApplicationURI('session/downgrade/'));
27
}
28
29
return $this->newDialog()
30
->setTitle(pht('Leaving High Security'))
31
->appendParagraph(
32
pht(
33
'Leave high security and return your session to normal '.
34
'security levels?'))
35
->appendParagraph(
36
pht(
37
'If you leave high security, you will need to authenticate '.
38
'again the next time you try to take a high security action.'))
39
->appendParagraph(
40
pht(
41
'On the plus side, that purple notification bubble will '.
42
'disappear.'))
43
->addSubmitButton(pht('Leave High Security'))
44
->addCancelButton($panel_uri, pht('Stay'));
45
}
46
47
48
}
49
50