- 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,18 +403,28 @@ class rcmail
if ($plugin['instance'] instanceof rcube_addressbook) {
$contacts = $plugin['instance'];
}
else if ($abook_type == 'ldap') {
// Use the first writable LDAP address book.
foreach ($ldap_config as $id => $prop) {
if (!$writeable || $prop['writable']) {
$contacts = new rcube_ldap($prop, $this->config->get('ldap_debug'), $this->config->mail_domain($_SESSION['imap_host']));
break;
else if (!$id) {
if ($abook_type == 'ldap') {
// Use the first writable LDAP address book.
foreach ($ldap_config as $id => $prop) {
if (!$writeable || $prop['writable']) {
$contacts = new rcube_ldap($prop, $this->config->get('ldap_debug'), $this->config->mail_domain($_SESSION['imap_host']));
break;
}
}
}
else { // $id == 'sql'
$contacts = new rcube_contacts($this->db, $this->user->ID);
}
}
else { // $id == 'sql'
$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

Loading…
Cancel
Save