Changeset 5524 in subversion


Ignore:
Timestamp:
Dec 1, 2011 8:03:46 AM (18 months ago)
Author:
alec
Message:
  • Fix issue where "S: Error: Success" was printed to debug log
File:
1 edited

Legend:

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

    r5517 r5524  
    664664            $attrib = $count ? array('dn') : array_values($this->fieldmap); 
    665665            if ($result = @$func($this->conn, $m[1], $filter, 
    666                 $attrib, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit'])) 
    667             { 
     666                $attrib, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']) 
     667            ) { 
    668668                $this->_debug("S: ".ldap_count_entries($this->conn, $result)." record(s) for ".$m[1]); 
    669                 if ($err = ldap_errno($this->conn)) 
    670                     $this->_debug("S: Error: " .ldap_err2str($err)); 
    671             } 
    672             else 
    673             { 
     669            } 
     670            else { 
    674671                $this->_debug("S: ".ldap_error($this->conn)); 
    675672                return $group_members; 
     
    12361233            $attrs = $count ? array('dn') : array_values($this->fieldmap); 
    12371234            if ($this->ldap_result = @$function($this->conn, $this->base_dn, $filter, 
    1238                 $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit'])) 
    1239             { 
     1235                $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']) 
     1236            ) { 
    12401237                // when running on a patched PHP we can use the extended functions to retrieve the total count from the LDAP search result 
    1241                 if ($this->vlv_active && function_exists('ldap_parse_virtuallist_control') && 
    1242                     ldap_parse_result($this->conn, $this->ldap_result, $errcode, $matcheddn, $errmsg, $referrals, $serverctrls)) { 
    1243                     ldap_parse_virtuallist_control($this->conn, $serverctrls, $last_offset, $this->vlv_count, $vresult); 
    1244                     $this->_debug("S: VLV result: last_offset=$last_offset; content_count=$this->vlv_count"); 
     1238                if ($this->vlv_active && function_exists('ldap_parse_virtuallist_control')) { 
     1239                    if (ldap_parse_result($this->conn, $this->ldap_result, 
     1240                        $errcode, $matcheddn, $errmsg, $referrals, $serverctrls) 
     1241                    ) { 
     1242                        ldap_parse_virtuallist_control($this->conn, $serverctrls, 
     1243                            $last_offset, $this->vlv_count, $vresult); 
     1244                        $this->_debug("S: VLV result: last_offset=$last_offset; content_count=$this->vlv_count"); 
     1245                    } 
     1246                    else { 
     1247                        $this->_debug("S: ".($errmsg ? $errmsg : ldap_error($this->conn))); 
     1248                    } 
    12451249                } 
    12461250 
    1247                 $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)"); 
    1248                 if ($err = ldap_errno($this->conn)) 
    1249                     $this->_debug("S: Error: " .ldap_err2str($err)); 
    1250  
    1251                 return $count ? ldap_count_entries($this->conn, $this->ldap_result) : true; 
    1252             } 
    1253             else 
    1254             { 
     1251                $entries_count = ldap_count_entries($this->conn, $this->ldap_result); 
     1252                $this->_debug("S: $entries_count record(s)"); 
     1253 
     1254                return $count ? $entries_count : true; 
     1255            } 
     1256            else { 
    12551257                $this->_debug("S: ".ldap_error($this->conn)); 
    12561258            } 
Note: See TracChangeset for help on using the changeset viewer.