commit 7e791d587e3d6d23354201768a4f1d3b400fcfe9
parent b5947c31d260c51a906c4084d72ee6bd7fa4803f
Author: Jan Dankert <devnull@localhost>
Date: Sat, 29 Aug 2015 03:06:36 +0200
Neu: DB-Einstellung 'auto_update' für automatisches Update.
Diffstat:
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/action/LoginAction.class.php b/action/LoginAction.class.php
@@ -819,11 +819,12 @@ class LoginAction extends Action
$db = new DB( $conf['database'][$dbid],true );
$db->id = $dbid;
-
- // Datenbank aktualisieren, sofern notwendig.
- require_once( OR_DBCLASSES_DIR.'DbUpdate.class.'.PHP_EXT );
+
+ // Datenbank aktualisieren, sofern notwendig.
+ require_once( OR_DBCLASSES_DIR.'DbUpdate.class.'.PHP_EXT );
$updater = new DbUpdate();
$updater->update( $db );
+
unset($db);
}
diff --git a/db/DbUpdate.class.php b/db/DbUpdate.class.php
@@ -16,6 +16,9 @@ class DbUpdate
// Oh oh, in der Datenbank ist eine neue Version, also wir unterstüzten.
Http::serverError('Actual DB version is not supported.',"DB-Version is $version, but this is OpenRat ".OR_VERSION." which only supports version ".OR_DB_SUPPORTED_VERSION );
+ if ( ! $db->conf['auto_update'])
+ Http::serverError('DB Update necessary.',"DB-Version is $version, but this is OpenRat ".OR_VERSION." which needs the version ".OR_DB_SUPPORTED_VERSION );
+
require(OR_DBCLASSES_DIR.'DbVersion.class.php');
for( $installVersion = $version + 1; $installVersion <= OR_DB_SUPPORTED_VERSION; $installVersion++ )
diff --git a/db/db.class.php b/db/db.class.php
@@ -102,7 +102,8 @@ class DB
'cmd' => '',
'prepare' => true,
'transaction' => true,
- 'update' => array()
+ 'update' => array(),
+ 'auto_update' => true
);
$this->available = false;