Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891607
PhabricatorAuthManagementTrustOAuthClientWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthManagementTrustOAuthClientWorkflow.php
View Options
<?php
final
class
PhabricatorAuthManagementTrustOAuthClientWorkflow
extends
PhabricatorAuthManagementWorkflow
{
protected
function
didConstruct
(
)
{
$this
->
setName
(
'trust-oauth-client'
)
->
setExamples
(
'**trust-oauth-client** [--id client_id]'
)
->
setSynopsis
(
pht
(
'Mark an OAuth client as trusted. Trusted OAuth clients may be '
.
'reauthorized without requiring users to manually confirm the '
.
'action.'
)
)
->
setArguments
(
array
(
array
(
'name'
=>
'id'
,
'param'
=>
'id'
,
'help'
=>
pht
(
'The id of the OAuth client.'
)
,
)
,
)
)
;
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$id
=
$args
->
getArg
(
'id'
)
;
if
(
!
$id
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify an OAuth client id with "--id".'
)
)
;
}
$client
=
id
(
new
PhabricatorOAuthServerClientQuery
(
)
)
->
setViewer
(
$this
->
getViewer
(
)
)
->
withIDs
(
array
(
$id
)
)
->
executeOne
(
)
;
if
(
!
$client
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Failed to find an OAuth client with id %s.'
,
$id
)
)
;
}
if
(
$client
->
getIsTrusted
(
)
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'OAuth client "%s" is already trusted.'
,
$client
->
getName
(
)
)
)
;
}
$client
->
setIsTrusted
(
1
)
;
$client
->
save
(
)
;
$console
=
PhutilConsole
::
getConsole
(
)
;
$console
->
writeOut
(
"%s\n"
,
pht
(
'OAuth client "%s" is now trusted.'
,
$client
->
getName
(
)
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:28 (3 w, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125987
Default Alt Text
PhabricatorAuthManagementTrustOAuthClientWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment