From: Andrew Dolgov Date: Mon, 27 Mar 2006 16:08:51 +0000 (+0100) Subject: provide startup config.php value checking, report at D001 X-Git-Tag: 1.1.5~29 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=657770a09c382b5ca86d147767a72f263c79e1df;p=tt-rss.git provide startup config.php value checking, report at D001 --- 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); ?>