formLogin.phtml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 name="crypto_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"<?= $this->auth_autofills['username'] !== '' ? ' value="' . $this->auth_autofills['username'] . '"' : '' ?>
  25. autocomplete="username" size="16" required="required"
  26. pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autofocus="autofocus" autocapitalize="off" />
  27. </div>
  28. <div class="form-group">
  29. <label for="passwordPlain"><?= _t('gen.auth.password') ?></label>
  30. <div class="stick">
  31. <input type="password" id="passwordPlain"<?= $this->auth_autofills['password'] !== '' ? ' value="' . $this->auth_autofills['password'] . '"' : '' ?>
  32. class="passwordPlain" required="required" />
  33. <button type="button" class="btn toggle-password"><?= _i('key') ?></button>
  34. </div>
  35. <input type="hidden" id="challenge" name="challenge" />
  36. <noscript><strong><?= _t('gen.js.should_be_activated') ?></strong></noscript>
  37. </div>
  38. <div class="form-group">
  39. <label class="checkbox" for="keep_logged_in">
  40. <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" />
  41. <?= _t('gen.auth.keep_logged_in', $this->cookie_days) ?>
  42. </label>
  43. </div>
  44. <?= Minz_ExtensionManager::callHookString(Minz_HookType::BeforeLoginBtn) ?>
  45. <div class="form-group form-group-actions">
  46. <button id="loginButton" type="submit" class="btn btn-important" disabled="disabled">
  47. <?= _t('gen.auth.login') ?>
  48. </button>
  49. </div>
  50. </form>
  51. </main>
  52. <footer class="main-footer">
  53. <a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a>
  54. <?php if (file_exists(TOS_FILENAME)) { ?>
  55. | <a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
  56. <?php } ?>
  57. </footer>