Invalid.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Second authentication factor handling
  4. */
  5. declare(strict_types=1);
  6. namespace PhpMyAdmin\Plugins\TwoFactor;
  7. use PhpMyAdmin\Plugins\TwoFactorPlugin;
  8. /**
  9. * Invalid two-factor authentication showing that configured choice is not available.
  10. */
  11. class Invalid extends TwoFactorPlugin
  12. {
  13. /** @var string */
  14. public static $id = 'invalid';
  15. /** @var bool */
  16. public static $showSubmit = false;
  17. /**
  18. * Checks authentication, returns true on success
  19. *
  20. * @return bool
  21. */
  22. public function check()
  23. {
  24. return false;
  25. }
  26. /**
  27. * Renders user interface to enter two-factor authentication
  28. *
  29. * @return string HTML code
  30. */
  31. public function render()
  32. {
  33. return $this->template->render('login/twofactor/invalid');
  34. }
  35. /**
  36. * Get user visible name
  37. *
  38. * @return string
  39. */
  40. public static function getName()
  41. {
  42. return 'Invalid two-factor authentication';
  43. }
  44. /**
  45. * Get user visible description
  46. *
  47. * @return string
  48. */
  49. public static function getDescription()
  50. {
  51. return 'Error fallback only!';
  52. }
  53. }