index.phtml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. $this->partial('aside_configure');
  5. ?>
  6. <main class="post">
  7. <h1><?= _t('gen.menu.authentication') ?></h1>
  8. <form method="post" action="<?= _url('auth', 'index') ?>" data-auto-leave-validation="1">
  9. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  10. <div class="form-group">
  11. <label class="group-name" for="auth_type"><?= _t('admin.auth.type') ?></label>
  12. <div class="group-controls">
  13. <select id="auth_type" name="auth_type" required="required">
  14. <?php if (!in_array(FreshRSS_Context::systemConf()->auth_type, ['form', 'http_auth', 'none'], true)) { ?>
  15. <option selected="selected"></option>
  16. <?php } ?>
  17. <option value="form"<?= FreshRSS_Context::systemConf()->auth_type === 'form' ? ' selected="selected"' : '',
  18. cryptAvailable() ? '' : ' disabled="disabled"' ?>><?= _t('admin.auth.form') ?></option>
  19. <option value="http_auth"<?= FreshRSS_Context::systemConf()->auth_type === 'http_auth' ? ' selected="selected"' : '' ?>>
  20. <?= _t('admin.auth.http') ?> (REMOTE_USER = '<?= httpAuthUser() ?>')</option>
  21. <option value="none"<?= FreshRSS_Context::systemConf()->auth_type === 'none' ? ' selected="selected"' : '' ?>><?= _t('admin.auth.none') ?></option>
  22. </select>
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <div class="group-controls">
  27. <label class="checkbox" for="anon_access">
  28. <input type="checkbox" name="anon_access" id="anon_access" value="1"<?=
  29. FreshRSS_Context::systemConf()->allow_anonymous ? ' checked="checked"' : '',
  30. FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
  31. <?= _t('admin.auth.allow_anonymous', FreshRSS_Context::systemConf()->default_user) ?>
  32. </label>
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <div class="group-controls">
  37. <label class="checkbox" for="anon_refresh">
  38. <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?=
  39. FreshRSS_Context::systemConf()->allow_anonymous_refresh ? ' checked="checked"' : '',
  40. FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
  41. <?= _t('admin.auth.allow_anonymous_refresh') ?>
  42. </label>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <div class="group-controls">
  47. <label class="checkbox" for="unsafe_autologin">
  48. <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?=
  49. FreshRSS_Context::systemConf()->unsafe_autologin_enabled ? ' checked="checked"' : '',
  50. FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"' ?> />
  51. <?= _t('admin.auth.unsafe_autologin') ?>
  52. <kbd><?= Minz_Url::display(['c' => 'auth', 'a' => 'login', 'params' => ['u' => 'alice', 'p' => '1234']], 'html', true) ?></kbd>
  53. </label>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <div class="group-controls">
  58. <label class="checkbox" for="api_enabled">
  59. <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?=
  60. FreshRSS_Context::systemConf()->api_enabled ? ' checked="checked"' : '',
  61. FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"' ?> />
  62. <?= _t('admin.auth.api_enabled') ?>
  63. </label>
  64. </div>
  65. </div>
  66. <div class="form-group form-actions">
  67. <div class="group-controls">
  68. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  69. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  70. </div>
  71. </div>
  72. </form>
  73. </main>