]> git.wh0rd.org - tt-rss.git/commitdiff
provide startup config.php value checking, report at D001
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 27 Mar 2006 16:08:51 +0000 (17:08 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 27 Mar 2006 16:08:51 +0000 (17:08 +0100)
backend.php

index d943815c3b9b8d2cc1b4aa165ecebc17edfdd914..916d2b123dc781cbb9c6b92534a5cd10f7655450 100644 (file)
 
        $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");
        }
                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";
 
        }
 
+       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);
 ?>