summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-04-21 13:44:14 +0000
committeralecpl <alec@alec.pl>2010-04-21 13:44:14 +0000
commit93c01888547210f54bd593d0774f9f63ec38f7a7 (patch)
tree3ce83c8f7f50c1482d686a1b6b7d5f344969c5ac
parentf3e1010090c0b3dbcbf04c6ad356a610637ba2a9 (diff)
- Add sizelimit and timelimit variables in LDAP config (#1486544)
-rw-r--r--CHANGELOG1
-rw-r--r--config/main.inc.php.dist5
-rw-r--r--program/include/rcube_ldap.php4
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 46224faae..f22025fb8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Add sizelimit and timelimit variables in LDAP config (#1486544)
- Hide IMAP host dropdown when single host is defined (#1486326)
- Add images pre-loading on login page (#1451160)
- Add HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR to successful logins log (#1486441)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 062a0c9b4..07f18730e 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -387,7 +387,10 @@ $rcmail_config['ldap_public']['Verisign'] = array(
'sort' => 'cn', // The field to sort the listing by.
'scope' => 'sub', // search mode: sub|base|list
'filter' => '', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act
- 'fuzzy_search' => true); // server allows wildcard search
+ 'fuzzy_search' => true // server allows wildcard search
+ 'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
+ 'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
+);
*/
// An ordered array of the ids of the addressbooks that should be searched
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 4cacd5232..04ccd6cb2 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -627,7 +627,9 @@ class rcube_ldap extends rcube_addressbook
$this->_debug("C: Search [".$filter."]");
- if ($this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0)) {
+ if ($this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $filter,
+ array_values($this->fieldmap), 0, (int) $this->prop['sizelimit'], (int) $this->prop['timelimit'])
+ ) {
$this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)");
return true;
} else