Changeset 2427


Ignore:
Timestamp:
04/06/10 10:37:01 (14 years ago)
Author:
amuller
Message:

Ticket #1026 - Fechando a sessão em cada requisição do inicio do expressoMail

Location:
trunk/expressoMail1_2/inc
Files:
2 edited

Legend:

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

    r2416 r2427  
    220220         
    221221        function get_dropdown_contacts(){ 
    222                  
     222 
     223                $number_of_contacts = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts']; 
     224                $use_dynamic_contacts = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts'];  
     225                // Free others requests 
     226                session_write_close(); 
     227 
    223228                $contacts = $this -> get_cc_contacts(); 
    224229                $groups = $this -> get_cc_groups(); 
     
    233238                        $stringDropDownContacts = $groups; 
    234239                                         
    235                 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] && 
    236                         $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) { 
    237                                  
    238                         // Free others requests 
    239                         session_write_close(); 
     240                if($number_of_contacts && $use_dynamic_contacts) { 
    240241                        $dynamic_contact = new dynamic_contacts(); 
    241242                        $dynamic = $dynamic_contact->dynamic_contact_toString(); 
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r2417 r2427  
    6262                        return $this->mbox; 
    6363                $folder = mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1"); 
    64                 $this->mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => $this->parse_error(imap_last_error())))); 
     64                $this->mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => $this->parse_error(imap_last_error())))); 
    6565                return $this->mbox; 
    6666         } 
     
    16471647        function get_folders_list($params = null) 
    16481648        { 
    1649                 $mbox_stream = $this->open_mbox(); 
    1650                 if($params && $params['onload'] && $_SESSION['phpgw_info']['expressomail']['server']['certificado']){ 
    1651                         $this->delete_mailbox(array("del_past" => "INBOX/decifradas")); 
    1652                 } 
    16531649                $inbox = 'INBOX'; 
    16541650                $trash = $inbox . $this->imap_delimiter . $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; 
     
    16601656                session_write_close(); 
    16611657 
     1658                if(!$this->mbox || !is_resource($this->mbox)) 
     1659                        $this->mbox = $this->open_mbox(); 
     1660 
     1661                if($params && $params['onload'] && $_SESSION['phpgw_info']['expressomail']['server']['certificado']){ 
     1662                        $this->delete_mailbox(array("del_past" => "INBOX/decifradas")); 
     1663                } 
     1664 
    16621665                $serverString = "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}"; 
    1663                 $folders_list = imap_getmailboxes($mbox_stream, $serverString, ($params && $params['noSharedFolders']) ? "INBOX/*" : "*"); 
     1666                $folders_list = imap_getmailboxes($this->mbox, $serverString, ($params && $params['noSharedFolders']) ? "INBOX/*" : "*"); 
    16641667                $folders_list = array_slice($folders_list,0,$this->foldersLimit); 
    16651668 
     
    16741677                        $i = 0; 
    16751678                        while (list($key, $val) = each($folders_list)) { 
    1676                                 $status = imap_status($mbox_stream, $val->name, SA_UNSEEN); 
     1679                                $status = imap_status($this->mbox, $val->name, SA_UNSEEN); 
    16771680 
    16781681                                //$tmp_folder_id = explode("}", imap_utf7_decode($val->name)); 
     
    16801683                                if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') { 
    16811684                                        //error_log('passou', 3,'/tmp/imap_get_list.log'); 
    1682                                         //imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas')); 
     1685                                        //imap_deletemailbox($this->mbox, imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas')); 
    16831686                                        continue; 
    16841687                                } 
     
    32783281                $before_date = date("m/d/Y", strtotime("-".$params['before_date']." day")); 
    32793282                $criteria =  'BEFORE "'.$before_date.'"'; 
    3280                 $mbox_stream = $this->open_mbox('INBOX'.$this->imap_delimiter.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']); 
     3283                $trash_folder = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']; 
     3284                // Free others requests 
     3285                session_write_close(); 
     3286 
     3287                $mbox_stream = $this->open_mbox('INBOX'.$this->imap_delimiter.$trash_folder); 
    32813288                 
    32823289                // Free others requests 
Note: See TracChangeset for help on using the changeset viewer.