summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-03-27 17:08:51 +0100
committerAndrew Dolgov <[email protected]>2006-03-27 17:08:51 +0100
commit657770a09c382b5ca86d147767a72f263c79e1df (patch)
tree46602344da22ad101f752dc4ea1030ec8918363f
parent24ac67762bd554f6585c6b1b873575828b0ad6ca (diff)
provide startup config.php value checking, report at D001
-rw-r--r--backend.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/backend.php b/backend.php
index d943815c3..916d2b123 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);
?>