From 212c4754eeae656b6583b086f866b9718af79dc2 Mon Sep 17 00:00:00 2001 From: Niklas Bittner Date: Sun, 25 Feb 2024 22:35:54 +0100 Subject: [PATCH] fix: user registration disabled --- src/pages/register.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/register.php b/src/pages/register.php index a807a09b..e2beafd2 100644 --- a/src/pages/register.php +++ b/src/pages/register.php @@ -115,9 +115,18 @@ if (isset($_POST['email'], $_POST['password']) && !empty($_POST['planet'])) { $locale_user = $locale_browser; } + if(defined('DISABLE_USER_REGISTRATION') && true === DISABLE_USER_REGISTRATION) { + \http_response_code(403); + + die(__('The owner of this site has disabled user registrations.')); + + return; + } + /** * Register */ + if (0 === count($users)) { $database->query( 'INSERT INTO `users` (