Ignore:
Timestamp:
11/12/07 07:17:50 (16 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

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

    r95 r108  
    88        var $imap; 
    99         
     10        // usa o host e context do contact center. 
    1011        function ldapConnect($refer = false){ 
    1112                $this->ldap_host        = $_SESSION['phpgw_info']['expressomail']['ldap_server']['host']; 
     
    1718        } 
    1819 
     20        // usa o host e context do setup. 
    1921        function ldapRootConnect($refer = false){ 
    2022                $this->ldap_host        = $_SESSION['phpgw_info']['expressomail']['server']['ldap_host']; 
     
    3133                include_once("class.functions.inc.php"); 
    3234                $functions = new functions;                                              
    33                  
     35 
    3436                $search_for     = $params['search_for']; 
    3537                $field          = $params['field']; 
     
    4244                // follow the referral 
    4345                $this->ldapConnect(true); 
     46                 
    4447                if ($this->ds) 
    4548                { 
     
    6063                        if ($count_entries > 200) 
    6164                        { 
     65                                // Close old ldap conection 
     66                                ldap_close($this->ds); 
     67                                 
     68                                // Reopen a local ldap connection, following referral 
     69                                $this->ldapRootConnect(true); 
     70                                 
    6271                                $user_dn = $_SESSION['phpgw_info']['expressomail']['user']['account_dn']; 
    6372                                $user_sector_dn = ldap_explode_dn ( $user_dn, false ); 
     
    6877                                // New search only on user sector 
    6978                                $sr=ldap_search($this->ds, $user_sector_dn, $filter, $justthese); 
    70                         $count_entries = ldap_count_entries($this->ds,$sr); 
    71                         if ($count_entries > 200){ 
    72                                 $return = array(); 
    73                                 $return['status'] = false; 
    74                                 $return['error'] = "many results"; 
    75                                 return $return; 
    76                         } 
     79                                $count_entries = ldap_count_entries($this->ds,$sr); 
     80                                 
     81                                if ($count_entries > 200){ 
     82                                        $return = array(); 
     83                                        $return['status'] = false; 
     84                                        $return['error'] = "many results"; 
     85                                        return $return; 
     86                                } 
    7787                                else 
    7888                                { 
     
    158168                                                '</tr>'; 
    159169                                        $contacts_result = $head_option . $contacts_result; 
    160                         } 
    161                 } 
     170                                } 
     171                        } 
    162172                } 
    163173                ldap_close($this->ds); 
Note: See TracChangeset for help on using the changeset viewer.