Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / auth / revoker / PhabricatorAuthTemporaryTokenRevoker.php
blobf274e13a18c734d3fada3c816fab654ad5545dd3
1 <?php
3 final class PhabricatorAuthTemporaryTokenRevoker
4 extends PhabricatorAuthRevoker {
6 const REVOKERKEY = 'temporary';
8 public function getRevokerName() {
9 return pht('Temporary Tokens');
12 public function getRevokerDescription() {
13 return pht(
14 "Revokes temporary authentication tokens.\n\n".
15 "Temporary tokens are used in password reset mail, welcome mail, and ".
16 "by some other systems like Git LFS. Revoking temporary tokens will ".
17 "invalidate existing links in password reset and invite mail that ".
18 "was sent before the revocation occurred.");
21 public function revokeAllCredentials() {
22 $table = new PhabricatorAuthTemporaryToken();
23 $conn = $table->establishConnection('w');
25 queryfx(
26 $conn,
27 'DELETE FROM %T',
28 $table->getTableName());
30 return $conn->getAffectedRows();
33 public function revokeCredentialsFrom($object) {
34 $table = new PhabricatorAuthTemporaryToken();
35 $conn = $table->establishConnection('w');
37 queryfx(
38 $conn,
39 'DELETE FROM %T WHERE tokenResource = %s',
40 $table->getTableName(),
41 $object->getPHID());
43 return $conn->getAffectedRows();