Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96627185
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
Sun, Dec 29, 04:50
Size
1017 B
Mime Type
text/x-php
Expires
Tue, Dec 31, 04:50 (7 h, 31 m)
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