Ignore:
Timestamp:
08/17/09 14:51:21 (15 years ago)
Author:
niltonneto
Message:

Ticket #605 - Opção de mostrar pastas compartilhadas por nome (CN) ou login (uid).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r1319 r1330  
    14241424                                $result[$i]['folder_name'] = array_pop($tmp_folder_parent); 
    14251425                                $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name']; 
    1426                                 if (is_numeric($result[$i]['folder_name']))     { 
    1427                                         //$this->ldap = new ldap_functions(); 
     1426                                if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']){ 
     1427                                        $this->ldap = new ldap_functions(); 
    14281428                                        if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])){ 
    14291429                                                $result[$i]['folder_name'] = $cn; 
     
    21532153        } 
    21542154        //Este bloco tem a finalidade de transformar o CPF das pastas compartilhadas em common name 
    2155         if (substr($new_folder_name,0,4) == 'user'){ 
    2156                 $this->ldap = new ldap_functions(); 
    2157                 $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 
    2158                         $return['new_folder_name'] = array_pop($tmp_folder_name); 
    2159                         if (is_numeric($return['new_folder_name'])) 
     2155        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']){ 
     2156                if (substr($new_folder_name,0,4) == 'user'){ 
     2157                        $this->ldap = new ldap_functions(); 
     2158                        $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 
     2159                                $return['new_folder_name'] = array_pop($tmp_folder_name); 
    21602160                                if( $cn = $this->ldap->uid2cn($return['new_folder_name'])) 
    21612161                                        $return['new_folder_name'] = $cn; 
     2162                } 
    21622163        } 
    21632164                 
     
    29172918                                $filter = $this->remove_accents($filter); 
    29182919                                //Este bloco tem a finalidade de transformar o login (quando numerico) das pastas compartilhadas em common name 
    2919                                 $folder_name = explode($this->imap_delimiter,$name_box); 
    2920                                 if (is_numeric($folder_name[1])) { 
     2920                                if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']){ 
     2921                                        $folder_name = explode($this->imap_delimiter,$name_box); 
    29212922                                        $this->ldap = new ldap_functions(); 
    2922                                         if ($cn = $this->ldap->uid2cn($folder_name[1])) { 
     2923                                        if ($cn = $this->ldap->uid2cn($folder_name[1])){ 
    29232924                                                $folder_name[1] = $cn; 
    29242925                                        } 
    2925                                 } 
    2926                                 $folder_name = implode($this->imap_delimiter,$folder_name); 
     2926                                        $folder_name = implode($this->imap_delimiter,$folder_name); 
     2927                                } 
     2928                                else 
     2929                                        $folder_name = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 
    29272930                                 
    29282931                                if(!is_resource($mbox_stream)) 
     
    29432946                                                { 
    29442947                                                        foreach($search_criteria as $new_search){ 
    2945                                                                 $m_token = trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 
     2948                                                                $m_token = trim("##". mb_convert_encoding( $folder_name, "ISO_8859-1", "UTF7-IMAP" ) . "--" . mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 
    29462949                                                                if(!@strstr($retorno,$m_token)) 
    29472950                                                                        $retorno .= $m_token; 
     
    29572960                                        { 
    29582961                                                foreach($search_criteria as $new_search) 
    2959                                                         $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 
     2962                                                        $retorno .= trim("##". mb_convert_encoding( $folder_name, "ISO_8859-1", "UTF7-IMAP" ) . "--" . mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 
    29602963                                        } 
    29612964                                } 
Note: See TracChangeset for help on using the changeset viewer.