thomascube
2010-09-21 cb2bc809ef29f349d38c89e202d821e67bb4c947
program/include/rcmail.php
@@ -45,6 +45,7 @@
  public $comm_path = './';
  private $texts;
  private $books = array();
  /**
@@ -235,7 +236,6 @@
      $this->db = new rcube_mdb2($config_all['db_dsnw'], $config_all['db_dsnr'], $config_all['db_persistent']);
      $this->db->sqlite_initials = INSTALL_PATH . 'SQL/sqlite.initial.sql';
      $this->db->set_debug((bool)$config_all['sql_debug']);
      $this->db->db_connect('w');
    }
    return $this->db;
@@ -279,6 +279,10 @@
    else { // $id == 'sql'
      $contacts = new rcube_contacts($this->db, $this->user->ID);
    }
    // add to the 'books' array for shutdown function
    if (!in_array($contacts, $this->books))
      $this->books[] = $contacts;
    return $contacts;
  }
@@ -974,8 +978,9 @@
    if (is_object($this->smtp))
      $this->smtp->disconnect();
    if (is_object($this->contacts))
      $this->contacts->close();
    foreach ($this->books as $book)
      if (is_object($book))
        $book->close();
    // before closing the database connection, write session data
    if ($_SERVER['REMOTE_ADDR'])