Changeset 5175


Ignore:
Timestamp:
11/14/11 14:00:23 (12 years ago)
Author:
gustavo
Message:

Ticket #2313 - Pastas fixas do IMAP estão fora de ordem

File:
1 edited

Legend:

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

    r5172 r5175  
    23542354                $spam = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']; 
    23552355                $trash = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; 
     2356 
    23562357                if(array_key_exists('uid2cn', $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] )) 
    23572358                $uid2cn = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn'];  
     
    23912392                                $folderUser = trim( strpos( $tmp_folder_id[1], $this->imap_delimiter , 5 ) ); 
    23922393 
    2393                             $folderUser = trim( substr( $tmp_folder_id[1], 0, $folderUser ) ); 
    2394  
    2395                             $Permission = true; 
    2396  
    2397                             if( $folderUser != "INBOX" && $folderUser != "" ) 
    2398                             { 
    2399                                $Permission = @imap_getacl( $mbox_stream, $folderUser ); 
    2400                             } 
    2401                                 $tmp_folder_id[1] = mb_convert_encoding( $tmp_folder_id[1], "ISO-8859-1", "UTF7-IMAP" ); 
    2402  
    2403                                 if( $tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') 
    2404                                 { 
     2394                                $folderUser = trim( substr( $tmp_folder_id[1], 0, $folderUser ) ); 
     2395 
     2396                                $Permission = true; 
     2397 
     2398                                if( $folderUser != "INBOX" && $folderUser != "" ) 
     2399                                { 
     2400                                        $Permission = @imap_getacl( $mbox_stream, $folderUser ); 
     2401                                } 
     2402                                $tmp_folder_id[1] = mb_convert_encoding( $tmp_folder_id[1], "ISO-8859-1", "UTF7-IMAP" ); 
     2403 
     2404                                if( $tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') 
     2405                                { 
    24052406                                        continue; 
    24062407                                } 
    24072408                                 
    24082409                                if(isset($status->unseen)) 
    2409                                 $result[$i]['folder_unseen'] = $status->unseen; 
     2410                                        $result[$i]['folder_unseen'] = $status->unseen; 
    24102411                                 
    24112412                                $folder_id = $tmp_folder_id[1]; 
     
    24542455                                        default: 
    24552456                                                if($user[0] == $inbox) 
    2456                                                 $resultMine[]=$result[$i]; 
     2457                                                        $resultMine[]=$result[$i]; 
    24572458                                                else{ 
    24582459                                                        if($aux != $user[1]){ 
     
    24632464                                                                $resultSharedMine[$qtd] = array(); 
    24642465                                                        $resultSharedMine[$qtd][]=$result[$i]; 
    2465                                 } 
    2466  
    2467                             } 
     2466                                                } 
     2467 
     2468                                } 
    24682469                            $i++; 
    2469                         } 
     2470                        } 
    24702471                } 
    24712472 
     
    24972498                 
    24982499                // Sorting resultDefault 
     2500                $resultDefault2 = array(); 
     2501                 
    24992502                foreach ($resultDefault as $key => $folder_id) 
    25002503                { 
     2504 
    25012505                        switch ($resultDefault[$key]['folder_id']) { 
    25022506                                case $inbox:  
     
    25172521                        } 
    25182522                } 
    2519                  
     2523                //RE-ORDENA INDICES 
     2524                ksort($resultDefault2); 
    25202525                $shareds = array(); 
    25212526                if(!empty($resultSharedDefault)) 
     
    25492554                        $resultSharedDefault2 = array(); 
    25502555                } 
     2556ob_start(); 
     2557print_r( "=== LOG BEGIN ===" . "\n" ); 
     2558print_r( "resultDefault2 : " . "\n" ); 
     2559print_r( var_export($resultDefault2) . "\n" ); 
     2560$output = ob_get_clean(); 
     2561file_put_contents( '/tmp/log-gustavo2.txt', file_get_contents( '/tmp/log-gustavo2.txt' ) . $output ); 
    25512562                if ( $params && isset($params['folderType']) && $params['folderType'] == 'default' ) 
    25522563                        return array_merge($resultDefault2, $arr_quota_info); 
Note: See TracChangeset for help on using the changeset viewer.