- Don't use default source if source id is specified in get_address_source()

release-0.6
alecpl 13 years ago
parent 64ebc94eec
commit 5ed119e534

@ -403,7 +403,8 @@ class rcmail
if ($plugin['instance'] instanceof rcube_addressbook) {
$contacts = $plugin['instance'];
}
else if ($abook_type == 'ldap') {
else if (!$id) {
if ($abook_type == 'ldap') {
// Use the first writable LDAP address book.
foreach ($ldap_config as $id => $prop) {
if (!$writeable || $prop['writable']) {
@ -416,6 +417,15 @@ class rcmail
$contacts = new rcube_contacts($this->db, $this->user->ID);
}
}
}
if (!$contacts) {
raise_error(array(
'code' => 600, 'type' => 'php',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Addressbook source ($id) not found!"),
true, true);
}
// add to the 'books' array for shutdown function
if (!isset($this->address_books[$id]))

Loading…
Cancel
Save