added check in DB_open for correct DB-version
[e-DoKo.git] / index.php
index 83618f32d856d089b33b1b5bfb306297c8951647..54efdcbf9aef946b72f536a0b39918c8dbc59f84 100644 (file)
--- a/index.php
+++ b/index.php
@@ -36,11 +36,17 @@ include_once("./include/functions.php");   /* the rest */
 config_check();
 
 /* open the database */
 config_check();
 
 /* open the database */
-if(DB_open()<0)
+$DBopen = DB_open();
+if($DBopen<0)
   {
     output_header();
   {
     output_header();
-    echo "Database error, can't connect... Please wait a while and try again. ".
-      "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
+
+    if($DBopen == -1)
+      echo "Database error, can't connect... Please wait a while and try again. ".
+       "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
+    else if ($DBopen == -2)
+      echo "Wrong database version, please update your database using the update.php script.";
+
     output_footer();
     exit();
   }
     output_footer();
     exit();
   }