Do not log when using a limited query for a paged search operation

This commit is contained in:
Johannes Meyer 2015-02-04 10:50:17 +01:00
parent 8f9e970360
commit 12497749fc
1 changed files with 8 additions and 5 deletions

View File

@ -30,7 +30,8 @@ use Icinga\Data\ConfigObject;
*/ */
class Connection class Connection
{ {
const LDAP_NO_SUCH_OBJECT = 0x20; const LDAP_NO_SUCH_OBJECT = 32;
const LDAP_SIZELIMIT_EXCEEDED = 4;
protected $ds; protected $ds;
protected $hostname; protected $hostname;
@ -329,10 +330,12 @@ class Connection
ldap_control_paged_result_response($this->ds, $this->lastResult, $this->pageCookie); ldap_control_paged_result_response($this->ds, $this->lastResult, $this->pageCookie);
} catch (Exception $e) { } catch (Exception $e) {
$this->pageCookie = ''; $this->pageCookie = '';
Logger::debug( if (! $query->hasLimit() || ldap_errno($this->ds) !== static::LDAP_SIZELIMIT_EXCEEDED) {
'Unable to request paged LDAP results. Does the server allow paged search requests? (%s)', Logger::error(
$e->getMessage() 'Unable to request paged LDAP results. Does the server allow paged search requests? (%s)',
); $e->getMessage()
);
}
} }
ldap_free_result($this->lastResult); ldap_free_result($this->lastResult);