Changeset 2853


Ignore:
Timestamp:
05/25/10 15:06:34 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #1061 - Corrigidos para exibir dados do certificado qdo. msg assinada

Location:
trunk/expressoMail1_2
Files:
2 edited

Legend:

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

    r2844 r2853  
    219219                $head_array['attachment'] = $imap_attachment->get_attachment_headerinfo($this->mbox, $msg_number); 
    220220 
     221                if($head_array['ContentType'] =='normal') return $head_array; 
     222 
     223                include_once("class.message_components.inc.php"); 
     224                $msg = &new message_components($this->mbox); 
     225                $msg->fetch_structure($msg_number); 
     226                if(!$this->has_cid) 
     227                { 
     228                        $head_array['signature'] = $this->get_signature($msg,$msg_number,$this->mbox); 
     229                } 
    221230                return $head_array; 
    222231        } 
     
    12771286                { 
    12781287            $sign = array(); 
    1279                         $temp = $this->get_info_head_msg($msg_number); 
    1280                         if($temp['ContentType'] =='normal') return $sign; 
    12811288                        $file_type = strtolower($file_type); 
    12821289                        if(strtolower($msg->encoding[$msg_number][$index]) == 'base64') 
  • trunk/expressoMail1_2/js/jscode/draw_messages.js

    r2839 r2853  
    3939                tbody_message_others_options.appendChild(appendChilds(tr111, td111, sender, sender_values)); 
    4040        } 
    41  
     41         
    4242        var from = createAndSet('TD',['id','class'],["from_"+this.id,"header_message_field"],info_msg.from.full); 
    4343 
     
    5050        appendChilds(tr1,td1,from,from_values,local_message); 
    5151 
     52        if(typeof(info_msg.signature) != 'undefined'){ 
     53            if(info_msg.signature.length > 0){ 
     54                var aux_signature = ''; 
     55                for (i=0; i < info_msg.signature.length; i++) 
     56                   aux_signature += '<span>'+info_msg.signature[i]+'</span> <br /> '; 
     57                var tr7 = document.createElement("TR"); 
     58                tr7.className = "tr_message_header"; 
     59                var td7 = document.createElement("TD"); 
     60                td7.innerHTML = 'Assinatura<br/>Digital:'; 
     61                td7.vAlign = 'top'; 
     62                var _certs = createAndSet('TD',['id', 'class'],["certs_"+this.id, "header_message_field"],aux_signature); 
     63                tbody_message_others_options.appendChild(appendChilds(tr7,td7,_certs)); 
     64            } 
     65        } 
     66         
    5267        if (info_msg.reply_to){ 
    5368                var tr11 = document.createElement("TR"); 
     
    320335                td.innerHTML += "&nbsp<img style='cursor:pointer' onclick='javascript:Element(\"option_hide_more_"+id+"\").onclick()' src ='" + URL_SERVER + "expressoMail1_2/templates/"+template+"/images/clip.gif' title='"+info_msg.attachment.names+"'>"; 
    321336 
    322         if (typeof(info_msg.signature) == 'string') 
    323         { 
    324                 if (info_msg.signature != "void") 
    325                         td.innerHTML += '&nbsp;<img style="cursor:pointer" onclick="alert(\''+ get_lang("This message is signed, and you can trust.") + info_msg.signature +'\');" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed.gif">'; 
    326                 else 
    327                         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='" + URL_SERVER + "expressoMail1_2/templates/"+template+"/images/invalid.gif'>"; 
    328         } 
    329  
     337        if(typeof(info_msg.signature) != 'undefined') 
     338            { 
     339                        if(info_msg.signature[0].indexOf('Message untouched') >= 0) 
     340                            td.innerHTML += "&nbsp<img style='cursor:pointer' onclick='javascript:Element(\"option_hide_more_"+id+"\").onclick()' src ='" + URL_SERVER + "expressoMail1_2/templates/"+template+"/images/signed_msg.gif' title='"+get_lang("Details")+"'>"; 
     341                        else 
     342                            td.innerHTML += "&nbsp<img style='cursor:pointer' onclick='javascript:Element(\"option_hide_more_"+id+"\").onclick()' src ='" + URL_SERVER + "expressoMail1_2/templates/"+template+"/images/invalid.gif' title='"+get_lang("Details")+"'>"; 
     343            } 
     344             
    330345        if (info_msg.DispositionNotificationTo) 
    331346        { 
     
    440455                tr0.appendChild(td0); 
    441456                tbody_message.appendChild(tr0); 
    442                 if (info_msg.signature && info_msg.signature.length > 0) 
    443                 { 
    444                         tbody_message.appendChild(putSignature(this.id,info_msg,td)); 
    445                 } 
     457                //if (info_msg.signature && info_msg.signature.length > 0) 
     458                //{ 
     459                        //tbody_message.appendChild(draw_msg.putSignature(this.id,info_msg,td)); 
     460                        //alert(info_msg.signature); 
     461                //} 
    446462        } 
    447463        else    // IF DRAFT 
     
    628644    return to_addybook_add; 
    629645}; 
    630  
    631  
    632 draw_message.prototype.show_signature_certificate_data = function(){ 
    633         var _height = Element("div_message_scroll_"+this.id).style.height; 
    634         _height = parseInt(_height.replace("px","")); 
    635         var _offset = 130; 
    636         if (this.value == 'more_cert'){ 
    637                 //this.innerHTML += "<b><u>Mais Informaᅵᅵes</u></b>"; 
    638                 this.value = 'hide_cert'; 
    639                 Element("div_message_scroll_"+this.id).style.height = (_height + _offset)+"px"; 
    640                 Element('tr_signature_'+this.id).style.display = 'none'; 
    641                 Element('td_signature_'+this.id).style.display = 'none'; 
    642  
    643         } 
    644         else{ 
    645                 //this.innerHTML += "Mais Informaᅵᅵes"; 
    646                 this.value = 'more_cert'; 
    647                 Element("div_message_scroll_"+this.id).style.height = (_height - _offset)+"px"; 
    648                 Element('tr_signature_'+this.id).style.display = ''; 
    649                 Element('td_signature_'+this.id).style.display = ''; 
    650         } 
    651 }; 
    652  
    653 draw_message.prototype.putSignature = function(info_msg,tdx){ 
    654         var tr_signature = document.createElement("TR"); 
    655         var td_signature = document.createElement("TD"); 
    656         td_signature.className = 'tr_message_header'; 
    657         tr_signature.id = 'tr_signature_'+this.id; 
    658         td_signature.colSpan = "5"; 
    659         tr_signature.style.display = 'none'; 
    660  
    661         for (i=0; i < info_msg.signature.length; i++) 
    662                 td_signature.innerHTML += '<span>'+info_msg.signature[i]+'</span> <br /> '; 
    663         td_signature.innerHTML += '<hr></hr>'; 
    664         var signature_status_pos = info_msg.signature[0].indexOf('Message untouched'); 
    665         td_signature.id = "td_signature_"+this.id; 
    666         if(signature_status_pos < 0 ) 
    667         { 
    668                 tdx.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_error.gif" title="'+get_lang("Details")+'" onclick="show_signature_certificate_data(\'' + this.id + '\')">'; 
    669                 tr_signature.style.display = ''; 
    670         } 
    671         else 
    672         { 
    673                 tdx.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_table.gif" title="'+get_lang("Details")+'" onclick="show_signature_certificate_data(\'' + this.id + '\')">'; 
    674         } 
    675         tr_signature.appendChild(td_signature); 
    676         return tr_signature; 
    677     }; 
    678  
    679646 
    680647draw_message.prototype.getThumbs = function(attachments, thumbs, msg_number, msg_folder){ 
Note: See TracChangeset for help on using the changeset viewer.