profile.phtml 3.7 KB

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