diff -urN ../z-push-2.6.4+0.orig/src/backend/searchldap/searchldap.php ./src/backend/searchldap/searchldap.php --- ../z-push-2.6.4+0.orig/src/backend/searchldap/searchldap.php 2021-06-25 11:55:30.000000000 +0300 +++ ./src/backend/searchldap/searchldap.php 2023-09-26 19:47:17.329434000 +0300 @@ -121,6 +121,7 @@ if (isset($this->connection) && $this->connection !== false) { $searchfilter = str_replace("SEARCHVALUE", $searchquery, LDAP_SEARCH_FILTER); + ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendSearchLDAP: Try apply search filter '%s'; search range: %s", $searchfilter, $searchrange)); $result = @ldap_search($this->connection, LDAP_SEARCH_BASE, $searchfilter); if (!$result) { ZLog::Write(LOGLEVEL_ERROR, "BackendSearchLDAP: Error in search query. Search aborted"); @@ -131,6 +132,7 @@ // TODO the limiting of the searchresults could be refactored into Utils as it's probably used more than once $querycnt = $searchresult['count']; + ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendSearchLDAP: Result(s) found: %d", $querycnt)); //do not return more results as requested in range $querylimit = (($rangeend + 1) < $querycnt) ? ($rangeend + 1) : $querycnt; $items['range'] = $rangestart . '-' . ($querylimit-1); @@ -158,6 +160,8 @@ } } + ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendSearchLDAP: Items returned: %d", count($items) - 2)); + ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendSearchLDAP: Items returned:\n%s", print_r($items, true))); return $items; }