X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=backend.php;h=916d2b123dc781cbb9c6b92534a5cd10f7655450;hb=657770a09c382b5ca86d147767a72f263c79e1df;hp=d943815c3b9b8d2cc1b4aa165ecebc17edfdd914;hpb=24ac67762bd554f6585c6b1b873575828b0ad6ca;p=tt-rss.git 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); ?>