| | |
| | | var $cache_changes = array(); |
| | | var $uid_id_map = array(); |
| | | var $msg_headers = array(); |
| | | var $capabilities = array(); |
| | | var $skip_deleted = FALSE; |
| | | var $search_set = NULL; |
| | | var $search_subject = ''; |
| | |
| | | function __construct($db_conn) |
| | | { |
| | | $this->db = $db_conn; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * PHP 4 object constructor |
| | | * |
| | | * @see rcube_imap::__construct |
| | | */ |
| | | function rcube_imap($db_conn) |
| | | { |
| | | $this->__construct($db_conn); |
| | | } |
| | | |
| | | |
| | |
| | | // get server properties |
| | | if ($this->conn) |
| | | { |
| | | $this->_parse_capability($this->conn->capability); |
| | | |
| | | if (!empty($this->conn->delimiter)) |
| | | $this->delimiter = $this->conn->delimiter; |
| | | if (!empty($this->conn->rootdir)) |
| | |
| | | */ |
| | | function get_capability($cap) |
| | | { |
| | | $cap = strtoupper($cap); |
| | | return $this->capabilities[$cap]; |
| | | return iil_C_GetCapability($this->conn, strtoupper($cap)); |
| | | } |
| | | |
| | | |
| | |
| | | $folders = array_merge($a_defaults, array_keys($folders)); |
| | | |
| | | // finally we must rebuild the list to move |
| | | // subfolders of default folders to their place |
| | | // subfolders of default folders to their place... |
| | | // ...also do this for the rest of folders because |
| | | // asort() is not properly sorting case sensitive names |
| | | while (list($key, $folder) = each($folders)) { |
| | | $a_out[] = $folder; |
| | | unset($folders[$key]); |
| | | if (in_array(strtolower($folder), $this->default_folders_lc)) { |
| | | foreach ($folders as $idx => $f) { |
| | | if (strpos($f, $folder.$delimiter) === 0) { |
| | | $a_out[] = $f; |
| | | unset($folders[$idx]); |
| | | } |
| | | foreach ($folders as $idx => $f) { |
| | | if (strpos($f, $folder.$delimiter) === 0) { |
| | | $a_out[] = $f; |
| | | unset($folders[$idx]); |
| | | } |
| | | reset($folders); |
| | | } |
| | | } |
| | | reset($folders); |
| | | } |
| | | |
| | | return $a_out; |
| | |
| | | } |
| | | |
| | | return $uid; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Parse string or array of server capabilities and put them in internal array |
| | | * @access private |
| | | */ |
| | | function _parse_capability($caps) |
| | | { |
| | | if (!is_array($caps)) |
| | | $cap_arr = explode(' ', $caps); |
| | | else |
| | | $cap_arr = $caps; |
| | | |
| | | foreach ($cap_arr as $cap) |
| | | { |
| | | if ($cap=='CAPABILITY') |
| | | continue; |
| | | |
| | | if (strpos($cap, '=')>0) |
| | | { |
| | | list($key, $value) = explode('=', $cap); |
| | | if (!is_array($this->capabilities[$key])) |
| | | $this->capabilities[$key] = array(); |
| | | |
| | | $this->capabilities[$key][] = $value; |
| | | } |
| | | else |
| | | $this->capabilities[$cap] = TRUE; |
| | | } |
| | | } |
| | | |
| | | |