Public alpha, why not.
This commit is contained in:
parent
cc0bbb43d8
commit
95ec65d20a
2 changed files with 0 additions and 18 deletions
|
@ -95,28 +95,16 @@ class AuthController extends Controller
|
|||
public function register()
|
||||
{
|
||||
$app = Application::getInstance();
|
||||
$allowed_to_reg = $app->config->get('Testing', 'public_registration', 'bool', false)
|
||||
|| in_array(
|
||||
IP::remote(),
|
||||
explode(' ', $app->config->get('Testing', 'allow_ip_registration', 'string', '127.0.0.1 ::1'))
|
||||
);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$twig = $app->templating;
|
||||
$twig->vars([
|
||||
'has_registrations' => $this->hasRegistrations(),
|
||||
'allowed_to_register' => $allowed_to_reg,
|
||||
]);
|
||||
|
||||
return $twig->render('auth.register');
|
||||
}
|
||||
|
||||
if (!$allowed_to_reg) {
|
||||
return [
|
||||
'error' => "Nice try, but you'll have to wait a little longer. I appreciate your excitement though!"
|
||||
];
|
||||
}
|
||||
|
||||
if ($this->hasRegistrations()) {
|
||||
return [
|
||||
'error' => "Someone already used an account from this IP address!\r\n"
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
<h1 style="align-self: center; text-align: left; flex-grow: 1; padding-left: 2em">
|
||||
{% if has_registrations %}
|
||||
Your IP address already has an account!
|
||||
{% elseif not allowed_to_register %}
|
||||
You'll have to wait a little longer!
|
||||
{% else %}
|
||||
Welcome, thanks for dropping by!
|
||||
{% endif %}
|
||||
|
@ -19,10 +17,6 @@
|
|||
<div class="platform" style="text-align: left;">
|
||||
<p>As a temporary security measure we only allow one account per IP address, this will definitely be changed in the future but for now; sorry for the possible inconvenience!</p>
|
||||
</div>
|
||||
{% elseif not allowed_to_register %}
|
||||
<div class="platform" style="text-align: left;">
|
||||
<p>You'll be able to register once the site enter public beta!</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="platform form" id="auth-form">
|
||||
<div>
|
||||
|
|
Loading…
Add table
Reference in a new issue