Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F462940
PhabricatorAuthPasswordRevoker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthPasswordRevoker.php
View Options
<?php
final
class
PhabricatorAuthPasswordRevoker
extends
PhabricatorAuthRevoker
{
const
REVOKERKEY
=
'password'
;
public
function
revokeAllCredentials
()
{
$query
=
new
PhabricatorAuthPasswordQuery
();
return
$this
->
revokeWithQuery
(
$query
);
}
public
function
revokeCredentialsFrom
(
$object
)
{
$query
=
id
(
new
PhabricatorAuthPasswordQuery
())
->
withObjectPHIDs
(
array
(
$object
->
getPHID
()));
return
$this
->
revokeWithQuery
(
$query
);
}
private
function
revokeWithQuery
(
PhabricatorAuthPasswordQuery
$query
)
{
$viewer
=
$this
->
getViewer
();
$passwords
=
$query
->
setViewer
(
$viewer
)
->
withIsRevoked
(
false
)
->
execute
();
$content_source
=
PhabricatorContentSource
::
newForSource
(
PhabricatorDaemonContentSource
::
SOURCECONST
);
$revoke_type
=
PhabricatorAuthPasswordRevokeTransaction
::
TRANSACTIONTYPE
;
$auth_phid
=
id
(
new
PhabricatorAuthApplication
())->
getPHID
();
foreach
(
$passwords
as
$password
)
{
$xactions
=
array
();
$xactions
[]
=
$password
->
getApplicationTransactionTemplate
()
->
setTransactionType
(
$revoke_type
)
->
setNewValue
(
true
);
$editor
=
$password
->
getApplicationTransactionEditor
()
->
setActor
(
$viewer
)
->
setActingAsPHID
(
$auth_phid
)
->
setContinueOnNoEffect
(
true
)
->
setContinueOnMissingFields
(
true
)
->
setContentSource
(
$content_source
)
->
applyTransactions
(
$password
,
$xactions
);
}
return
count
(
$passwords
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 6:39 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72882
Default Alt Text
PhabricatorAuthPasswordRevoker.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment