From 840e1c7ffdb2fa6880e207de8d92bf4d6f7b77da Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 8 Jul 2010 14:20:49 -0400 Subject: [PATCH] If default addressbook is not browsable, try one from the addressbook pref. Bug: 6536 --- turba/browse.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/turba/browse.php b/turba/browse.php index e152e4219..b65fbfe3e 100644 --- a/turba/browse.php +++ b/turba/browse.php @@ -14,6 +14,17 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('turba'); +/* If default source is not browsable, try one from the addressbooks pref */ +if (empty($cfgSources[$default_source]['browse'])) { + $addressbooks = Horde_Serialize::unserialize($prefs->getValue('addressbooks'), Horde_Serialize::JSON); + foreach ($addressbooks as $source) { + if (!empty($cfgSources[$source]['browse'])) { + $default_source = $source; + break; + } + } +} + $params = array( 'vars' => Horde_Variables::getDefaultVariables(), 'prefs' => &$prefs, -- 2.11.0