SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/tfa/totp_setup.php

  1. <?php
  2. use Sprout\Helpers\Enc;
  3. use Sprout\Helpers\Fb;
  4. ?>
  5.  
  6. <style>
  7. input.two-factor-code { text-align: center; font: 16px monospace; letter-spacing: 1em; padding-left: 1em; }
  8. </style>
  9.  
  10.  
  11. <h3>Step 1 - scan the code</h3>
  12. <div class="white-box" style="text-align: center">
  13. <p>
  14. Scan this barcode into your two-factor authentication app:
  15. </p>
  16. <p>
  17. <img src="<?= Enc::html($qr_img); ?>" width="200" height="200">
  18. </p>
  19. <p>&nbsp;</p>
  20. <p>
  21. You can also enter the secret key directly:
  22. </p>
  23. <p><code><?= Enc::html($secret); ?></code></p>
  24. </div>
  25.  
  26.  
  27. <h3>Step 2 - verify code</h3>
  28. <form action="<?= $action_url; ?>" method="post">
  29. <div class="white-box" style="text-align: center">
  30. <p>
  31. Enter the generated token, for verification.
  32. </p>
  33. <p>
  34. <?= Fb::text('code', ['class' => 'two-factor-code', 'size' => '7', 'autocomplete' => 'off'], []); ?>
  35. </p>
  36. <p>
  37. <button type="submit" class="button">Verify and enable two-factor auth</button>
  38. </p>
  39. </div>
  40. </form>
  41.