From 116cdcd74587d34954b5a2ceeda3f93001e963ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Thu, 13 Mar 2025 12:25:59 +0100 Subject: [PATCH] CMXX - Multisite config --- .gitignore | 4 +-- login.php | 4 ++- settings.php | 8 +++-- settings/config_redirector.php | 31 +++++++++++++++++++ settings/veliti/config.php | 55 ---------------------------------- 5 files changed, 42 insertions(+), 60 deletions(-) create mode 100644 settings/config_redirector.php delete mode 100644 settings/veliti/config.php diff --git a/.gitignore b/.gitignore index 683cde9..ee3f642 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ marketing/ firmware/ log/ assets/images/products/ -settings/config_redirector.php +settings/config.php settings/settings.php variable_scan.php -settings/veliti/config_redirector.php settings/veliti/settings.php +settings/veliti/veliti_config.php diff --git a/login.php b/login.php index 22dc620..8c3ec71 100644 --- a/login.php +++ b/login.php @@ -1,4 +1,6 @@ -= 3) { + // Return the second-to-last and third-to-last parts + return $parts[$count - 2]; + } + // For hostnames with just domain and TLD (2 parts) + else if ($count == 2) { + // Return just the domain part (without the TLD) + return $parts[0]; + } + // If it's a single part hostname + else { + return $hostname; + } +} + +$domain = getDomain($_SERVER['SERVER_NAME']); +$config_location = ((file_exists(dirname(__FILE__).'/'.$domain.'/'.$domain.'_config.php')) ? dirname(__FILE__).'/'.$domain.'/'.$domain.'_config.php' : dirname(__FILE__).'/config.php'); + +include $config_location; +?> \ No newline at end of file diff --git a/settings/veliti/config.php b/settings/veliti/config.php deleted file mode 100644 index 55e0b74..0000000 --- a/settings/veliti/config.php +++ /dev/null @@ -1,55 +0,0 @@ -