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;
  }
@@ -810,9 +814,9 @@
    if (($attrib['uppercase'] && strtolower($attrib['uppercase']=='first')) || $attrib['ucfirst'])
      return ucfirst($text);
    else if ($attrib['uppercase'])
      return strtoupper($text);
      return mb_strtoupper($text);
    else if ($attrib['lowercase'])
      return strtolower($text);
      return mb_strtolower($text);
    return $text;
  }
@@ -874,7 +878,7 @@
      if ($dh = @opendir(INSTALL_PATH . 'program/localization')) {
        while (($name = readdir($dh)) !== false) {
          if ($name{0}=='.' || !is_dir(INSTALL_PATH . 'program/localization/' . $name))
          if ($name[0] == '.' || !is_dir(INSTALL_PATH . 'program/localization/' . $name))
            continue;
          if ($label = $rcube_languages[$name])
@@ -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'])