index.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php declare(strict_types=1); ?>
  2. <?php displayIndex(); ?>
  3. <h2 id="type"><?= _('Account type') ?></h2>
  4. <p>
  5. <?php
  6. if (isset($_SESSION['id']))
  7. echo match ($_SESSION['type']) {
  8. 'testing' => _('You are currently using a <strong>testing</strong> account.'),
  9. 'approved' => _('You are currently using an <strong>approved</strong> account.'),
  10. };
  11. else
  12. echo _('You are not logged in.');
  13. ?>
  14. </p>
  15. <p>
  16. <?= _('When an account is created, it\'s a <em>testing</em> account. A testing account is only temporary and with limited capabilities on the services. Once the account is validated by using an approval key requested to an administrator, it becomes an <em>approved</em> account.') ?>
  17. </p>
  18. <h2><?= _('Rate limit') ?></h2>
  19. <details>
  20. <?php $tokens = isset($_SESSION['id']) ? rateLimitAccount(0) : MAX_ACCOUNT_TOKENS; ?>
  21. <summary><?= sprintf(_('Your account is at %s%% of the rate limit.'), '<span title="' . abs($tokens-MAX_ACCOUNT_TOKENS) . '/' . MAX_ACCOUNT_TOKENS . '">' . abs(intval($tokens / MAX_ACCOUNT_TOKENS * 100)-100) . '</title>') ?></summary>
  22. <p>
  23. <?= _('Most of the form submissions bring you closer to the rate limit. If you reach it, you need to wait in order to be able to submit forms again.') ?>
  24. </p>
  25. </details>
  26. <h2><?= _('Internal ID') ?></h2>
  27. <p><?= sprintf(_('The current account\'s internal ID is %s.'), '<small><code>' . ($_SESSION['id'] ?? '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef') . '</code></small>') ?></p>