Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / auth / revoker / PhabricatorAuthConduitTokenRevoker.php
blob578b489a249ed1ec19ad19d802ce19f5d8a7f424
1 <?php
3 final class PhabricatorAuthConduitTokenRevoker
4 extends PhabricatorAuthRevoker {
6 const REVOKERKEY = 'conduit';
8 public function getRevokerName() {
9 return pht('Conduit API Tokens');
12 public function getRevokerDescription() {
13 return pht(
14 "Revokes all Conduit API tokens used to access the API.\n\n".
15 "Users will need to use `arc install-certificate` to install new ".
16 "API tokens before `arc` commands will work. Bots and scripts which ".
17 "access the API will need to have new tokens generated and ".
18 "installed.");
21 public function revokeAllCredentials() {
22 $table = id(new PhabricatorConduitToken());
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 = id(new PhabricatorConduitToken());
35 $conn = $table->establishConnection('w');
37 queryfx(
38 $conn,
39 'DELETE FROM %T WHERE objectPHID = %s',
40 $table->getTableName(),
41 $object->getPHID());
43 return $conn->getAffectedRows();