Commit 5cff6bc5 authored by tbrehm's avatar tbrehm
Browse files

- Better fix for update problem from old versions.

parent f9318304
......@@ -80,7 +80,7 @@ unset($conf);
if($dist['id'] == '') die('Linux distribution or version not recognized.');
//** Check version
if(compare_ispconfig_version('3.0.3',ISPC_APP_VERSION) < 0) die("This updater is for ISPConfig versions > 3.0.3.0. Please Update to ISPConfig 3.0.3.3 first before you update to the current ISPConfig version.\n");
// if(compare_ispconfig_version('3.0.3',ISPC_APP_VERSION) < 0) die("This updater is for ISPConfig versions > 3.0.3.0. Please Update to ISPConfig 3.0.3.3 first before you update to the current ISPConfig version.\n");
//** Include the distribution-specific installer class library and configuration
......@@ -160,7 +160,7 @@ prepareDBDump();
//* initialize the database
$inst->db = new db();
$inst->db->dbName = $conf["mysql"]["database"];
// $inst->db->dbName = $conf["mysql"]["database"];
/*
* The next line is a bit tricky!
......
......@@ -231,7 +231,7 @@ function updateDbAndIni() {
//** Update server ini
$tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
$tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
$old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config']));
unset($tmp_server_rec);
$tpl_ini_array = ini_to_array(rf('tpl/server.ini.master'));
......@@ -286,7 +286,7 @@ function updateDbAndIni() {
}
$new_ini = array_to_ini($tpl_ini_array);
$sql = "UPDATE server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id'];
$sql = "UPDATE ".$conf["mysql"]["database"].".server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id'];
$inst->db->query($sql);
unset($old_ini_array);
unset($tpl_ini_array);
......@@ -294,7 +294,7 @@ function updateDbAndIni() {
//** Update system ini
$tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM sys_ini WHERE sysini_id = 1");
$tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM ".$conf["mysql"]["database"].".sys_ini WHERE sysini_id = 1");
$old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config']));
unset($tmp_server_rec);
$tpl_ini_array = ini_to_array(rf('tpl/system.ini.master'));
......@@ -309,11 +309,11 @@ function updateDbAndIni() {
}
$new_ini = array_to_ini($tpl_ini_array);
$tmp = $inst->db->queryOneRecord('SELECT count(sysini_id) as number FROM sys_ini WHERE 1');
$tmp = $inst->db->queryOneRecord('SELECT count(sysini_id) as number FROM '.$conf["mysql"]["database"].'.sys_ini WHERE 1');
if($tmp['number'] == 0) {
$inst->db->query("INSERT INTO sys_ini (sysini_id, config) VALUES (1,'".mysql_real_escape_string($new_ini)."')");
$inst->db->query("INSERT INTO ".$conf["mysql"]["database"].".sys_ini (sysini_id, config) VALUES (1,'".mysql_real_escape_string($new_ini)."')");
} else {
$inst->db->query("UPDATE sys_ini SET config = '".mysql_real_escape_string($new_ini)."' WHERE sysini_id = 1");
$inst->db->query("UPDATE ".$conf["mysql"]["database"].".sys_ini SET config = '".mysql_real_escape_string($new_ini)."' WHERE sysini_id = 1");
}
unset($old_ini_array);
unset($tpl_ini_array);
......
......@@ -79,7 +79,7 @@ unset($conf);
if($dist['id'] == '') die('Linux distribution or version not recognized.');
//** Check version
if(compare_ispconfig_version('3.0.3',ISPC_APP_VERSION) < 0) die("This updater is for ISPConfig versions > 3.0.3.0. Please Update to ISPConfig 3.0.3.3 first before you update to the current ISPConfig version.\n");
// if(compare_ispconfig_version('3.0.3',ISPC_APP_VERSION) < 0) die("This updater is for ISPConfig versions > 3.0.3.0. Please Update to ISPConfig 3.0.3.3 first before you update to the current ISPConfig version.\n");
//** Include the distribution-specific installer class library and configuration
if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php');
......@@ -155,7 +155,7 @@ prepareDBDump();
//* initialize the database
$inst->db = new db();
$inst->db->dbName = $conf["mysql"]["database"];
// $inst->db->dbName = $conf["mysql"]["database"];
//* initialize the master DB, if we have a multiserver setup
if($conf['mysql']['master_slave_setup'] == 'y') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment