Skip to content

Commit c167f3c

Browse files
committed
Fixed a bug in updater that caused the updater to fail on multiserver setups.
1 parent 8baeb12 commit c167f3c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

install/update.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,24 @@
153153
//* initialize the database
154154
$inst->db = new db();
155155

156+
//* initialize the master DB, if we have a multiserver setup
157+
if($conf['mysql']['master_slave_setup'] == 'y') {
158+
$inst->dbmaster = new db();
159+
if($inst->dbmaster->linkId) $inst->dbmaster->closeConn();
160+
$inst->dbmaster->dbHost = $conf['mysql']["master_host"];
161+
$inst->dbmaster->dbName = $conf['mysql']["master_database"];
162+
$inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"];
163+
$inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"];
164+
} else {
165+
$inst->dbmaster = $inst->db;
166+
}
167+
156168
//* Update $conf array with values from the server.ini that shall be preserved
157169
$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
158170
$ini_array = ini_to_array(stripslashes($tmp['config']));
159171

172+
if(count($ini_array) == 0) die('Unable to read server configuration from database.');
173+
160174
$conf['services']['mail'] = ($tmp['mail_server'] == 1)?true:false;
161175
$conf['services']['web'] = ($tmp['web_server'] == 1)?true:false;
162176
$conf['services']['dns'] = ($tmp['dns_server'] == 1)?true:false;

0 commit comments

Comments
 (0)