Ignore:
Timestamp:
05/17/12 16:26:49 (12 years ago)
Author:
niltonneto
Message:

Ticket #2507 - Corrigido problema de performance ocasionado pelo ldap_connect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/adapters/CatalogAdapter.php

    r6149 r6225  
    4545                $ldap_context = $_SESSION['phpgw_info']['expressomail']['ldap_server']['dn']; 
    4646                $justthese = array("dn", 'jpegPhoto','givenName', 'sn');  
    47                 $this->getLdapCatalog()->ldapConnect(true); 
    4847                $ds = $this->getLdapCatalog()->ds; 
    4948                if ($ds){ 
     
    9493                $params = array ("search_for" => $search); 
    9594                $result = $this->getLdapCatalog()->quicksearch($params); 
    96  
     95                // Reconnect for searching other attributes. 
     96                $this->getLdapCatalog()->ldapConnect(true); 
    9797                foreach($result as $i => $row) { 
    9898                        if(is_int($i)) { 
     
    106106                                ); 
    107107                                // Buscar atributos faltantes.  
    108                                 if(is_array($this->getUserLdapAttrs($result[$i]['mail']))) 
    109                                         $contacts[$i] = array_merge($this->getUserLdapAttrs($result[$i]['mail']), $contacts[$i]);                                
     108                                $otherAttrs = $this->getUserLdapAttrs($result[$i]['mail']); 
     109                                if(is_array($otherAttrs)) 
     110                                        $contacts[$i] = array_merge($otherAttrs, $contacts[$i]);                                 
    110111                        } 
    111112                } 
     113                // Force ldap close 
     114                ldap_close($this->getLdapCatalog()->ds);                 
    112115                $result = array ('contacts' => $contacts); 
    113116                $this->setResult($result); 
Note: See TracChangeset for help on using the changeset viewer.