Changeset 108 for trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
- Timestamp:
- 11/12/07 07:17:50 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
r95 r108 8 8 var $imap; 9 9 10 // usa o host e context do contact center. 10 11 function ldapConnect($refer = false){ 11 12 $this->ldap_host = $_SESSION['phpgw_info']['expressomail']['ldap_server']['host']; … … 17 18 } 18 19 20 // usa o host e context do setup. 19 21 function ldapRootConnect($refer = false){ 20 22 $this->ldap_host = $_SESSION['phpgw_info']['expressomail']['server']['ldap_host']; … … 31 33 include_once("class.functions.inc.php"); 32 34 $functions = new functions; 33 35 34 36 $search_for = $params['search_for']; 35 37 $field = $params['field']; … … 42 44 // follow the referral 43 45 $this->ldapConnect(true); 46 44 47 if ($this->ds) 45 48 { … … 60 63 if ($count_entries > 200) 61 64 { 65 // Close old ldap conection 66 ldap_close($this->ds); 67 68 // Reopen a local ldap connection, following referral 69 $this->ldapRootConnect(true); 70 62 71 $user_dn = $_SESSION['phpgw_info']['expressomail']['user']['account_dn']; 63 72 $user_sector_dn = ldap_explode_dn ( $user_dn, false ); … … 68 77 // New search only on user sector 69 78 $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 } 77 87 else 78 88 { … … 158 168 '</tr>'; 159 169 $contacts_result = $head_option . $contacts_result; 160 }161 }170 } 171 } 162 172 } 163 173 ldap_close($this->ds);
Note: See TracChangeset
for help on using the changeset viewer.