users.phtml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php $this->partial('aside_configure'); ?>
  2. <div class="post">
  3. <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a>
  4. <form method="post" action="<?php echo _url('users', 'auth'); ?>">
  5. <legend><?php echo Minz_Translate::t('login_configuration'); ?></legend>
  6. <div class="form-group">
  7. <label class="group-name" for="current_user"><?php echo Minz_Translate::t('current_user'); ?></label>
  8. <div class="group-controls">
  9. <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
  10. <label class="checkbox" for="is_admin">
  11. <input type="checkbox" id="is_admin" disabled="disabled" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? 'checked="checked" ' : ''; ?>/>
  12. <?php echo Minz_Translate::t('is_admin'); ?>
  13. </label>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label>
  18. <div class="group-controls">
  19. <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" />
  20. <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
  25. <?php $mail = $this->conf->mail_login; ?>
  26. <div class="group-controls">
  27. <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" />
  28. <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
  29. </div>
  30. </div>
  31. <div class="form-group form-actions">
  32. <div class="group-controls">
  33. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
  34. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  35. </div>
  36. </div>
  37. <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?>
  38. <legend><?php echo Minz_Translate::t('auth_type'); ?></legend>
  39. <div class="form-group">
  40. <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label>
  41. <div class="group-controls">
  42. <select id="auth_type" name="auth_type" required="required">
  43. <?php if (!in_array(Minz_Configuration::authType(), array('form', 'persona', 'http_auth', 'none'))) { ?>
  44. <option selected="selected"></option>
  45. <?php } ?>
  46. <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3.4', '<') ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_form'); ?></option>
  47. <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option>
  48. <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option>
  49. <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option>
  50. </select>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <div class="group-controls">
  55. <label class="checkbox" for="anon_access">
  56. <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '',
  57. Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
  58. <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?>
  59. </label>
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <div class="group-controls">
  64. <label class="checkbox" for="anon_refresh">
  65. <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo Minz_Configuration::allowAnonymousRefresh() ? ' checked="checked"' : '',
  66. Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
  67. <?php echo Minz_Translate::t('allow_anonymous_refresh'); ?>
  68. </label>
  69. </div>
  70. </div>
  71. <?php if (Minz_Configuration::canLogIn()) { ?>
  72. <div class="form-group">
  73. <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label>
  74. <?php $token = $this->conf->token; ?>
  75. <div class="group-controls">
  76. <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php
  77. echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> />
  78. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
  79. </div>
  80. </div>
  81. <?php } ?>
  82. <div class="form-group form-actions">
  83. <div class="group-controls">
  84. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
  85. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  86. </div>
  87. </div>
  88. </form>
  89. <form method="post" action="<?php echo _url('users', 'delete'); ?>">
  90. <legend><?php echo Minz_Translate::t('users'); ?></legend>
  91. <div class="form-group">
  92. <label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label>
  93. <div class="group-controls">
  94. <select id="users_list" name="username"><?php
  95. foreach (listUsers() as $user) {
  96. echo '<option>', $user, '</option>';
  97. }
  98. ?></select>
  99. </div>
  100. </div>
  101. <div class="form-group form-actions">
  102. <div class="group-controls">
  103. <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button>
  104. </div>
  105. </div>
  106. </form>
  107. <form method="post" action="<?php echo _url('users', 'create'); ?>">
  108. <legend><?php echo Minz_Translate::t('create_user'); ?></legend>
  109. <div class="form-group">
  110. <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label>
  111. <div class="group-controls">
  112. <select name="new_user_language" id="new_user_language">
  113. <?php $languages = $this->conf->availableLanguages (); ?>
  114. <?php foreach ($languages as $short => $lib) { ?>
  115. <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option>
  116. <?php } ?>
  117. </select>
  118. </div>
  119. </div>
  120. <div class="form-group">
  121. <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label>
  122. <div class="group-controls">
  123. <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" />
  124. </div>
  125. </div>
  126. <div class="form-group">
  127. <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label>
  128. <div class="group-controls">
  129. <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" />
  130. <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
  131. </div>
  132. </div>
  133. <div class="form-group">
  134. <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
  135. <?php $mail = $this->conf->mail_login; ?>
  136. <div class="group-controls">
  137. <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" />
  138. </div>
  139. </div>
  140. <div class="form-group form-actions">
  141. <div class="group-controls">
  142. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button>
  143. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  144. </div>
  145. </div>
  146. </form>
  147. <?php } ?>
  148. </div>