From 3cacf941fa30e8c02f3f7aebcc8747036d0d8d20 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 01 Jun 2011 09:44:51 -0400
Subject: [PATCH] - Add popup with basic fields selection for addressbook search

---
 program/include/rcmail.php |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index e2ce1bf..e93d546 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -333,7 +333,7 @@
         $this->memcache = false;
         return false;
       }
-      
+
       $this->memcache = new Memcache;
       $mc_available = 0;
       foreach ($this->config->get('memcache_hosts', array()) as $host) {
@@ -343,11 +343,11 @@
         if ($this->memcache->addServer($host, $port) && !$mc_available)
           $mc_available += intval($this->memcache->connect($host, $port));
       }
-      
+
       if (!$mc_available)
         $this->memcache = false;
     }
-    
+
     return $this->memcache;
   }
 
@@ -355,15 +355,17 @@
   /**
    * Initialize and get cache object
    *
-   * @param string $name Cache identifier
-   * @param string $type Cache type ('db' or 'memcache')
+   * @param string $name   Cache identifier
+   * @param string $type   Cache type ('db', 'apc' or 'memcache')
+   * @param int    $ttl    Expiration time for cache items in seconds
+   * @param bool   $packed Enables/disables data serialization
    *
    * @return rcube_cache Cache object
    */
-  public function get_cache($name, $type)
+  public function get_cache($name, $type='db', $ttl=0, $packed=true)
   {
     if (!isset($this->caches[$name])) {
-      $this->caches[$name] = new rcube_cache($type, $_SESSION['user_id'], $name.'.');
+      $this->caches[$name] = new rcube_cache($type, $_SESSION['user_id'], $name, $ttl, $packed);
     }
 
     return $this->caches[$name];
@@ -852,7 +854,7 @@
         $_SESSION['timezone'] = floatval($_REQUEST['_timezone']);
 
       // force reloading complete list of subscribed mailboxes
-      $this->imap->clear_cache('mailboxes');
+      $this->imap->clear_cache('mailboxes', true);
 
       return true;
     }
@@ -1124,6 +1126,11 @@
     if ($config['logout_expunge']) {
       $this->imap->expunge('INBOX');
     }
+
+    // Try to save unsaved user preferences
+    if (!empty($_SESSION['preferences'])) {
+      $this->user->save_prefs(unserialize($_SESSION['preferences']));
+    }
   }
 
 

--
Gitblit v1.9.1