formLogin.phtml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. ?>
  5. <main class="prompt">
  6. <h1><?= _t('gen.auth.login') ?></h1>
  7. <?php if ((FreshRSS_Context::systemConf()->limits['max_registrations'] ?? 1) !== 1): ?>
  8. <?php if (FreshRSS_user_Controller::max_registrations_reached()): ?>
  9. <div><?=
  10. FreshRSS_Context::systemConf()->attributeString('closed_registration_message') ?:
  11. _t('admin.system.default_closed_registration_message')
  12. ?></div>
  13. <?php else: ?>
  14. <div class="link-registration">
  15. <a href="<?= _url('auth', 'register') ?>"><?= _t('gen.auth.registration.ask') ?></a>
  16. </div>
  17. <?php endif; ?>
  18. <?php endif; ?>
  19. <form class="crypto-form" method="post" action="<?= _url('auth', 'login') ?>">
  20. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  21. <input type="hidden" name="original_request" value="<?= Minz_Url::serialize(Minz_Request::originalRequest())?>" />
  22. <div class="form-group">
  23. <label for="username"><?= _t('gen.auth.username') ?></label>
  24. <input type="text" id="username" name="username" autocomplete="username" size="16" required="required"
  25. pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autofocus="autofocus" autocapitalize="off" />
  26. </div>
  27. <div class="form-group">
  28. <label for="passwordPlain"><?= _t('gen.auth.password') ?></label>
  29. <div class="stick">
  30. <input type="password" id="passwordPlain" class="passwordPlain" required="required" />
  31. <button type="button" class="btn toggle-password"><?= _i('key') ?></button>
  32. </div>
  33. <input type="hidden" id="challenge" name="challenge" />
  34. <noscript><strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
  35. </div>
  36. <div class="form-group">
  37. <label class="checkbox" for="keep_logged_in">
  38. <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" />
  39. <?= _t('gen.auth.keep_logged_in', $this->cookie_days) ?>
  40. </label>
  41. </div>
  42. <?= Minz_ExtensionManager::callHookString(Minz_HookType::BeforeLoginBtn) ?>
  43. <div class="form-group form-group-actions">
  44. <button id="loginButton" type="submit" class="btn btn-important" disabled="disabled">
  45. <?= _t('gen.auth.login') ?>
  46. </button>
  47. </div>
  48. </form>
  49. </main>
  50. <footer class="main-footer">
  51. <a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a>
  52. <?php if (file_exists(TOS_FILENAME)) { ?>
  53. | <a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
  54. <?php } ?>
  55. </footer>