Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / auth / revoker / PhabricatorAuthSessionRevoker.php
blobc3362b033158e76f6ac0390b6d033c54467ab238
1 <?php
3 final class PhabricatorAuthSessionRevoker
4 extends PhabricatorAuthRevoker {
6 const REVOKERKEY = 'session';
8 public function getRevokerName() {
9 return pht('Sessions');
12 public function getRevokerDescription() {
13 return pht(
14 "Revokes all active login sessions.\n\n".
15 "Affected users will be logged out and need to log in again.");
18 public function revokeAllCredentials() {
19 $table = new PhabricatorAuthSession();
20 $conn = $table->establishConnection('w');
22 queryfx(
23 $conn,
24 'DELETE FROM %T',
25 $table->getTableName());
27 return $conn->getAffectedRows();
30 public function revokeCredentialsFrom($object) {
31 $table = new PhabricatorAuthSession();
32 $conn = $table->establishConnection('w');
34 queryfx(
35 $conn,
36 'DELETE FROM %T WHERE userPHID = %s',
37 $table->getTableName(),
38 $object->getPHID());
40 return $conn->getAffectedRows();