Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99174418
PhabricatorAuthDowngradeSessionController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 22, 00:17
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 24, 00:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23713584
Attached To
rPH Phabricator
PhabricatorAuthDowngradeSessionController.php
View Options
<?php
final
class
PhabricatorAuthDowngradeSessionController
extends
PhabricatorAuthController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$panel_uri
=
'/settings/panel/sessions/'
;
$session
=
$viewer
->
getSession
();
if
(
$session
->
getHighSecurityUntil
()
<
time
())
{
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Normal Security Restored'
))
->
appendParagraph
(
pht
(
'Your session is no longer in high security.'
))
->
addCancelButton
(
$panel_uri
,
pht
(
'Continue'
));
}
if
(
$request
->
isFormPost
())
{
queryfx
(
$session
->
establishConnection
(
'w'
),
'UPDATE %T SET highSecurityUntil = NULL WHERE id = %d'
,
$session
->
getTableName
(),
$session
->
getID
());
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
$this
->
getApplicationURI
(
'session/downgrade/'
));
}
return
$this
->
newDialog
()
->
setTitle
(
pht
(
'Leaving High Security'
))
->
appendParagraph
(
pht
(
'Leave high security and return your session to normal '
.
'security levels?'
))
->
appendParagraph
(
pht
(
'If you leave high security, you will need to authenticate '
.
'again the next time you try to take a high security action.'
))
->
appendParagraph
(
pht
(
'On the plus side, that purple notification bubble will '
.
'disappear.'
))
->
addSubmitButton
(
pht
(
'Leave High Security'
))
->
addCancelButton
(
$panel_uri
,
pht
(
'Stay in High Security'
));
}
}
Event Timeline
Log In to Comment