From 657770a09c382b5ca86d147767a72f263c79e1df Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 27 Mar 2006 17:08:51 +0100 Subject: [PATCH] provide startup config.php value checking, report at D001 --- backend.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/backend.php b/backend.php index d943815c..916d2b12 100644 --- a/backend.php +++ b/backend.php @@ -15,6 +15,18 @@ $op = $_REQUEST["op"]; + define('SCHEMA_VERSION', 7); + + require_once "sanity_check.php"; + require_once "config.php"; + + $err_msg = check_configuration_variables(); + + if ($err_msg) { + print "Fatal error: $err_msg"; + exit; + } + if ((!$op || $op == "rpc" || $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) { header("Content-Type: application/xml"); } @@ -45,10 +57,6 @@ exit; } - define('SCHEMA_VERSION', 7); - - require_once "sanity_check.php"; - require_once "config.php"; require_once "db.php"; require_once "db-prefs.php"; require_once "functions.php"; @@ -4099,6 +4107,18 @@ } + function check_configuration_variables() { + if (!defined('SESSION_EXPIRE_TIME')) { + return "SESSION_EXPIRE_TIME is undefined"; + } + + if (SESSION_EXPIRE_TIME < 60) { + return "SESSION_EXPIRE_TIME is too low (less than 60)"; + } + + return false; + } + db_close($link); ?> -- 2.39.5