index.phtml 3.9 KB

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