Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/revoker/PhabricatorAuthSSHRevoker.php
- This file was copied to src/applications/auth/revoker/PhabricatorAuthPasswordRevoker.php.
Show All 31 Lines | private function revokeWithQuery(PhabricatorAuthSSHKeyQuery $query) { | ||||
$auth_phid = id(new PhabricatorAuthApplication())->getPHID(); | $auth_phid = id(new PhabricatorAuthApplication())->getPHID(); | ||||
foreach ($ssh_keys as $ssh_key) { | foreach ($ssh_keys as $ssh_key) { | ||||
$xactions = array(); | $xactions = array(); | ||||
$xactions[] = $ssh_key->getApplicationTransactionTemplate() | $xactions[] = $ssh_key->getApplicationTransactionTemplate() | ||||
->setTransactionType(PhabricatorAuthSSHKeyTransaction::TYPE_DEACTIVATE) | ->setTransactionType(PhabricatorAuthSSHKeyTransaction::TYPE_DEACTIVATE) | ||||
->setNewValue(1); | ->setNewValue(1); | ||||
$editor = id(new PhabricatorAuthSSHKeyEditor()) | $editor = $ssh_key->getApplicationTransactionEditor() | ||||
->setActor($viewer) | ->setActor($viewer) | ||||
->setActingAsPHID($auth_phid) | ->setActingAsPHID($auth_phid) | ||||
->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
->setContentSource($content_source) | ->setContentSource($content_source) | ||||
->applyTransactions($ssh_key, $xactions); | ->applyTransactions($ssh_key, $xactions); | ||||
} | } | ||||
return count($ssh_keys); | return count($ssh_keys); | ||||
} | } | ||||
} | } |