Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96549932
DarkConsoleController.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
Fri, Dec 27, 23:29
Size
1017 B
Mime Type
text/x-php
Expires
Sun, Dec 29, 23:29 (2 d)
Engine
blob
Format
Raw Data
Handle
23204569
Attached To
rPH Phabricator
DarkConsoleController.php
View Options
<?php
final
class
DarkConsoleController
extends
PhabricatorController
{
protected
$op
;
protected
$data
;
public
function
shouldRequireLogin
()
{
return
!
PhabricatorEnv
::
getEnvConfig
(
'darkconsole.always-on'
);
}
public
function
shouldRequireEnabledUser
()
{
return
!
PhabricatorEnv
::
getEnvConfig
(
'darkconsole.always-on'
);
}
public
function
shouldAllowPartialSessions
()
{
return
true
;
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$response
=
id
(
new
AphrontAjaxResponse
())->
setDisableConsole
(
true
);
if
(!
$user
->
isLoggedIn
())
{
return
$response
;
}
$visible
=
$request
->
getStr
(
'visible'
);
if
(
strlen
(
$visible
))
{
$user
->
setConsoleVisible
((
int
)
$visible
);
$user
->
save
();
return
$response
;
}
$tab
=
$request
->
getStr
(
'tab'
);
if
(
strlen
(
$tab
))
{
$user
->
setConsoleTab
(
$tab
);
$user
->
save
();
return
$response
;
}
return
new
Aphront404Response
();
}
}
Event Timeline
Log In to Comment