Ignore:
Timestamp:
02/06/09 17:13:58 (15 years ago)
Author:
niltonneto
Message:

IMportação de compromisso pelo Expressomail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.uiicalendar.inc.php

    r620 r678  
    7777                } 
    7878 
    79                 function import_from_mail() { 
    80                         $msg_number = $_GET['msg_number']; 
    81                         $idx_file = $_GET['idx_file']; 
    82                         $newfilename = $_GET['newfilename']; 
    83                         $msg_part = $_GET['msg_part']; 
    84                         $msg_folder = $_GET['msg_folder']; 
    85                         $encoding = strtolower($_GET['encoding']); 
    86                         $fileContent = ""; 
    87  
    88                         if($msg_number && $msg_part && $msg_folder && (intval($idx_file == '0' ? '1' : $idx_file))) { 
    89                                 $username = $_SESSION['phpgw_info']['expressomail']['user']['userid']; 
    90                                 $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; 
    91                                 $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 
    92                                 $imap_port      = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort'];           
    93                                 if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') 
    94                                 { 
    95                                         $imap_options = '/tls/novalidate-cert'; 
    96                                 } 
    97                                 else 
    98                                 { 
    99                                         $imap_options = '/notls/novalidate-cert'; 
    100                                 } 
    101                                 $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password);           
    102                                 $fileContent = imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID); 
    103  
    104                                 $imap_attachment = CreateObject("expressoMail1_2.imap_attachment");                      
    105                                 $a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 
    106                                  
    107                                 $filename = $a[$idx_file]['name']; 
    108                         } 
    109                         else 
    110                                 $filename = $idx_file; 
    111                                          
    112                         $filename        = $filename    ? $filename     : "attachment.bin"; 
    113                         $newfilename = $newfilename ? $newfilename      : $filename; 
    114                         $strFileType = strrev(substr(strrev(strtolower($filename)),0,4));        
    115                          
    116                         if($fileContent) { 
    117                                 if($encoding == 'base64') 
    118                                         $calendar = imap_base64($fileContent); 
    119                                 else if($encoding == 'quoted-printable') 
    120                                         $calendar = quoted_printable_decode($fileContent); 
    121                                 else 
    122                                         $calendar = $fileContent; 
    123                         } 
    124                         $this->bo->import(explode("\n",$calendar),true); 
    125                          
    126                          
     79                function import_from_mail($calendar) { 
     80                        return $this->bo->import(explode("\n",$calendar),true); 
    12781                } 
    12882 
Note: See TracChangeset for help on using the changeset viewer.