Changeset 5356 in subversion


Ignore:
Timestamp:
Oct 19, 2011 11:56:20 AM (19 months ago)
Author:
thomasb
Message:

Add (experimental) support for some extendted PHP LDAP functions when querying VLV enabled directories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_ldap.php

    r5349 r5356  
    11521152                    $this->_debug("D: total numsubordinates = " . $this->vlv_count); 
    11531153                } 
    1154                 else // ...or by fetching all records dn and count them 
     1154                else if (!function_exists('ldap_parse_virtuallist_control')) // ...or by fetching all records dn and count them 
    11551155                    $this->vlv_count = $this->_exec_search(true); 
    11561156 
     
    11631163                $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit'])) 
    11641164            { 
     1165                // when running on a patched PHP we can use the extended functions to retrieve the total count from the LDAP search result 
     1166                if ($this->vlv_active && function_exists('ldap_parse_virtuallist_control') && 
     1167                    ldap_parse_result($this->conn, $this->ldap_result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls)) { 
     1168                    ldap_parse_virtuallist_control($this->conn, $serverctrls, $last_offset, $this->vlv_count, $vresult); 
     1169                    $this->_debug("S: VLV result: last_offset=$last_offset; content_count=$this->vlv_count"); 
     1170                } 
     1171 
    11651172                $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)"); 
    11661173                if ($err = ldap_errno($this->conn)) 
    11671174                    $this->_debug("S: Error: " .ldap_err2str($err)); 
     1175 
    11681176                return $count ? ldap_count_entries($this->conn, $this->ldap_result) : true; 
    11691177            } 
Note: See TracChangeset for help on using the changeset viewer.