profile.phtml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. </div>
  36. </div>
  37. <?php } ?>
  38. <div class="form-group">
  39. <label class="group-name" for="mail_login"><?php echo _t('conf.profile.email_persona'); ?></label>
  40. <?php $mail = FreshRSS_Context::$user_conf->mail_login; ?>
  41. <div class="group-controls">
  42. <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo FreshRSS_Auth::hasAccess('admin') ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" />
  43. <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript>
  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 _t('gen.action.submit'); ?></button>
  49. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  50. </div>
  51. </div>
  52. </form>
  53. <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?>
  54. <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>">
  55. <legend><?php echo _t('conf.profile.delete'); ?></legend>
  56. <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p>
  57. <div class="form-group">
  58. <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label>
  59. <div class="group-controls">
  60. <input type="password" id="passwordPlain" required="required" />
  61. <input type="hidden" id="challenge" name="challenge" /><br />
  62. <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript>
  63. </div>
  64. </div>
  65. <div class="form-group form-actions">
  66. <div class="group-controls">
  67. <?php
  68. $redirect_url = urlencode(Minz_Url::display(
  69. array('c' => 'user', 'a' => 'profile'),
  70. 'php', true
  71. ));
  72. ?>
  73. <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" />
  74. <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
  75. <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button>
  76. </div>
  77. </div>
  78. </form>
  79. <?php } ?>
  80. </div>