Hide registration form if max registration reached

See https://github.com/FreshRSS/FreshRSS/issues/679
pull/914/head
Marien Fressinaud 9 years ago
parent 02c3546440
commit f560c44a00
  1. 3
      app/Controllers/authController.php
  2. 4
      app/views/auth/formLogin.phtml
  3. 4
      app/views/auth/personaLogin.phtml

@ -351,5 +351,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
* This action gives possibility to a user to create an account.
*/
public function registerAction() {
if (max_registrations_reached()) {
Minz_Error::error(403);
}
}
}

@ -1,7 +1,9 @@
<div class="prompt">
<h1><?php echo _t('gen.auth.login'); ?></h1>
<a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.register.ask'); ?></a>
<?php if (!max_registrations_reached()) { ?>
<a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.register.ask'); ?></a>
<?php } ?>
<form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>">
<div>

@ -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.register.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'); ?>

Loading…
Cancel
Save