diff --git a/routes.php b/routes.php index e0e3aa68..ec7e3db7 100644 --- a/routes.php +++ b/routes.php @@ -6,7 +6,6 @@ use Misuzu\Controllers\UserController; return [ Route::get('/', 'index', HomeController::class), - Route::get('/is_ready', 'isReady', HomeController::class), Route::get('/auth/login', 'login', AuthController::class), Route::post('/auth/login', 'login', AuthController::class), diff --git a/src/Application.php b/src/Application.php index e9754967..22858934 100644 --- a/src/Application.php +++ b/src/Application.php @@ -97,7 +97,6 @@ class Application extends ApplicationBase $twig->addFilter('json_decode'); $twig->addFilter('byte_symbol'); - $twig->addFunction('flashii_is_ready'); $twig->addFunction('byte_symbol'); $twig->addFunction('session_id'); $twig->addFunction('config', [$this->config, 'get']); diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index 1ef8337e..961d6a99 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -61,17 +61,24 @@ 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') { - $app = Application::getInstance(); $twig = $app->templating; $twig->vars([ 'has_registrations' => $this->hasRegistrations(), + 'allowed_to_register' => $allowed_to_reg, ]); return $twig->render('auth.register'); } - if (!flashii_is_ready()) { + if (!$allowed_to_reg) { return [ 'error' => "Nice try, but you'll have to wait a little longer. I appreciate your excitement though!" ]; diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php index 6c4afa4b..0031a980 100644 --- a/src/Controllers/HomeController.php +++ b/src/Controllers/HomeController.php @@ -13,9 +13,4 @@ class HomeController extends Controller return $twig->render('home.landing'); } - - public function isReady(): string - { - return flashii_is_ready() ? 'yes' : 'no'; - } } diff --git a/utility.php b/utility.php index c6dcde75..33a3241e 100644 --- a/utility.php +++ b/utility.php @@ -62,12 +62,6 @@ function byte_symbol($bytes, $decimal = false) return sprintf("%.2f %s%sB", $bytes, $symbol, $symbol !== '' && !$decimal ? 'i' : ''); } -function flashii_is_ready() -{ - $ipAddr = \Misuzu\Net\IP::remote(); - return in_array($ipAddr, ['83.85.244.163', '127.0.0.1', '::1']) || time() > 1517443200; -} - function get_country_code(string $ipAddr, string $fallback = 'XX'): string { if (function_exists("geoip_country_code_by_name")) { diff --git a/views/nova/auth/login.twig b/views/nova/auth/login.twig index 8820738c..d8a78f2a 100644 --- a/views/nova/auth/login.twig +++ b/views/nova/auth/login.twig @@ -9,11 +9,7 @@ {% block content %}
You can't create an account yet, but you may log in if you have one already!
- {% endif %} +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!
You'll be able to register once the countdown on the landing page runs out!
+You'll be able to register once the site enter public beta!
So I have to be honest, when the timer runs out you shouldn't expect a fully functional site. A chat, registration, login and a basic session system will most likely be at most in place though. On the positive side of things you get to see the site evolve, so yay!!
-In any case I hope you all will enjoy what I have in store going forward. I've also decided to push launch back to the 1st or February because I'll need the time.
-Lastly I'd like to add that none of the designs are final, most of this I put together ages ago as an eventual redesign for the old site, since then I haven't done much aside from the work in the last month.
+Long story short, almost nothing is ready and going live now (or within the next week) will just lead to greater disappointment. I set up a Twitter again on which I'll eventually inform when the site goes in public beta.
+I offer my sincerest apologies for not being able to live up to the hype I've created (twice, even) but understand that this decision will make for a less rushed end product and less coping with hurried code in the future.