Commit fb15d610 authored by tbrehm's avatar tbrehm

- Undone a change in modules.inc.php

- Chnegd installer to allow access from the slave hostname and IP address to the master database.
parent 47f35337
......@@ -227,19 +227,25 @@ class installer_base {
//* insert the ispconfig user in the remote server
$from_host = $conf['hostname'];
$from_ip = gethostbyname($conf['hostname']);
//* username for the ispconfig user
$conf['mysql']['master_ispconfig_user'] = 'ispconfigserver'.$conf['server_id'];
//* Delete ISPConfig user in the local database, in case that it exists
//* Delete ISPConfig user in the master database, in case that it exists
$this->dbmaster->query("DELETE FROM mysql.user WHERE User = '".$conf['mysql']['master_ispconfig_user']."' AND Host = '".$from_host."';");
$this->dbmaster->query("DELETE FROM mysql.db WHERE Db = '".$conf['mysql']['master_database']."' AND Host = '".$from_host."';");
$this->dbmaster->query("DELETE FROM mysql.user WHERE User = '".$conf['mysql']['master_ispconfig_user']."' AND Host = '".$from_ip."';");
$this->dbmaster->query("DELETE FROM mysql.db WHERE Db = '".$conf['mysql']['master_database']."' AND Host = '".$from_ip."';");
$this->dbmaster->query('FLUSH PRIVILEGES;');
//* Create the ISPConfig database user in the local database
$query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$conf['mysql']['master_database'].".* "
."TO '".$conf['mysql']['master_ispconfig_user']."'@'".$from_host."' "
."IDENTIFIED BY '".$conf['mysql']['master_ispconfig_password']."';";
$query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$conf['mysql']['master_database'].".* "
."TO '".$conf['mysql']['master_ispconfig_user']."'@'".$from_ip."' "
."IDENTIFIED BY '".$conf['mysql']['master_ispconfig_password']."';";
if(!$this->dbmaster->query($query)) {
$this->error('Unable to create database user in master database: '.$conf['mysql']['master_ispconfig_user'].' Error: '.$this->dbmaster->errorMessage);
}
......
......@@ -88,7 +88,7 @@ class modules {
$records = $app->dbmaster->queryAllRecords($sql);
foreach($records as $d) {
$data = unserialize($d["data"]);
$data = unserialize(stripslashes($d["data"]));
$replication_error = false;
$this->current_datalog_id = $d["datalog_id"];
......@@ -164,7 +164,7 @@ class modules {
$sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 0) ORDER BY datalog_id";
$records = $app->db->queryAllRecords($sql);
foreach($records as $d) {
$data = unserialize($d["data"]);
$data = unserialize(stripslashes($d["data"]));
$this->current_datalog_id = $d["datalog_id"];
$this->raiseTableHook($d["dbtable"],$d["action"],$data);
//$app->db->query("DELETE FROM sys_datalog WHERE datalog_id = ".$rec["datalog_id"]);
......
Markdown is supported
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