index.phtml 3.9 KB

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