You are here

class TfaCommands in Two-factor Authentication (TFA) 8

A Drush command file.

Hierarchy

  • class \Drupal\tfa\Commands\TfaCommands extends \Drush\Commands\DrushCommands implements \Drush\Drupal\Commands\sql\SanitizePluginInterface

Expanded class hierarchy of TfaCommands

1 string reference to 'TfaCommands'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses TfaCommands
tfa.commands in ./drush.services.yml
\Drupal\tfa\Commands\TfaCommands

File

src/Commands/TfaCommands.php, line 13

Namespace

Drupal\tfa\Commands
View source
class TfaCommands extends DrushCommands implements SanitizePluginInterface {

  /**
   * {@inheritdoc}
   */
  public function sanitize($result, CommandData $commandData) {

    // DBTNG does not support expressions in delete queries.
    $sql = "DELETE FROM users_data WHERE LEFT(name, 4) = 'tfa_'";
    \Drupal::service('database')
      ->query($sql);
    $this
      ->logger()
      ->success('Removed recovery codes and other user-specific TFA data.');
  }

  /**
   * {@inheritdoc}
   */
  public function messages(&$messages, InputInterface $input) {
    return $messages[] = dt('Remove recovery codes and other user-specific TFA data.');
  }

}

Members