Ignore:
Timestamp:
05/19/11 13:38:13 (13 years ago)
Author:
airton
Message:

Ticket #1991 - Parametrizacao das buscas LDAP no ExpressoMail?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r4436 r4457  
    14251425                $regs_found = array();  
    14261426                $tags_found = @mb_eregi("<style\b[^>]*>(.*?)</style>", $body, $regs_found); 
    1427                 $wrapper_class = 'ExpressoCssWrapper'.time(); 
    14281427                 
    14291428                foreach ($regs_found as $block_found) {  
     
    14391438                        $prefix = ".$wrapper_class ";  
    14401439                        foreach ($css->css[41] as $key => $value) { 
    1441                         //explode multiple selectors per block 
    1442                          $selectors = explode(',', $key); 
    1443                         foreach ($selectors as $selector) { 
    1444                                 if (ereg('\*', $key)) { 
    1445                                         //skip selecto '*' 
    1446                                         continue; 
    1447                                 } 
    1448  
    1449                                 $selector = eregi_replace('[^#\.]*body.*', '', $selector); 
    1450                                 $css->css[41][$prefix.trim($selector)] = $value; 
    1451                         } 
     1440                                                //explode multiple selectors per block  
     1441                                                $selectors = explode(',', $key);  
     1442                                                          
     1443                                    foreach ($selectors as $selector) {  
     1444                                        if (ereg('\*', $key)) {  
     1445                                                                //skip selecto '*'  
     1446                                            continue;  
     1447                                        }  
     1448                                                                  
     1449                                                        $selector = eregi_replace('[^#\.]*body.*', '', $selector);  
     1450                                                        $css->css[41][$prefix.trim($selector)] = $value;  
     1451                                    }  
    14521452                        unset($css->css[41][$key]); 
    14531453                        } 
     
    29252925                        $imagesParts[$value[6]] = $value[3];     
    29262926 
    2927                 //Build Forwarding Attachments!!!        
    2928                 foreach($forwarding_attachments as $forwarding_attachment) 
     2927                //Build Forwarding Attachments!!!                     
     2928                foreach($forwarding_attachments as $forwarding_attachment)  
    29292929                { 
    29302930                        $file_description = unserialize(rawurldecode($forwarding_attachment)); 
    2931                          
    2932                         $file_description = array_values($file_description); 
    2933                         foreach($file_description as $i => $descriptor){                                 
    2934                                 $file_description[$i] = eregi_replace('\'*\'','',$descriptor); 
    2935                         } 
    2936                         $fileContent = $this->get_forwarding_attachment($file_description[0], $file_description[1], $file_description[3],$file_description[4]); 
    2937                         $fileName = $file_description[2]; 
    2938                          
    2939                         $file_description[5] = strlen($fileContent); //Size of file 
    2940                         $return_forward[] = $file_description; 
    2941                  
    2942                         $mail->AddStringAttachment($fileContent, $fileName, $file_description[4], $this->get_file_type($file_description[2])); 
     2931                        $file_description = array_values($file_description);  
     2932                                         
     2933                                foreach($file_description as $i => $descriptor){                                  
     2934                                                        $file_description[$i] = eregi_replace('\'*\'','',$descriptor);  
     2935                                                }  
     2936                                                $fileContent = $this->get_forwarding_attachment($file_description[0], $file_description[1], $file_description[3],$file_description[4]);  
     2937                                                $fileName = $file_description[2];  
     2938                                                  
     2939                                                $file_description[5] = strlen($fileContent); //Size of file  
     2940                                                $return_forward[] = $file_description;  
     2941                                          
     2942                                                $mail->AddStringAttachment($fileContent, $fileName, $file_description[4], $this->get_file_type($file_description[2]));  
    29432943                } 
    29442944                 
     
    30353035                                if (array_key_exists("name", $_attachment)) 
    30363036                                { 
    3037                                         //unset($return_files[$index]); 
     3037                                        unset($return_files[$index]); 
    30383038                                        $return_files[$index] = $_attachment['name']."_SIZE_".$return_files[$index][1] = $_attachment['size']; 
    30393039                                } 
    30403040                                else 
    30413041                                { 
    3042                                         //unset($return_files[$index]); 
     3042                                        unset($return_files[$index]); 
    30433043                                        $return_files[$index] = $_attachment[2]."_SIZE_". $return_files[$index][1] = $_attachment[5]; 
    30443044                                } 
     
    41034103        if($timestamp){ 
    41044104                        $pdate = date_parse(date('r')); // pega a data atual do servidor (TODO: pegar a data da mensagem local)  
    4105                 $file = $tempDir."imap_".$_SESSION[ 'phpgw_session' ][ 'session_id' ];           
    41064105                        $timestamp += $pdate['zone']*(60); //converte a data da mensagem para o fuso horário GMT 0. Isto é feito devido ao Expresso Mail armazenar a data no fuso horário GMT 0 e para exibi-la converte ela para o fuso horário local.  
    4107                                  
    4108                 /* TODO: o diretorio /tmp deve ser substituido pelo diretorio temporario configurado no setup */  
    4109                 $file = "/tmp/sess_".$_SESSION[ 'phpgw_session' ][ 'session_id' ];  
     4106                        /* TODO: o diretorio /tmp deve ser substituido pelo diretorio temporario configurado no setup */  
     4107                        $file = "/tmp/sess_".$_SESSION[ 'phpgw_session' ][ 'session_id' ];  
     4108                 
    41104109                $f = fopen($file,"w"); 
    41114110                fputs($f,base64_encode($source)); 
    4112             fclose($f); 
    4113             $command = "python ".$_SESSION['rootPatch']."/expressoMail1_2/imap.py ".escapeshellarg($imap_server)." ".escapeshellarg($imap_port)." ".escapeshellarg($username)." ".escapeshellarg($password)." ".escapeshellarg($timestamp)." ".escapeshellarg($folder)." ".escapeshellarg($file); 
     4111            fclose($f);            
     4112                   $command = "python ".$_SESSION['rootPatch']."/expressoMail1_2/imap.py ".escapeshellarg($imap_server)." ".escapeshellarg($imap_port)." ".escapeshellarg($username)." ".escapeshellarg($password)." ".escapeshellarg($timestamp)." ".escapeshellarg($folder)." ".escapeshellarg($file); 
    41144113            $return['command']=exec(escapeshellcmd($command)); 
    41154114        }else{ 
Note: See TracChangeset for help on using the changeset viewer.