users.phtml 8.6 KB

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