index.phtml 4.0 KB

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