Purge IMP_Imap_Tree object from cache on logout
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Nov 2010 17:03:32 +0000 (10:03 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Nov 2010 23:11:12 +0000 (16:11 -0700)
imp/lib/Application.php

index 3f5373a..2678a04 100644 (file)
@@ -151,6 +151,12 @@ class IMP_Application extends Horde_Registry_Application
         foreach (array_keys($GLOBALS['session']->get('imp', 'compose_cache', Horde_Session::TYPE_ARRAY)) as $key) {
             $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($key)->destroy('cancel');
         }
+
+        /* No need to keep Tree object in cache - it will be recreated next
+         * login. */
+        if ($treeob = $GLOBALS['session']->get('imp', 'treeob')) {
+            $GLOBALS['injector']->getInstance('Horde_Cache')->expire($treeob);
+        }
     }
 
     /* Horde permissions. */