register.phtml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. ?>
  5. <main class="prompt">
  6. <h1><?= _t('gen.auth.registration') ?></h1>
  7. <form method="post" action="<?= _url('user', 'create') ?>">
  8. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  9. <div class="form-group">
  10. <label for="new_user_language"><?= _t('admin.user.language') ?></label>
  11. <select name="new_user_language" id="new_user_language">
  12. <?php $languages = Minz_Translate::availableLanguages(); ?>
  13. <?php foreach ($languages as $lang) { ?>
  14. <option value="<?= $lang ?>"<?= $this->preferred_language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option>
  15. <?php } ?>
  16. </select>
  17. </div>
  18. <div class="form-group">
  19. <label for="new_user_timezone"><?= _t('conf.display.timezone') ?></label>
  20. <select name="new_user_timezone" id="new_user_timezone">
  21. <?php $timezones = array_merge([''], DateTimeZone::listIdentifiers()); ?>
  22. <?php foreach ($timezones as $timezone): ?>
  23. <option value="<?= $timezone ?>"<?= $timezone === '' ? ' selected="selected"' : '' ?>>
  24. <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . FreshRSS_Context::defaultTimeZone() . ')' : $timezone ?>
  25. </option>
  26. <?php endforeach; ?>
  27. </select>
  28. </div>
  29. <div class="form-group">
  30. <label for="new_user_name"><?= _t('gen.auth.username') ?></label>
  31. <input id="new_user_name" name="new_user_name" type="text"<?= $this->auth_autofills['username'] !== '' ? ' value="' . $this->auth_autofills['username'] . '"' : '' ?>
  32. size="16" required="required" autocomplete="off"
  33. pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autocapitalize="off" />
  34. <p class="help"><?= _i('help') ?> <?= _t('gen.auth.username.format') ?></p>
  35. </div>
  36. <?php if ($this->show_email_field) { ?>
  37. <div class="form-group">
  38. <label for="new_user_email">
  39. <?= _t('gen.auth.email') ?>
  40. </label>
  41. <input id="new_user_email" name="new_user_email" type="email" required="required" />
  42. </div>
  43. <?php } ?>
  44. <div class="form-group">
  45. <label for="new_user_passwordPlain"><?= _t('gen.auth.password') ?></label>
  46. <div class="stick">
  47. <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain"<?= $this->auth_autofills['password'] !== '' ? ' value="' . $this->auth_autofills['password'] . '"' : '' ?>
  48. required="required" autocomplete="new-password" pattern=".{7,}" />
  49. <button type="button" class="btn toggle-password"><?= _i('key') ?></button>
  50. </div>
  51. <noscript><b><?= _t('gen.js.should_be_activated') ?></b></noscript>
  52. <p class="help"><?= _i('help') ?> <?= _t('gen.auth.password.format') ?></p>
  53. </div>
  54. <?php if ($this->show_tos_checkbox) { ?>
  55. <div class="form-group">
  56. <label class="checkbox" for="accept-tos">
  57. <input type="checkbox" name="accept_tos" id="accept-tos" value="1" required="required" />
  58. <?= _t('gen.auth.accept_tos', _url('index', 'tos')) ?>
  59. </label>
  60. </div>
  61. <?php } ?>
  62. <?= Minz_ExtensionManager::callHookString(Minz_HookType::BeforeLoginBtn) ?>
  63. <div class="form-group form-group-actions">
  64. <?php
  65. $redirect_url = urlencode(Minz_Url::display(
  66. ['c' => 'index', 'a' => 'index'],
  67. 'php', true
  68. ));
  69. ?>
  70. <input type="hidden" name="r" value="<?= $redirect_url ?>" />
  71. <button type="submit" class="btn btn-important"><?= _t('gen.action.create') ?></button>
  72. <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.cancel') ?></a>
  73. </div>
  74. </form>
  75. </main>
  76. <footer class="main-footer">
  77. <a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a>
  78. <?php if (file_exists(TOS_FILENAME)) { ?>
  79. | <a href="<?= _url('index', 'tos') ?>"><?= _t('index.tos.title')?></a>
  80. <?php } ?>
  81. </footer>