| | |
| | | public $comm_path = './'; |
| | | |
| | | private $texts; |
| | | private $books = array(); |
| | | |
| | | |
| | | /** |
| | |
| | | $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; |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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]) |
| | |
| | | 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']) |