]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Exempt test_connection.php from requiring config as well - this adds page_requires_no...
authorBram Matthys <redacted>
Sun, 16 Apr 2023 12:51:20 +0000 (14:51 +0200)
committerBram Matthys <redacted>
Sun, 16 Apr 2023 12:51:20 +0000 (14:51 +0200)
common.php

index e4844b682cfefd9aa6f679ec3f8ee4edb3b07b8d..dced580029e74dfc5f15b0b7b1eceeac19acedd1 100644 (file)
@@ -24,6 +24,17 @@ function get_config($setting)
        return $item;
 }
 
+function page_requires_no_config()
+{
+       if (str_ends_with($_SERVER['SCRIPT_FILENAME'],"install.php") ||
+           str_ends_with($_SERVER['SCRIPT_FILENAME'],"test_connection.php"))
+       {
+               return TRUE;
+       }
+       return FALSE;
+}
+
+
 /* Load config defaults */
 $config = Array();
 require_once UPATH . "/config/config.defaults.php";
@@ -33,7 +44,7 @@ if (!file_exists(UPATH."/config/config.php") && file_exists(UPATH."/config.php")
        require_once UPATH . "/config.php";
        require_once UPATH . "/config/compat.php";
 } else
-if (str_ends_with($_SERVER['SCRIPT_FILENAME'],"install.php"))
+if (page_requires_no_config())
 {
        /* Allow empty conf */
 } else