diff --git a/common.inc.php b/common.inc.php
index 64883147..7b38cdfa 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -65,6 +65,30 @@ else
exit;
}
+//first things first - make sure our DB version matches our CODE version
+$dbcodeversion=@file("db/db.code.version.txt");
+$dbdbversion=@file("db/db.db.version.txt");
+if($dbcodeversion[0]!=$dbdbversion[0])
+{
+ echo "
SFIAB ERROR";
+ echo "Science Fair In A Box - ERROR
";
+ echo "SFIAB database and code are mismatched";
+ echo "
";
+ echo "Please run the db_update.php script in order to update";
+ echo "
";
+ echo "your database to the same version as the code";
+ echo "
";
+ echo "
";
+ echo "
";
+ echo "Details
";
+ echo "Current SFIAB codebase requires DB version: ".$dbcodeversion[0];
+ echo "
";
+ echo "Current SFIAB database is detected as version: ".$dbdbversion[0];
+ echo "
";
+ echo "";
+ exit;
+}
+
if(!mysql_connect($DBHOST,$DBUSER,$DBPASS))
{
echo "SFIAB ERROR";
@@ -104,39 +128,8 @@ while($r=mysql_fetch_object($q))
$config['dates'][$r->name]=$r->date;
}
-
-
-
-
-//first things first - make sure our DB version matches our CODE version
-$dbcodeversion=@file("db/db.code.version.txt");
-$dbdbversion=@file("db/db.db.version.txt");
-if($dbcodeversion[0]!=$dbdbversion[0])
-{
- echo "SFIAB ERROR";
- echo "Science Fair In A Box - ERROR
";
- echo "SFIAB database and code are mismatched";
- echo "
";
- echo "Please run the db_update.php script in order to update";
- echo "
";
- echo "your database to the same version as the code";
- echo "
";
- echo "
";
- echo "
";
- echo "Details
";
- echo "Current SFIAB codebase requires DB version: ".$dbcodeversion[0];
- echo "
";
- echo "Current SFIAB database is detected as version: ".$dbdbversion[0];
- echo "
";
- echo "";
- exit;
-}
-
-
require_once("committee_auth.php");
-
-
session_start();
//detect the browser first, so we know what icons to use - we store this in the config array as well