- Fix sources list if 'ldap_public' is null/false

release-0.6
alecpl 15 years ago
parent 44155cddc2
commit 7fdb9da98e

@ -292,8 +292,8 @@ class rcmail
public function get_address_sources($writeable = false) public function get_address_sources($writeable = false)
{ {
$abook_type = strtolower($this->config->get('address_book_type')); $abook_type = strtolower($this->config->get('address_book_type'));
$ldap_config = (array)$this->config->get('ldap_public'); $ldap_config = $this->config->get('ldap_public');
$autocomplete = (array)$this->config->get('autocomplete_addressbooks'); $autocomplete = (array) $this->config->get('autocomplete_addressbooks');
$list = array(); $list = array();
// We are using the DB address book // We are using the DB address book
@ -308,7 +308,8 @@ class rcmail
); );
} }
if (is_array($ldap_config)) { if ($ldap_config) {
$ldap_config = (array) $ldap_config;
foreach ($ldap_config as $id => $prop) foreach ($ldap_config as $id => $prop)
$list[$id] = array( $list[$id] = array(
'id' => $id, 'id' => $id,
@ -329,7 +330,7 @@ class rcmail
} }
} }
} }
return $list; return $list;
} }

Loading…
Cancel
Save