From: Michael J. Rubinsky Date: Thu, 8 Jul 2010 18:20:49 +0000 (-0400) Subject: If default addressbook is not browsable, try one from the addressbook pref. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=840e1c7ffdb2fa6880e207de8d92bf4d6f7b77da;p=horde.git If default addressbook is not browsable, try one from the addressbook pref. Bug: 6536 --- 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,