Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93950457
PhabricatorAuthTemporaryTokenRevoker.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
Mon, Dec 2, 19:00
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 4, 19:00 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22728061
Attached To
rPH Phabricator
PhabricatorAuthTemporaryTokenRevoker.php
View Options
<?php
final
class
PhabricatorAuthTemporaryTokenRevoker
extends
PhabricatorAuthRevoker
{
const
REVOKERKEY
=
'temporary'
;
public
function
getRevokerName
()
{
return
pht
(
'Temporary Tokens'
);
}
public
function
getRevokerDescription
()
{
return
pht
(
"Revokes temporary authentication tokens.
\n\n
"
.
"Temporary tokens are used in password reset mail, welcome mail, and "
.
"by some other systems like Git LFS. Revoking temporary tokens will "
.
"invalidate existing links in password reset and invite mail that "
.
"was sent before the revocation occurred."
);
}
public
function
revokeAllCredentials
()
{
$table
=
new
PhabricatorAuthTemporaryToken
();
$conn
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn
,
'DELETE FROM %T'
,
$table
->
getTableName
());
return
$conn
->
getAffectedRows
();
}
public
function
revokeCredentialsFrom
(
$object
)
{
$table
=
new
PhabricatorAuthTemporaryToken
();
$conn
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn
,
'DELETE FROM %T WHERE tokenResource = %s'
,
$table
->
getTableName
(),
$object
->
getPHID
());
return
$conn
->
getAffectedRows
();
}
}
Event Timeline
Log In to Comment