Changeset 2493


Ignore:
Timestamp:
04/13/10 09:05:32 (14 years ago)
Author:
amuller
Message:

Ticket #1026 - Corrigindo problema de sessao no phpmailer que não tinha sido pensado

Location:
trunk/expressoMail1_2/inc
Files:
2 edited

Legend:

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

    r2484 r2493  
    9393                // This error is returned from Postfix. 
    9494                elseif(strstr($error,'message file too big')) { 
    95                         return str_replace("%1",$this->preferences->max_attachment_size,$this->functions->getLang('The size of this message has exceeded  the limit (%1B).')); 
     95                        return str_replace("%1",$this->preferences['max_attachment_size'],$this->functions->getLang('The size of this message has exceeded  the limit (%1B).')); 
    9696                } 
    9797                elseif(strstr($error,'virus')) { 
     
    765765                $return = ""; 
    766766 
    767                 if( (isset($this->preferences->preview_msg_subject) && ($this->preferences->preview_msg_subject == "0")) && (isset($this->preferences->preview_msg_tip) && ($this->preferences->preview_msg_tip == "0")) ) 
     767                if( (isset($this->preferences['preview_msg_subject']) && ($this->preferences['preview_msg_subject'] == "0")) && (isset($this->preferences['preview_msg_tip']) && ($this->preferences['preview_msg_tip'] == "0")) ) 
    768768                { 
    769769                        $return['body'] = ""; 
     
    16541654                $spam = $inbox . $this->email_server['imapDelimiter ']. $this->email_server['imapDefaultSpamFolder']; 
    16551655                $sent = $inbox . $this->email_server['imapDelimiter ']. $this->email_server['imapDefaultSentFolder']; 
    1656                 $uid2cn = $this->preferences->uid2cn; 
     1656                $uid2cn = $this->preferences['uid2cn']; 
    16571657 
    16581658                if(!$this->mbox || !is_resource($this->mbox)) 
     
    18851885                include_once("class.phpmailer.php"); 
    18861886                $mail = new PHPMailer(); 
     1887                $mail->email_server = $this->email_server; 
     1888                $mail->username = $this->username; 
     1889                $mail->password = $this->password; 
     1890                $mail->session_id = $this->session_id; 
     1891 
    18871892                // Set lang for PHPMailer using user prefs. 
    18881893                list($prefix,$userlang) = explode('-',$this->lang); 
     
    20202025            // Se uma das verificacoes falhar, nao enviar o e-mail e avisar o usuario. 
    20212026            // O array $mail->Certs_crypt soh deve ser preenchido se os certificados passarem nas verificacoes. 
    2022             $numero_maximo = $this->preferences->num_max_certs_to_cipher;  // Este valor dever ser configurado pelo administrador do site .... 
     2027            $numero_maximo = $this->preferences['num_max_certs_to_cipher'];  // Este valor dever ser configurado pelo administrador do site .... 
    20232028            $erros_acumulados = ""; 
    20242029            $aux_mails = array(); 
     
    21552160                { 
    21562161                        $total_uploaded_size = 0; 
    2157                         $upload_max_filesize = str_replace("M","",$this->preferences->max_attachment_size) * 1024 * 1024; 
     2162                        $upload_max_filesize = str_replace("M","",$this->preferences['max_attachment_size']) * 1024 * 1024; 
    21582163                        foreach ($attachments as $attach) 
    21592164                        { 
     
    22382243                                error_log("$now - $userip - $sent [$subject] - $userid => $addrs\r\n", 3, "/home/expressolivre/mail_senders.log"); 
    22392244                        } 
    2240                         if($this->preferences->number_of_contacts && 
    2241                            $this->preferences->use_dynamic_contacts) { 
     2245                        if($this->preferences['number_of_contacts'] && 
     2246                           $this->preferences['use_dynamic_contacts']) { 
    22422247                                $contacts = new dynamic_contacts(); 
    22432248                                $new_contacts = $contacts->add_dynamic_contacts($toaddress.",".$ccaddress.",".$ccoaddress); 
     
    24982503        } 
    24992504        //Este bloco tem a finalidade de transformar o CPF das pastas compartilhadas em common name 
    2500         if ($this->preferences->uid2cn){ 
     2505        if ($this->preferences['uid2cn']){ 
    25012506            if (substr($new_folder_name,0,4) == 'user'){ 
    25022507                $this->ldap = new ldap_functions(); 
     
    26202625                $mail->From =  $this->email; 
    26212626                $session_id = $this->session_id; 
    2622                 $max_resolution = $this->preferences->image_size; 
     2627                $max_resolution = $this->preferences['image_size']; 
    26232628 
    26242629                $this->add_recipients("to", $toaddress, &$mail); 
     
    28362841                                        imap_fetchheader($this->mbox, imap_msgno($this->mbox, $msg_number)) 
    28372842                                        ,$importance); 
    2838                                 if(strtolower($importance[1])=="high" && $this->preferences->use_important_flag) { 
     2843                                if(strtolower($importance[1])=="high" && $this->preferences['use_important_flag']) { 
    28392844                                        $flag_importance=true; 
    28402845                                } 
     
    28522857                        } 
    28532858 
    2854                         if($flag_importance && $this->preferences->use_important_flag) { 
     2859                        if($flag_importance && $this->preferences['use_important_flag']) { 
    28552860                                $return["status"] = false; 
    28562861                                $return["msg"] = $this->functions->getLang("At least one of selected message cant be marked as normal"); 
     
    33353340            if($search){ 
    33363341                $search_criteria = ''; 
    3337                 $search_result_number = $this->preferences->search_result_number; 
     3342                $search_result_number = $this->preferences['search_result_number']; 
    33383343                foreach($search as $tmp) 
    33393344                { 
     
    33653370                    $filter = $this->remove_accents($filter); 
    33663371                    //Este bloco tem a finalidade de transformar o login (quando numerico) das pastas compartilhadas em common name 
    3367                     if ($this->preferences->uid2cn && substr($name_box,0,4) == 'user') 
     3372                    if ($this->preferences['uid2cn'] && substr($name_box,0,4) == 'user') 
    33683373                    { 
    33693374                        $folder_name = explode($this->email_server['imapDelimiter'],$name_box); 
     
    37243729                $header->udate +=  $pdate['zone']*(-60); 
    37253730 
    3726                 if($header->Flagged != "F" && $this->preferences->use_important_flag) { 
     3731                if($header->Flagged != "F" && $this->preferences['use_important_flag']) { 
    37273732                        $flag = preg_match('/importance *: *(.*)\r/i', 
    37283733                                                imap_fetchheader($this->mbox, imap_msgno($this->mbox, $msg_number)) 
  • trunk/expressoMail1_2/inc/class.phpmailer.php

    r2360 r2493  
    257257    var $LE              = "\n"; 
    258258    /**#@-*/ 
     259 
     260    /*Used for expresso*/ 
     261    var $session_id; 
     262    var $email_server; 
     263    var $username; 
     264    var $password;  
     265 
    259266     
    260267    ///////////////////////////////////////////////// 
     
    696703 
    697704        if ($this->SaveMessageInFolder){ 
    698                         $username = $_SESSION['phpgw_info']['expressomail']['user']['userid']; 
    699                         $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; 
    700                         $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 
    701                         $imap_port      = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort']; 
     705                        $username = $this->username; 
     706                        $password = $this->password; 
     707                        $imap_server = $this->email_server['imapServer']; 
     708                        $imap_port = $this->email_server['imapPort']; 
    702709                         
    703                         if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') 
     710                        if ($this->email_server['imapTLSEncryption'] == 'yes') 
    704711                        { 
    705712                                $imap_options = '/tls/novalidate-cert'; 
     
    13711378        set_magic_quotes_runtime(0); 
    13721379 
    1373         $nameOut = ini_get("session.save_path").'/'."email_".$_SESSION[ 'phpgw_session' ][ 'session_id' ].base_convert(microtime(), 10, 36).".base64"; 
     1380        $nameOut = ini_get("session.save_path").'/'."email_".$this->session_id.base_convert(microtime(), 10, 36).".base64"; 
    13741381        $fh2 = fopen($nameOut, 'wb'); 
    13751382        if ($encoding != "" && $encoding != 'base64') 
     
    14351442 
    14361443        set_magic_quotes_runtime($magic_quotes); 
    1437  
    14381444        return $nameOut; 
    14391445        //return $file_buffer; 
Note: See TracChangeset for help on using the changeset viewer.