Path: blob/master/src/applications/auth/revoker/PhabricatorAuthTemporaryTokenRevoker.php
12256 views
<?php12final class PhabricatorAuthTemporaryTokenRevoker3extends PhabricatorAuthRevoker {45const REVOKERKEY = 'temporary';67public function getRevokerName() {8return pht('Temporary Tokens');9}1011public function getRevokerDescription() {12return pht(13"Revokes temporary authentication tokens.\n\n".14"Temporary tokens are used in password reset mail, welcome mail, and ".15"by some other systems like Git LFS. Revoking temporary tokens will ".16"invalidate existing links in password reset and invite mail that ".17"was sent before the revocation occurred.");18}1920public function revokeAllCredentials() {21$table = new PhabricatorAuthTemporaryToken();22$conn = $table->establishConnection('w');2324queryfx(25$conn,26'DELETE FROM %T',27$table->getTableName());2829return $conn->getAffectedRows();30}3132public function revokeCredentialsFrom($object) {33$table = new PhabricatorAuthTemporaryToken();34$conn = $table->establishConnection('w');3536queryfx(37$conn,38'DELETE FROM %T WHERE tokenResource = %s',39$table->getTableName(),40$object->getPHID());4142return $conn->getAffectedRows();43}4445}464748