From 61377e2e7a4c993bdbd5b090919ab5c297acf498 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Wed, 22 Jul 2009 15:45:44 +0000 Subject: [PATCH] Fixed a problem in database replication of multiserver setups. Added a missing language string in server config form. --- install/install.php | 2 +- interface/web/admin/lib/lang/en_server_config.lng | 1 + server/lib/app.inc.php | 5 +++++ server/lib/classes/db_mysql.inc.php | 4 ++-- server/lib/classes/modules.inc.php | 4 +++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/install/install.php b/install/install.php index 4378fd7e0e..15defd64b3 100644 --- a/install/install.php +++ b/install/install.php @@ -358,7 +358,7 @@ if($install_mode == 'standard') { } //** Configure Apache - swriteln("\nHint: If this server shall run the ispconfig interface, select 'y' in the next option.\n"); + swriteln("\nHint: If this server shall run the ispconfig interface, select 'y' in the 'Configure Apache Server' option.\n"); if(strtolower($inst->simple_query('Configure Apache Server',array('y','n'),'y')) == 'y') { $conf['services']['web'] = true; swriteln('Configuring Apache'); diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index 47b2d702db..47937282c9 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -45,4 +45,5 @@ $wb["crontab_dir_txt"] = 'Path for individual crontabs'; $wb["wget_txt"] = 'Path to wget program'; $wb["web_user_txt"] = 'Apache user'; $wb["web_group_txt"] = 'Apache group'; +$wb["security_level"] = 'Security level'; ?> \ No newline at end of file diff --git a/server/lib/app.inc.php b/server/lib/app.inc.php index e0ac82f150..0fe0b8e1cf 100644 --- a/server/lib/app.inc.php +++ b/server/lib/app.inc.php @@ -40,6 +40,11 @@ class app { if($conf["start_db"] == true) { $this->load('db_'.$conf["db_type"]); $this->db = new db; + if($this->db->linkId) $this->db->closeConn(); + $this->db->dbHost = $conf["db_host"]; + $this->db->dbName = $conf["db_database"]; + $this->db->dbUser = $conf["db_user"]; + $this->db->dbPass = $conf["db_password"]; /* Initialize the connection to the master DB, diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index 672de7fbd1..986aa81f7c 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -59,8 +59,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. function updateError($location) { global $app; - $this->errorNumber = mysql_errno(); - $this->errorMessage = mysql_error(); + $this->errorNumber = mysql_errno($this->linkId); + $this->errorMessage = mysql_error($this->linkId); $this->errorLocation = $location; if($this->errorNumber && $this->show_error_messages && method_exists($app,'log')) { diff --git a/server/lib/classes/modules.inc.php b/server/lib/classes/modules.inc.php index e84595fe77..f4bb65ce37 100644 --- a/server/lib/classes/modules.inc.php +++ b/server/lib/classes/modules.inc.php @@ -118,10 +118,12 @@ class modules { //$tmp_sql1 .= "$idx[0]"; //$tmp_sql2 .= "$idx[1]"; $sql = "REPLACE INTO $d[dbtable] ($tmp_sql1) VALUES ($tmp_sql2)"; + $app->db->errorNumber = 0; + $app->db->errorMessage = ''; $app->db->query($sql); if($app->db->errorNumber > 0) { $replication_error = true; - $app->log("Replication failed. Error: (" . $d[dbtable] . ") " . $app->db->errorMessage . " # SQL: " . $sql,LOGLEVEL_ERROR); + $app->log("Replication failed. Error: (" . $d[dbtable] . ") in mysql server: (".$app->db->dbHost.") " . $app->db->errorMessage . " # SQL: " . $sql,LOGLEVEL_ERROR); } $app->log("Replicated from master: ".$sql,LOGLEVEL_DEBUG); } -- GitLab