users.phtml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
  18. <?php $mail = $this->conf->mail_login; ?>
  19. <div class="group-controls">
  20. <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" />
  21. <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
  22. </div>
  23. </div>
  24. <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?>
  25. <div class="form-group form-actions">
  26. <div class="group-controls">
  27. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
  28. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  29. </div>
  30. </div>
  31. <?php } ?>
  32. <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?>
  33. <legend><?php echo Minz_Translate::t('auth_type'); ?></legend>
  34. <div class="form-group">
  35. <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label>
  36. <div class="group-controls">
  37. <select id="auth_type" name="auth_type" required="required">
  38. <option value=""></option>
  39. <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option>
  40. <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>>HTTP Auth</option>
  41. <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>>Mozilla Persona</option>
  42. </select>
  43. <code>$_SERVER['REMOTE_USER'] = `<?php echo httpAuthUser(); ?>`</code>
  44. </div>
  45. </div>
  46. <div class="form-group form-actions">
  47. <div class="group-controls">
  48. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
  49. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  50. </div>
  51. </div>
  52. <?php if (Minz_Configuration::authType() === 'persona') { ?>
  53. <legend>Mozilla Persona</legend>
  54. <div class="form-group">
  55. <div class="group-controls">
  56. <label class="checkbox" for="anon_access">
  57. <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : ''; ?> />
  58. <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?>
  59. </label>
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label>
  64. <?php $token = $this->conf->token; ?>
  65. <div class="group-controls">
  66. <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"/>
  67. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
  68. </div>
  69. </div>
  70. <div class="form-group form-actions">
  71. <div class="group-controls">
  72. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button>
  73. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  74. </div>
  75. </div>
  76. <?php } ?>
  77. </form>
  78. <form method="post" action="<?php echo _url('users', 'delete'); ?>">
  79. <legend><?php echo Minz_Translate::t('users'); ?></legend>
  80. <div class="form-group">
  81. <label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label>
  82. <div class="group-controls">
  83. <select id="users_list" name="username"><?php
  84. foreach (listUsers() as $user) {
  85. echo '<option>', $user, '</option>';
  86. }
  87. ?></select>
  88. </div>
  89. </div>
  90. <div class="form-group form-actions">
  91. <div class="group-controls">
  92. <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button>
  93. </div>
  94. </div>
  95. </form>
  96. <form method="post" action="<?php echo _url('users', 'create'); ?>">
  97. <legend><?php echo Minz_Translate::t('create_user'); ?></legend>
  98. <div class="form-group">
  99. <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label>
  100. <div class="group-controls">
  101. <select name="new_user_language" id="new_user_language">
  102. <?php $languages = $this->conf->availableLanguages (); ?>
  103. <?php foreach ($languages as $short => $lib) { ?>
  104. <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option>
  105. <?php } ?>
  106. </select>
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label>
  111. <div class="group-controls">
  112. <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" />
  113. </div>
  114. </div>
  115. <div class="form-group">
  116. <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
  117. <?php $mail = $this->conf->mail_login; ?>
  118. <div class="group-controls">
  119. <input type="email" id="new_user_email" name="new_user_email" placeholder="alice@example.net" />
  120. </div>
  121. </div>
  122. <div class="form-group form-actions">
  123. <div class="group-controls">
  124. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button>
  125. <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button>
  126. </div>
  127. </div>
  128. </form>
  129. <?php } ?>
  130. </div>