projects
/
e-DoKo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added check in DB_open for correct DB-version
[e-DoKo.git]
/
include
/
db.php
diff --git
a/include/db.php
b/include/db.php
index b79da87def6d231ccbc39507619e21a049cc8e09..5503a4a160e2ea9baf83eb8bbc245f5a0b159437 100644
(file)
--- a/
include/db.php
+++ b/
include/db.php
@@
-30,17
+30,24
@@
if(!isset($HOST))
function DB_open()
{
function DB_open()
{
+ $version_needed = 1;
+
global $DB,$DB_user,$DB_host,$DB_database,$DB_password;
$DB = @mysql_connect($DB_host,$DB_user, $DB_password);
if ( $DB )
{
global $DB,$DB_user,$DB_host,$DB_database,$DB_password;
$DB = @mysql_connect($DB_host,$DB_user, $DB_password);
if ( $DB )
{
- mysql_select_db($DB_database) or die('Could not select database');
+ mysql_select_db($DB_database) or die('
Error:
Could not select database');
}
else
{
echo mysql_errno() . ": " . mysql_error(). "\n";
return -1;
}
else
{
echo mysql_errno() . ": " . mysql_error(). "\n";
return -1;
- }
+ };
+
+ $version = DB_get_version();
+ if ($version != $version_needed)
+ return -2;
+
return 0;
}
return 0;
}