summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-07-23 09:28:58 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-07-23 09:28:58 +0200
commit28dd652228b8e863cddd3d03613c586c01796204 (patch)
treed6d83d44beb2a31095ca301723fe7ab79ee87e37 /app/views
parentfa76e863c5622609b944542b0255c30f2f67c97e (diff)
parent1ad36c420e774d6f66b6a7ecf5b37ed1103ea464 (diff)
Merge pull request #914 from marienfressinaud/679-create-accounts
Add account creation feature. To be tested for 1.1.2-beta
Diffstat (limited to 'app/views')
-rw-r--r--app/views/auth/formLogin.phtml4
-rw-r--r--app/views/auth/personaLogin.phtml4
-rw-r--r--app/views/auth/register.phtml38
-rw-r--r--app/views/auth/reset.phtml2
-rw-r--r--app/views/user/manage.phtml28
-rw-r--r--app/views/user/profile.phtml37
6 files changed, 109 insertions, 4 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml
index 979e17349..b0083944f 100644
--- a/app/views/auth/formLogin.phtml
+++ b/app/views/auth/formLogin.phtml
@@ -1,6 +1,10 @@
<div class="prompt">
<h1><?php echo _t('gen.auth.login'); ?></h1>
+ <?php if (!max_registrations_reached()) { ?>
+ <a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.registration.ask'); ?></a>
+ <?php } ?>
+
<form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>">
<div>
<label for="username"><?php echo _t('gen.auth.username'); ?></label>
diff --git a/app/views/auth/personaLogin.phtml b/app/views/auth/personaLogin.phtml
index 545ed2eac..c6d738bf6 100644
--- a/app/views/auth/personaLogin.phtml
+++ b/app/views/auth/personaLogin.phtml
@@ -2,6 +2,10 @@
<div class="prompt">
<h1><?php echo _t('gen.auth.login'); ?></h1>
+ <?php if (!max_registrations_reached()) { ?>
+ <a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.registration.ask'); ?></a>
+ <?php } ?>
+
<p>
<a class="signin btn btn-important" href="<?php echo _url('auth', 'login'); ?>">
<?php echo _i('login'); ?> <?php echo _t('gen.auth.login_persona'); ?>
diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml
new file mode 100644
index 000000000..306679601
--- /dev/null
+++ b/app/views/auth/register.phtml
@@ -0,0 +1,38 @@
+<div class="prompt">
+ <h1><?php echo _t('gen.auth.registration'); ?></h1>
+
+ <form method="post" action="<?php echo _url('user', 'create'); ?>">
+ <div>
+ <label class="group-name" for="new_user_name"><?php echo _t('gen.auth.username'), '<br />', _i('help'), ' ', _t('gen.auth.username.format'); ?></label>
+ <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" />
+ </div>
+
+ <div>
+ <label class="group-name" for="new_user_passwordPlain"><?php echo _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format'); ?></label>
+ <div class="stick">
+ <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" required="required" autocomplete="off" pattern=".{7,}" />
+ <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a>
+ </div>
+ <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript>
+ </div>
+
+ <div>
+ <label class="group-name" for="new_user_email"><?php echo _t('gen.auth.email'); ?></label>
+ <input type="email" id="new_user_email" name="new_user_email" class="extend" required="required" autocomplete="off" />
+ </div>
+
+ <div>
+ <?php
+ $redirect_url = urlencode(Minz_Url::display(
+ array('c' => 'index', 'a' => 'index'),
+ 'php', true
+ ));
+ ?>
+ <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" />
+ <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button>
+ <a class="btn" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.cancel'); ?></a>
+ </div>
+ </form>
+
+ <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p>
+</div>
diff --git a/app/views/auth/reset.phtml b/app/views/auth/reset.phtml
index 6e9816ad3..9c820c7c8 100644
--- a/app/views/auth/reset.phtml
+++ b/app/views/auth/reset.phtml
@@ -16,7 +16,7 @@
</p>
<div>
- <label for="username"><?php echo _t('gen.auth.username_admin'); ?></label>
+ <label for="username"><?php echo _t('gen.auth.username.admin'); ?></label>
<input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" />
</div>
<div>
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>