alecpl
2010-09-25 e019f2d0f2dc2fbfa345ab5d7ae85e67bfdd76b8
program/include/rcmail.php
@@ -4,8 +4,8 @@
 +-----------------------------------------------------------------------+
 | program/include/rcmail.php                                            |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2008-2010, RoundCube Dev. - Switzerland                 |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2010, Roundcube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
@@ -21,7 +21,7 @@
/**
 * Application class of RoundCube Webmail
 * Application class of Roundcube Webmail
 * implemented as singleton
 *
 * @package Core
@@ -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'])
@@ -1167,7 +1172,7 @@
  }
  /**
   * Build a valid URL to this instance of RoundCube
   * Build a valid URL to this instance of Roundcube
   *
   * @param mixed Either a string with the action or url parameters as key-value pairs
   * @return string Valid application URL