Changeset 91


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

* empty log message *

Location:
trunk/expressoMail1_2
Files:
2 added
3 edited

Legend:

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

    r64 r91  
    183183        function remove_accents($string) { 
    184184                        return strtr($string,  
    185                         "?Ó??ó?Ý?úÁÀÃÂÄÇÉÈÊËÍÌ?ÎÏÑÕÔÓÒÖÚÙ?ÛÜ?áàãâäçéèêëíì?îïñóòõôöúù?ûüýÿ'\"", 
    186                         "SOZsozYYuAAAAACEEEEIIIIINOOOOOUUUUUsaaaaaceeeeiiiiinooooouuuuuyy__"); 
     185                        "?Ó??ó?Ý?úÁÀÃÂÄÇÉÈÊËÍÌ?ÎÏÑÕÔÓÒÖÚÙ?ÛÜ?áàãâäçéèêëíì?îïñóòõôöúù?ûüýÿ:'\"", 
     186                        "SOZsozYYuAAAAACEEEEIIIIINOOOOOUUUUUsaaaaaceeeeiiiiinooooouuuuuyy___"); 
    187187        } 
    188188         
  • 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 
  • trunk/expressoMail1_2/js/draw_api.js

    r88 r91  
    719719        if (info_msg.attachments.length > 0) 
    720720                td.innerHTML += "&nbsp<img style='cursor:pointer' onclick='javascript:Element(\"option_hide_more_"+ID+"\").onclick()' src ='templates/default/images/clip.gif' title='"+info_msg.attachments.names+"'>"; 
     721         
     722        if (typeof(info_msg.signature) == 'string') 
     723        {        
     724                if (info_msg.signature == "signed") 
     725                        td.innerHTML += "&nbsp;<img style='cursor:pointer' onclick='alert(\""+get_lang("This message is signed, and you can trust.")+"\");' title='"+get_lang("Signed message")+"' src='templates/default/images/signed.gif'>"; 
     726                else 
     727                        td.innerHTML += "&nbsp;<img style='cursor:pointer' onclick='alert(\""+get_lang("This message is signed, but it is invalid. You should not trust on it.")+"\");' title='"+get_lang("Voided message")+"' src='templates/default/images/invalid.gif'>"; 
     728        } 
    721729         
    722730        // NORMAL MSG 
Note: See TracChangeset for help on using the changeset viewer.