profile.phtml 4.2 KB

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