Differential D8909 Diff 21166 src/applications/auth/management/PhabricatorAuthManagementListFactorsWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/management/PhabricatorAuthManagementListFactorsWorkflow.php
- This file was added.
<?php | |||||
final class PhabricatorAuthManagementListFactorsWorkflow | |||||
extends PhabricatorAuthManagementWorkflow { | |||||
protected function didConstruct() { | |||||
$this | |||||
->setName('list-factors') | |||||
->setExamples('**list-factors**') | |||||
->setSynopsis(pht('List available multi-factor authentication factors.')) | |||||
->setArguments(array()); | |||||
} | |||||
public function execute(PhutilArgumentParser $args) { | |||||
$factors = PhabricatorAuthFactor::getAllFactors(); | |||||
$console = PhutilConsole::getConsole(); | |||||
foreach ($factors as $factor) { | |||||
$console->writeOut( | |||||
"%s\t%s\n", | |||||
$factor->getFactorKey(), | |||||
$factor->getFactorName()); | |||||
} | |||||
return 0; | |||||
} | |||||
} |