summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-06 08:58:59 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-06 08:58:59 +0200
commitb07426f0c55f2fd2126dd2080e6a89bd334017f9 (patch)
treed81c9f5e6b9771ffbea762e07b78a03cb170b0c5
parentf65890773147ee513647b0e0062e05748bd788c9 (diff)
Make LDAP cache engine configurable via ldap_cache and ldap_cache_ttl options
-rw-r--r--CHANGELOG1
-rw-r--r--config/main.inc.php.dist19
-rw-r--r--program/lib/Roundcube/rcube_ldap.php8
3 files changed, 21 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2ecda0648..a125ad697 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Make LDAP cache engine configurable via ldap_cache and ldap_cache_ttl options
- Fix legacy options handling
- Fix "duplicate entry" errors on inserts to imap cache tables (#1489146)
- Fix so bounces addresses in Sender headers are skipped on Reply-All (#1489011)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 709e5cdac..4cf94c7f8 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -128,6 +128,9 @@ $rcmail_config['imap_cache'] = null;
// Enables messages cache. Only 'db' cache is supported.
$rcmail_config['messages_cache'] = false;
+// lifetime of message cache
+// possible units: s, m, h, d, w
+$rcmail_config['message_cache_lifetime'] = '10d';
// ----------------------------------
// SMTP
@@ -170,13 +173,23 @@ $rcmail_config['smtp_auth_pw'] = null;
// SMTP HELO host
// Hostname to give to the remote server for SMTP 'HELO' or 'EHLO' messages
// Leave this blank and you will get the server variable 'server_name' or
-// localhost if that isn't defined.
+// localhost if that isn't defined.
$rcmail_config['smtp_helo_host'] = '';
// SMTP connection timeout, in seconds. Default: 0 (no limit)
$rcmail_config['smtp_timeout'] = 0;
// ----------------------------------
+// LDAP
+// ----------------------------------
+
+// Type of LDAP cache. Supported values: 'db', 'apc' and 'memcache'.
+$rcmail_config['ldap_cache'] = 'db';
+
+// Lifetime of LDAP cache. Possible units: s, m, h, d, w
+$rcmail_config['ldap_cache_ttl'] = '10m';
+
+// ----------------------------------
// SYSTEM
// ----------------------------------
@@ -210,10 +223,6 @@ $rcmail_config['log_dir'] = 'logs/';
// use this folder to store temp files (must be writeable for apache user)
$rcmail_config['temp_dir'] = 'temp/';
-// lifetime of message cache
-// possible units: s, m, h, d, w
-$rcmail_config['message_cache_lifetime'] = '10d';
-
// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 70163b21c..39a48b456 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -185,8 +185,12 @@ class rcube_ldap extends rcube_addressbook
$this->mail_domain = $mail_domain;
// initialize cache
- $rcube = rcube::get_instance();
- $this->cache = $rcube->get_cache('LDAP.' . asciiwords($this->prop['name']), 'db', 600);
+ $rcube = rcube::get_instance();
+ $cache_type = $rcube->config->get('ldap_cache', 'db');
+ $cache_ttl = $rcube->config->get('ldap_cache_ttl', '10m');
+ $cache_name = 'LDAP.' . asciiwords($this->prop['name']);
+
+ $this->cache = $rcube->get_cache($cache_name, $cache_type, $cache_ttl);
$this->_connect();
}