Changeset 4581 for branches/2.2
- Timestamp:
- 06/02/11 17:47:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
r4575 r4581 1760 1760 } 1761 1761 1762 $inbox = 'INBOX';1763 $trash = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'];1762 $inbox = 'INBOX'; 1763 $trash = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; 1764 1764 $drafts = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']; 1765 $spam = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'];1766 $sent = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'];1765 $spam = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']; 1766 $sent = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']; 1767 1767 $uid2cn = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']; 1768 1768 // Free others requests … … 1782 1782 $resultDefault = array(); 1783 1783 1784 if (is_array($folders_list)) { 1784 if ( is_array($folders_list) ) 1785 { 1785 1786 reset($folders_list); 1786 1787 $this->ldap = new ldap_functions(); 1787 1788 1788 1789 $i = 0; 1789 while (list($key, $val) = each($folders_list)) { 1790 $status = imap_status($mbox_stream, $val->name, SA_UNSEEN); 1791 1792 //$tmp_folder_id = explode("}", imap_utf7_decode($val->name)); 1793 $tmp_folder_id = explode("}", mb_convert_encoding($val->name, "ISO_8859-1", "UTF7-IMAP" )); 1794 1795 if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') { 1796 //error_log('passou', 3,'/tmp/imap_get_list.log'); 1797 //imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas')); 1798 continue; 1799 } 1800 $result[$i]['folder_unseen'] = $status->unseen; 1801 $folder_id = $tmp_folder_id[1]; 1802 $result[$i]['folder_id'] = $folder_id; 1803 1804 $tmp_folder_parent = explode($this->imap_delimiter, $folder_id); 1805 $result[$i]['folder_name'] = array_pop($tmp_folder_parent); 1806 $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name']; 1807 1808 if ($uid2cn && substr($folder_id,0,4) == 'user') { 1809 //$this->ldap = new ldap_functions(); 1810 if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])) { 1811 $result[$i]['folder_name'] = $cn; 1812 } 1813 } 1814 1815 $tmp_folder_parent = implode($this->imap_delimiter, $tmp_folder_parent); 1816 $result[$i]['folder_parent'] = $tmp_folder_parent == 'INBOX' ? '' : $tmp_folder_parent; 1817 1818 if (($val->attributes == 32) && ($result[$i]['folder_name'] != 'Inbox')) 1819 $result[$i]['folder_hasChildren'] = 1; 1820 else 1821 $result[$i]['folder_hasChildren'] = 0; 1822 1823 switch ($tmp_folder_id[1]) { 1824 case $inbox: 1825 case $sent: 1826 case $drafts: 1827 case $spam: 1828 case $trash: 1829 $resultDefault[]=$result[$i]; 1830 break; 1831 default: 1832 $resultMine[]=$result[$i]; 1833 } 1834 1835 $i++; 1836 } 1790 1791 while (list($key, $val) = each($folders_list)) 1792 { 1793 $status = imap_status( $mbox_stream, $val->name, SA_UNSEEN ); 1794 1795 $tmp_folder_id = explode("}", $val->name ); 1796 1797 $folderUser = trim( strpos( $tmp_folder_id[1], $this->imap_delimiter , 5 ) ); 1798 1799 $folderUser = trim( substr( $tmp_folder_id[1], 0, $folderUser ) ); 1800 1801 $Permission = true; 1802 1803 if( $folderUser != "INBOX" && $folderUser != "" ) 1804 { 1805 $Permission = imap_getacl( $mbox_stream, $folderUser ); 1806 } 1807 1808 if( $Permission ) 1809 { 1810 $tmp_folder_id[1] = mb_convert_encoding( $tmp_folder_id[1], "ISO_8859-1", "UTF7-IMAP" ); 1811 1812 if( $tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') 1813 { 1814 //error_log('passou', 3,'/tmp/imap_get_list.log'); 1815 //imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas')); 1816 continue; 1817 } 1818 1819 $result[$i]['folder_unseen'] = $status->unseen; 1820 $folder_id = $tmp_folder_id[1]; 1821 $result[$i]['folder_id'] = $folder_id; 1822 1823 $tmp_folder_parent = explode($this->imap_delimiter, $folder_id); 1824 $result[$i]['folder_name'] = array_pop($tmp_folder_parent); 1825 $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name']; 1826 1827 if ($uid2cn && substr($folder_id,0,4) == 'user') 1828 { 1829 //$this->ldap = new ldap_functions(); 1830 if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])) 1831 { 1832 $result[$i]['folder_name'] = $cn; 1833 } 1834 } 1835 1836 $tmp_folder_parent = implode($this->imap_delimiter, $tmp_folder_parent); 1837 $result[$i]['folder_parent'] = $tmp_folder_parent == 'INBOX' ? '' : $tmp_folder_parent; 1838 1839 if (($val->attributes == 32) && ($result[$i]['folder_name'] != 'Inbox')) 1840 $result[$i]['folder_hasChildren'] = 1; 1841 else 1842 $result[$i]['folder_hasChildren'] = 0; 1843 1844 switch ($tmp_folder_id[1]) 1845 { 1846 case $inbox: 1847 case $sent: 1848 case $drafts: 1849 case $spam: 1850 case $trash: 1851 $resultDefault[]=$result[$i]; 1852 break; 1853 default: 1854 $resultMine[]=$result[$i]; 1855 } 1856 } 1857 1858 $i++; 1859 } 1837 1860 } 1838 1861
Note: See TracChangeset
for help on using the changeset viewer.