From b07426f0c55f2fd2126dd2080e6a89bd334017f9 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Thu, 06 Jun 2013 02:58:59 -0400
Subject: [PATCH] Make LDAP cache engine configurable via ldap_cache and ldap_cache_ttl options

---
 program/lib/Roundcube/rcube_ldap.php |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 70163b2..39a48b4 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -185,8 +185,12 @@
         $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();
     }

--
Gitblit v1.9.1