Ignore:
Timestamp:
11/07/07 15:19:35 (16 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

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

    r86 r91  
    22include_once("class.functions.inc.php"); 
    33include_once("class.ldap_functions.inc.php"); 
     4include_once("class.exporteml.inc.php"); 
     5 
    46class imap_functions 
    57{ 
     
    157159                $return['body']                 = $return_get_body['body']; 
    158160                $return['attachments']  = $return_get_body['attachments']; 
    159                 $return['thumbs']               = $return_get_body['thumbs'];            
     161                $return['thumbs']               = $return_get_body['thumbs']; 
     162                $return['signature']    = $return_get_body['signature']; 
    160163                 
    161164                foreach($all_header as $line) { 
     
    353356                $return['attachments'] = $this-> download_attachment($msg,$msg_number);          
    354357                if(!$this->has_cid) 
    355                         $return['thumbs']  = $this->get_thumbs($msg,$msg_number,$msg_folder);            
     358                { 
     359                        $return['thumbs']  = $this->get_thumbs($msg,$msg_number,$msg_folder); 
     360                        $return['signature'] = $this->get_signature($msg,$msg_number,$msg_folder); 
     361                }                        
    356362                 
    357363                if(!$msg->structure[$msg_number]->parts) //Simple message, only 1 piece 
     
    689695                } 
    690696                return $body; 
     697        } 
     698 
     699        function get_signature($msg, $msg_number, $msg_folder) 
     700        {  
     701                foreach ($msg->file_type[$msg_number] as $index => $file_type) 
     702                { 
     703                        $file_type = strtolower($file_type); 
     704                        if(strtolower($msg->encoding[$msg_number][$index]) == 'base64')  
     705                        { 
     706                                if ($file_type == 'application/x-pkcs7-signature')  
     707                                { 
     708                                        $export_mail = new ExportEml(); 
     709                                        $params['folder'] = $msg_folder; 
     710                                        $params['msgs_to_export'] = $msg_number; 
     711                                        $result = openssl_pkcs7_verify ($export_mail->export_msg($params),PKCS7_NOVERIFY); 
     712                                     
     713                                    /* Message verified */ 
     714                                    if ($result === true) 
     715                                            $sign = "signed"; 
     716                                     else 
     717                                            $sign = "void"; 
     718                                } 
     719                        } 
     720                } 
     721                return $sign;    
    691722        } 
    692723 
Note: See TracChangeset for help on using the changeset viewer.