diff options
-rw-r--r-- | apps/user_ldap/user_ldap.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 2b789198014..69e470c78a7 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -112,7 +112,10 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface { return $ldap_users; } - //prepare search filter + // if we'd pass -1 to LDAP search, we'd end up in a Protocol error. With a limit of 0, we get 0 results. So we pass null. + if($limit <= 0) { + $limit = null; + } $search = empty($search) ? '*' : '*'.$search.'*'; $filter = $this->combineFilterWithAnd(array( $this->connection->ldapUserFilter, |