From 751bb4209625e33450601e3098bede0144492d71 Mon Sep 17 00:00:00 2001 From: PlanetCloud <35788716+PlanetTheCloud@users.noreply.github.com> Date: Thu, 13 Jul 2023 23:07:35 +0700 Subject: [PATCH] Fix #36 --- sys-auth/api/signup.php | 4 ++++ sys-auth/app/config_parser.php | 2 +- sys-auth/config/system.php | 3 +++ sys-auth/pages/signup.php | 17 ++++++++++++----- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sys-auth/api/signup.php b/sys-auth/api/signup.php index 5e0474a..56ca189 100644 --- a/sys-auth/api/signup.php +++ b/sys-auth/api/signup.php @@ -64,6 +64,10 @@ } } if ($data['domain_type'] === 'custom') { + if (!config('system.features.signup.use_own_domain', false)) { + throw new ValidationFailedException(__('Signups using custom domains are currently disabled. Please use a free subdomain and try again.'), 'custom_domain'); + } + $data['custom_domain'] = strtolower($data['custom_domain']); if (!preg_match('/^(?:[-A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/', $data['custom_domain'])) { throw new ValidationFailedException(__('The custom domain you provided is invalid. Please enter a valid custom domain and try again.'), 'custom_domain'); diff --git a/sys-auth/app/config_parser.php b/sys-auth/app/config_parser.php index f72dc19..1caa8b6 100644 --- a/sys-auth/app/config_parser.php +++ b/sys-auth/app/config_parser.php @@ -19,7 +19,7 @@ # Handle System Config $system = require SYSTEM . '/config/system.php'; -$required = ['development_mode', 'maintenance_mode', 'maintenance_key', 'lockdown_mode', 'language', 'use_https', 'cpanel_url', 'domain_selection']; +$required = ['installation_url', 'development_mode', 'maintenance_mode', 'maintenance_key', 'lockdown_mode', 'language', 'use_https', 'cpanel_url', 'domain_selection', 'blacklisted_tld', 'default_plan', 'features']; foreach ($required as $key) { if (!isset($system[$key])) { throw new InvalidConfigException("Missing '{$key}' field in 'system' config."); diff --git a/sys-auth/config/system.php b/sys-auth/config/system.php index 92fda88..e22d03d 100644 --- a/sys-auth/config/system.php +++ b/sys-auth/config/system.php @@ -31,6 +31,9 @@ 'login' => [ 'language_selector' => true, 'remember_me' => true, + ], + 'signup' => [ + 'use_own_domain' => false, ] ], ]; diff --git a/sys-auth/pages/signup.php b/sys-auth/pages/signup.php index c8975a3..75a96df 100644 --- a/sys-auth/pages/signup.php +++ b/sys-auth/pages/signup.php @@ -1,3 +1,8 @@ +
@@ -41,15 +46,17 @@
-
+ +
help
- + >
+ -
-