diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index 26253987..dc3dc727 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -77,41 +77,15 @@ class AuthController extends Controller ); } - private function hasRegistrations(?string $ipAddr = null): bool - { - $ipAddr = IP::unpack($ipAddr ?? IP::remote()); - - if ($ipAddr === IP::unpack('127.0.0.1') || $ipAddr === IP::unpack('::1')) { - return false; - } - - if (User::withTrashed()->where('register_ip', $ipAddr)->orWhere('last_ip', $ipAddr)->count()) { - return true; - } - - return false; - } - public function register() { $app = Application::getInstance(); if ($_SERVER['REQUEST_METHOD'] === 'GET') { $twig = $app->templating; - $twig->vars([ - 'has_registrations' => $this->hasRegistrations(), - ]); - return $twig->render('auth.register'); } - if ($this->hasRegistrations()) { - return [ - 'error' => "Someone already used an account from this IP address!\r\n" - . "But don't worry, this is a temporary measure and you'll be able to register sometime soon." - ]; - } - if (!isset($_POST['username'], $_POST['password'], $_POST['email'])) { return ['error' => "You didn't fill all the forms!"]; } diff --git a/views/nova/auth/register.twig b/views/nova/auth/register.twig index 86cbebf9..9325de30 100644 --- a/views/nova/auth/register.twig +++ b/views/nova/auth/register.twig @@ -4,34 +4,24 @@ {% block banner_content %}
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!
+