| | |
| | | true, true); |
| | | } |
| | | |
| | | // set configured sort order |
| | | if ($sort_col = $this->config->get('addressbook_sort_col')) |
| | | $contacts->set_sort_order($sort_col); |
| | | |
| | | // add to the 'books' array for shutdown function |
| | | if (!isset($this->address_books[$id])) |
| | | $this->address_books[$id] = $contacts; |
| | | $this->address_books[$id] = $contacts; |
| | | |
| | | return $contacts; |
| | | } |
| | |
| | | return; |
| | | |
| | | $this->imap = new rcube_imap(); |
| | | $this->imap->debug_level = $this->config->get('debug_level'); |
| | | $this->imap->skip_deleted = $this->config->get('skip_deleted'); |
| | | |
| | | // enable caching of imap data |
| | |
| | | if (session_id()) |
| | | return; |
| | | |
| | | $sess_name = $this->config->get('session_name'); |
| | | $sess_domain = $this->config->get('session_domain'); |
| | | $lifetime = $this->config->get('session_lifetime', 0) * 60; |
| | | |
| | | // set session domain |
| | | if ($domain = $this->config->get('session_domain')) { |
| | | ini_set('session.cookie_domain', $domain); |
| | | if ($sess_domain) { |
| | | ini_set('session.cookie_domain', $sess_domain); |
| | | } |
| | | // set session garbage collecting time according to session_lifetime |
| | | $lifetime = $this->config->get('session_lifetime', 0) * 60; |
| | | if ($lifetime) { |
| | | ini_set('session.gc_maxlifetime', $lifetime * 2); |
| | | } |
| | | |
| | | ini_set('session.cookie_secure', rcube_https_check()); |
| | | ini_set('session.name', 'roundcube_sessid'); |
| | | ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid'); |
| | | ini_set('session.use_cookies', 1); |
| | | ini_set('session.use_only_cookies', 1); |
| | | ini_set('session.serialize_handler', 'php'); |
| | |
| | | $this->session = new rcube_session($this->get_dbh(), $this->config); |
| | | |
| | | $this->session->register_gc_handler('rcmail_temp_gc'); |
| | | if ($this->config->get('enable_caching')) |
| | | $this->session->register_gc_handler('rcmail_cache_gc'); |
| | | $this->session->register_gc_handler('rcmail_cache_gc'); |
| | | |
| | | // start PHP session (if not in CLI mode) |
| | | if ($_SERVER['REMOTE_ADDR']) |
| | |
| | | |
| | | // before closing the database connection, write session data |
| | | if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) { |
| | | $this->session->cleanup(); |
| | | session_write_close(); |
| | | } |
| | | |