tbrehm
2009-07-22 61377e2e7a4c993bdbd5b090919ab5c297acf498
Fixed a problem in database replication of multiserver setups.
Added a missing language string in server config form.
5 files modified
16 ■■■■ changed files
install/install.php 2 ●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_config.lng 1 ●●●● patch | view | raw | blame | history
server/lib/app.inc.php 5 ●●●●● patch | view | raw | blame | history
server/lib/classes/db_mysql.inc.php 4 ●●●● patch | view | raw | blame | history
server/lib/classes/modules.inc.php 4 ●●● patch | view | raw | blame | history
install/install.php
@@ -358,7 +358,7 @@
    }
    
    //** 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');
interface/web/admin/lib/lang/en_server_config.lng
@@ -45,4 +45,5 @@
$wb["wget_txt"] = 'Path to wget program';
$wb["web_user_txt"] = 'Apache user';
$wb["web_group_txt"] = 'Apache group';
$wb["security_level"] = 'Security level';
?>
server/lib/app.inc.php
@@ -40,6 +40,11 @@
                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, 
server/lib/classes/db_mysql.inc.php
@@ -59,8 +59,8 @@
        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'))
            {
server/lib/classes/modules.inc.php
@@ -118,10 +118,12 @@
                        //$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);
                    }