File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments