Invalid.php 1.2 KB

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