plugins/kolab_delegation

Aleksander Machniak machniak at kolabsys.com
Wed Jul 10 12:25:23 CEST 2013


 plugins/kolab_delegation/kolab_delegation_engine.php |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 1999f794461c6a9447e58bdcd89de98a72a9dfd1
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Wed Jul 10 12:24:49 2013 +0200

    Small improvement: do not fetch folders list when not needed

diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php
index 72ebe78..9ce7ad4 100644
--- a/plugins/kolab_delegation/kolab_delegation_engine.php
+++ b/plugins/kolab_delegation/kolab_delegation_engine.php
@@ -577,15 +577,18 @@ class kolab_delegation_engine
         //  c) remove all other identities which do not match the user's primary
         //       or alias email if 'kolab_delegation_purge_identities' is set.
 
-        $storage    = $this->rc->get_storage();
         $delegators = $this->list_delegators();
-        $other_ns   = $storage->get_namespace('other');
-        $folders    = $storage->list_folders();
         $use_subs   = $this->rc->config->get('kolab_use_subscriptions');
         $identities = $this->user_identities();
         $emails     = array();
         $uids       = array();
 
+        if (!empty($delegators)) {
+            $storage  = $this->rc->get_storage();
+            $other_ns = $storage->get_namespace('other');
+            $folders  = $storage->list_folders();
+        }
+
         // convert identities to simpler format for faster access
         foreach ($identities as $idx => $ident) {
             // get user name from default identity




More information about the commits mailing list