From 1999f794461c6a9447e58bdcd89de98a72a9dfd1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 10 Jul 2013 12:24:49 +0200 Subject: [PATCH] Small improvement: do not fetch folders list when not needed --- plugins/kolab_delegation/kolab_delegation_engine.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php index 72ebe78d..9ce7ad45 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