profile.phtml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <?php if (FreshRSS_Auth::accessNeedsAction()) { ?>
  41. <div class="form-group">
  42. <label class="group-name" for="token"><?php echo _t('admin.auth.token'); ?></label>
  43. <?php $token = FreshRSS_Context::$user_conf->token; ?>
  44. <div class="group-controls">
  45. <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>"<?php
  46. echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo $token; ?>"/>
  47. <?php echo _i('help'); ?> <?php echo _t('admin.auth.token_help'); ?>
  48. <kbd><?php echo Minz_Url::display(array('a' => 'rss', 'params' => array('user' => Minz_Session::param('currentUser'), 'token' => $token, 'hours' => FreshRSS_Context::$user_conf->since_hours_posts_per_rss)), 'html', true); ?></kbd>
  49. </div>
  50. </div>
  51. <?php } ?>
  52. <div class="form-group form-actions">
  53. <div class="group-controls">
  54. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  55. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  56. </div>
  57. </div>
  58. </form>
  59. <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?>
  60. <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>">
  61. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  62. <legend><?php echo _t('conf.profile.delete'); ?></legend>
  63. <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p>
  64. <div class="form-group">
  65. <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label>
  66. <div class="group-controls">
  67. <input type="password" id="passwordPlain" required="required" />
  68. <input type="hidden" id="challenge" name="challenge" /><br />
  69. <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript>
  70. </div>
  71. </div>
  72. <div class="form-group form-actions">
  73. <div class="group-controls">
  74. <?php
  75. $redirect_url = urlencode(Minz_Url::display(
  76. array('c' => 'user', 'a' => 'profile'),
  77. 'php', true
  78. ));
  79. ?>
  80. <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" />
  81. <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
  82. <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button>
  83. </div>
  84. </div>
  85. </form>
  86. <?php } ?>
  87. </div>