From 4f9c8337420327802baf73cde7d96b991b1fd1a9 Mon Sep 17 00:00:00 2001 From: svncommit Date: Wed, 7 May 2008 22:16:00 +0000 Subject: /tmp/out --- program/steps/mail/addcontact.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc index 0ad10313b..6f4187ba4 100644 --- a/program/steps/mail/addcontact.inc +++ b/program/steps/mail/addcontact.inc @@ -23,7 +23,19 @@ $done = false; if (!empty($_POST['_address'])) { - $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); + $CONTACTS = array(); + if (!$CONFIG["use_SQL_address_book"]) { + // Use the first writable LDAP address book. + foreach ($CONFIG["ldap_public"] as $id => $prop) { + if ($prop["writable"]) { + $CONTACTS = new rcube_ldap($prop); + break; + } // end if + } // end foreach + } // end if + else { + $CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']); + } // end else $contact_arr = $IMAP->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false); if (!empty($contact_arr[1]['mailto'])) @@ -50,4 +62,4 @@ if (!$done) $OUTPUT->show_message('errorsavingcontact', 'warning'); $OUTPUT->send(); -?> \ No newline at end of file +?> -- cgit v1.2.3