Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99062471
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
Sat, Jan 18, 19:56
Size
1017 B
Mime Type
text/x-php
Expires
Mon, Jan 20, 19:56 (2 d)
Engine
blob
Format
Raw Data
Handle
23692369
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