fix: user registration disabled

This commit is contained in:
Niklas Bittner 2024-02-25 22:35:54 +01:00 committed by Jay Trees
parent 5104f0205b
commit 212c4754ee

View file

@ -115,9 +115,18 @@ if (isset($_POST['email'], $_POST['password']) && !empty($_POST['planet'])) {
$locale_user = $locale_browser; $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 * Register
*/ */
if (0 === count($users)) { if (0 === count($users)) {
$database->query( $database->query(
'INSERT INTO `users` ( 'INSERT INTO `users` (