diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-17 09:16:47 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-12-17 09:16:47 +0000 |
| commit | 55c4445b68c83a5ce0fd116c6bba70f0f3e56171 (patch) | |
| tree | c5b0deec77d7a26977d35288bbd63024c2a3b649 /roundcubemail/program | |
| parent | 2c7a73f16b145839cb8eaab5f8ab641069f1fce6 (diff) | |
- Make possible to overwrite server's namespaces with imap_ns_* options
git-svn-id: https://svn.roundcube.net/trunk@4344 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 5aa23fa73..5715459a8 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -546,56 +546,56 @@ class rcube_imap $imap_shared = $config->get('imap_ns_shared'); $imap_delimiter = $config->get('imap_delimiter'); - if ($imap_delimiter) { - $this->delimiter = $imap_delimiter; - } - if (!$this->conn) return; $ns = $this->conn->getNamespace(); - // NAMESPACE supported + // Set namespaces (NAMESPACE supported) if (is_array($ns)) { $this->namespace = $ns; - - if (empty($this->delimiter)) - $this->delimiter = $ns['personal'][0][1]; - if (empty($this->delimiter)) - $this->delimiter = $this->conn->getHierarchyDelimiter(); - if (empty($this->delimiter)) - $this->delimiter = '/'; } - // not supported, get namespace from config - else if ($imap_personal !== null || $imap_shared !== null || $imap_other !== null) { - if (empty($this->delimiter)) - $this->delimiter = $this->conn->getHierarchyDelimiter(); - if (empty($this->delimiter)) - $this->delimiter = '/'; - + else { $this->namespace = array( 'personal' => NULL, 'other' => NULL, 'shared' => NULL, ); + } - if ($imap_personal !== null) { - foreach ((array)$imap_personal as $dir) { - $this->namespace['personal'][] = array($dir, $this->delimiter); - } + if ($imap_delimiter) { + $this->delimiter = $imap_delimiter; + } + if (empty($this->delimiter)) { + $this->delimiter = $this->namespace['personal'][0][1]; + } + if (empty($this->delimiter)) { + $this->delimiter = $this->conn->getHierarchyDelimiter(); + } + if (empty($this->delimiter)) { + $this->delimiter = '/'; + } + + // Overwrite namespaces + if ($imap_personal !== null) { + $this->namespace['personal'] = NULL; + foreach ((array)$imap_personal as $dir) { + $this->namespace['personal'][] = array($dir, $this->delimiter); } - if ($imap_other !== null) { - foreach ((array)$imap_other as $dir) { - if ($dir) { - $this->namespace['other'][] = array($dir, $this->delimiter); - } + } + if ($imap_other !== null) { + $this->namespace['other'] = NULL; + foreach ((array)$imap_other as $dir) { + if ($dir) { + $this->namespace['other'][] = array($dir, $this->delimiter); } } - if ($imap_shared !== null) { - foreach ((array)$imap_shared as $dir) { - if ($dir) { - $this->namespace['shared'][] = array($dir, $this->delimiter); - } + } + if ($imap_shared !== null) { + $this->namespace['shared'] = NULL; + foreach ((array)$imap_shared as $dir) { + if ($dir) { + $this->namespace['shared'][] = array($dir, $this->delimiter); } } } |
