Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109725818
PhabricatorSSHKeysSettingsPanel.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, Apr 23, 03:56
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Apr 25, 03:56 (2 d)
Engine
blob
Format
Raw Data
Handle
25743114
Attached To
rPH Phabricator
PhabricatorSSHKeysSettingsPanel.php
View Options
<?php
final
class
PhabricatorSSHKeysSettingsPanel
extends
PhabricatorSettingsPanel
{
public
function
isEditableByAdministrators
()
{
return
true
;
}
public
function
getPanelKey
()
{
return
'ssh'
;
}
public
function
getPanelName
()
{
return
pht
(
'SSH Public Keys'
);
}
public
function
getPanelGroup
()
{
return
pht
(
'Authentication'
);
}
public
function
isEnabled
()
{
if
(
$this
->
getUser
()->
getIsMailingList
())
{
return
false
;
}
return
true
;
}
public
function
processRequest
(
AphrontRequest
$request
)
{
$user
=
$this
->
getUser
();
$viewer
=
$request
->
getUser
();
$keys
=
id
(
new
PhabricatorAuthSSHKeyQuery
())
->
setViewer
(
$viewer
)
->
withObjectPHIDs
(
array
(
$user
->
getPHID
()))
->
withIsActive
(
true
)
->
execute
();
$table
=
id
(
new
PhabricatorAuthSSHKeyTableView
())
->
setUser
(
$viewer
)
->
setKeys
(
$keys
)
->
setCanEdit
(
true
)
->
setNoDataString
(
pht
(
"You haven't added any SSH Public Keys."
));
$panel
=
new
PHUIObjectBoxView
();
$header
=
new
PHUIHeaderView
();
$ssh_actions
=
PhabricatorAuthSSHKeyTableView
::
newKeyActionsMenu
(
$viewer
,
$user
);
$header
->
setHeader
(
pht
(
'SSH Public Keys'
));
$header
->
addActionLink
(
$ssh_actions
);
$panel
->
setHeader
(
$header
);
$panel
->
setTable
(
$table
);
return
$panel
;
}
}
Event Timeline
Log In to Comment