profile.phtml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php $this->partial('aside_configure'); ?>
  2. <div class="post">
  3. <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a>
  4. <form method="post" action="<?php echo _url('user', 'profile'); ?>">
  5. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  6. <legend><?php echo _t('conf.profile'); ?></legend>
  7. <div class="form-group">
  8. <label class="group-name" for="current_user"><?php echo _t('conf.user.current'); ?></label>
  9. <div class="group-controls">
  10. <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
  11. <label class="checkbox" for="is_admin">
  12. <input type="checkbox" id="is_admin" disabled="disabled" <?php echo FreshRSS_Auth::hasAccess('admin') ? 'checked="checked" ' : ''; ?>/>
  13. <?php echo _t('conf.user.is_admin'); ?>
  14. </label>
  15. </div>
  16. </div>
  17. <div class="form-group">
  18. <label class="group-name" for="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label>
  19. <div class="group-controls">
  20. <div class="stick">
  21. <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
  22. <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a>
  23. </div>
  24. <?php echo _i('help'); ?> <?php echo _t('conf.profile.password_format'); ?>
  25. <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript>
  26. </div>
  27. </div>
  28. <?php if (FreshRSS_Context::$system_conf->api_enabled) { ?>
  29. <div class="form-group">
  30. <label class="group-name" for="apiPasswordPlain"><?php echo _t('conf.profile.password_api'); ?></label>
  31. <div class="group-controls">
  32. <div class="stick">
  33. <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
  34. <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?php echo _i('key'); ?></a>
  35. </div>
  36. <?php echo _i('help'); ?> <kbd><a href="../api/"><?php echo Minz_Url::display('/api/greader.php', 'html', true); ?></a></kbd>
  37. </div>
  38. </div>
  39. <?php } ?>
  40. <div class="form-group form-actions">
  41. <div class="group-controls">
  42. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  43. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  44. </div>
  45. </div>
  46. </form>
  47. <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?>
  48. <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>">
  49. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  50. <legend><?php echo _t('conf.profile.delete'); ?></legend>
  51. <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p>
  52. <div class="form-group">
  53. <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label>
  54. <div class="group-controls">
  55. <input type="password" id="passwordPlain" required="required" />
  56. <input type="hidden" id="challenge" name="challenge" /><br />
  57. <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript>
  58. </div>
  59. </div>
  60. <div class="form-group form-actions">
  61. <div class="group-controls">
  62. <?php
  63. $redirect_url = urlencode(Minz_Url::display(
  64. array('c' => 'user', 'a' => 'profile'),
  65. 'php', true
  66. ));
  67. ?>
  68. <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" />
  69. <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
  70. <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button>
  71. </div>
  72. </div>
  73. </form>
  74. <?php } ?>
  75. </div>