Skip to content

Commit 61377e2

Browse files
committed
Fixed a problem in database replication of multiserver setups.
Added a missing language string in server config form.
1 parent b2b44b5 commit 61377e2

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

install/install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
}
359359

360360
//** Configure Apache
361-
swriteln("\nHint: If this server shall run the ispconfig interface, select 'y' in the next option.\n");
361+
swriteln("\nHint: If this server shall run the ispconfig interface, select 'y' in the 'Configure Apache Server' option.\n");
362362
if(strtolower($inst->simple_query('Configure Apache Server',array('y','n'),'y')) == 'y') {
363363
$conf['services']['web'] = true;
364364
swriteln('Configuring Apache');

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ $wb["crontab_dir_txt"] = 'Path for individual crontabs';
4545
$wb["wget_txt"] = 'Path to wget program';
4646
$wb["web_user_txt"] = 'Apache user';
4747
$wb["web_group_txt"] = 'Apache group';
48+
$wb["security_level"] = 'Security level';
4849
?>

server/lib/app.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ function app() {
4040
if($conf["start_db"] == true) {
4141
$this->load('db_'.$conf["db_type"]);
4242
$this->db = new db;
43+
if($this->db->linkId) $this->db->closeConn();
44+
$this->db->dbHost = $conf["db_host"];
45+
$this->db->dbName = $conf["db_database"];
46+
$this->db->dbUser = $conf["db_user"];
47+
$this->db->dbPass = $conf["db_password"];
4348

4449
/*
4550
Initialize the connection to the master DB,

server/lib/classes/db_mysql.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function db()
5959
function updateError($location)
6060
{
6161
global $app;
62-
$this->errorNumber = mysql_errno();
63-
$this->errorMessage = mysql_error();
62+
$this->errorNumber = mysql_errno($this->linkId);
63+
$this->errorMessage = mysql_error($this->linkId);
6464
$this->errorLocation = $location;
6565
if($this->errorNumber && $this->show_error_messages && method_exists($app,'log'))
6666
{

server/lib/classes/modules.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ function processDatalog() {
118118
//$tmp_sql1 .= "$idx[0]";
119119
//$tmp_sql2 .= "$idx[1]";
120120
$sql = "REPLACE INTO $d[dbtable] ($tmp_sql1) VALUES ($tmp_sql2)";
121+
$app->db->errorNumber = 0;
122+
$app->db->errorMessage = '';
121123
$app->db->query($sql);
122124
if($app->db->errorNumber > 0) {
123125
$replication_error = true;
124-
$app->log("Replication failed. Error: (" . $d[dbtable] . ") " . $app->db->errorMessage . " # SQL: " . $sql,LOGLEVEL_ERROR);
126+
$app->log("Replication failed. Error: (" . $d[dbtable] . ") in mysql server: (".$app->db->dbHost.") " . $app->db->errorMessage . " # SQL: " . $sql,LOGLEVEL_ERROR);
125127
}
126128
$app->log("Replicated from master: ".$sql,LOGLEVEL_DEBUG);
127129
}

0 commit comments

Comments
 (0)