summaryrefslogtreecommitdiff
path: root/app/views/user
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-07-30 16:04:11 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-07-30 16:04:11 +0200
commit5fbbfdea8afdb399175abf18f1dcf1b6cabc2714 (patch)
tree6506dafeb093f78169feee0df648c48d3e97ebc6 /app/views/user
parent214a5cc9a4c2b821961bc21f22b4b08e34b5be68 (diff)
parent3d4a75aa3d37a239a34e1fa35def261a2c988665 (diff)
Merge branch 'dev' into beta
Diffstat (limited to 'app/views/user')
-rw-r--r--app/views/user/manage.phtml28
-rw-r--r--app/views/user/profile.phtml37
2 files changed, 62 insertions, 3 deletions
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml
index fe1b6618b..3d3bc3ddf 100644
--- a/app/views/user/manage.phtml
+++ b/app/views/user/manage.phtml
@@ -3,6 +3,34 @@
<div class="post">
<a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a>
+ <form method="post" action="<?php echo _url('user', 'setRegistration'); ?>">
+ <legend><?php echo _t('admin.user.registration.allow'); ?></legend>
+
+ <div class="form-group">
+ <label class="group-name" for="max-registrations"><?php echo _t('admin.user.registration.number'); ?></label>
+ <div class="group-controls">
+ <input type="number" id="max-registrations" name="max-registrations" value="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>" min="0" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>"/>
+ <?php echo _i('help'); ?> <?php echo _t('admin.user.registration.help'); ?>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="group-controls">
+ <?php
+ $number = count(listUsers());
+ echo _t($number > 1 ? 'admin.user.numbers' : 'admin.user.number', $number);
+ ?>
+ </div>
+ </div>
+
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
+ <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
+ </div>
+ </div>
+ </form>
+
<form method="post" action="<?php echo _url('user', 'create'); ?>">
<legend><?php echo _t('admin.user.create'); ?></legend>
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml
index c44202edd..7ae2c7ede 100644
--- a/app/views/user/profile.phtml
+++ b/app/views/user/profile.phtml
@@ -18,11 +18,11 @@
</div>
<div class="form-group">
- <label class="group-name" for="passwordPlain"><?php echo _t('conf.profile.password_form'); ?></label>
+ <label class="group-name" for="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label>
<div class="group-controls">
<div class="stick">
- <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
- <a class="btn toggle-password" data-toggle="passwordPlain"><?php echo _i('key'); ?></a>
+ <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/>
+ <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a>
</div>
<?php echo _i('help'); ?> <?php echo _t('conf.profile.password_format'); ?>
<noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript>
@@ -57,4 +57,35 @@
</div>
</div>
</form>
+
+ <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?>
+ <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>">
+ <legend><?php echo _t('conf.profile.delete'); ?></legend>
+
+ <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p>
+
+ <div class="form-group">
+ <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label>
+ <div class="group-controls">
+ <input type="password" id="passwordPlain" required="required" />
+ <input type="hidden" id="challenge" name="challenge" /><br />
+ <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript>
+ </div>
+ </div>
+
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <?php
+ $redirect_url = urlencode(Minz_Url::display(
+ array('c' => 'user', 'a' => 'profile'),
+ 'php', true
+ ));
+ ?>
+ <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" />
+ <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" />
+ <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button>
+ </div>
+ </div>
+ </form>
+ <?php } ?>
</div>