|
|
@ -123,16 +123,16 @@ class rcube_mdb2
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Already connected
|
|
|
|
// Already connected
|
|
|
|
if ($this->db_connected) {
|
|
|
|
if ($this->db_connected) {
|
|
|
|
|
|
|
|
// connected to read-write db, current connection is ok
|
|
|
|
|
|
|
|
if ($this->db_mode == 'w')
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
// no replication, current connection is ok for read and write
|
|
|
|
// no replication, current connection is ok for read and write
|
|
|
|
if (empty($this->db_dsnr) || $this->db_dsnw == $this->db_dsnr) {
|
|
|
|
if (empty($this->db_dsnr) || $this->db_dsnw == $this->db_dsnr) {
|
|
|
|
$this->db_mode = 'w';
|
|
|
|
$this->db_mode = 'w';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// connected to read-write db, current connection is ok
|
|
|
|
|
|
|
|
if ($this->db_mode == 'w')
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Same mode, current connection is ok
|
|
|
|
// Same mode, current connection is ok
|
|
|
|
if ($this->db_mode == $mode)
|
|
|
|
if ($this->db_mode == $mode)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|