summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2008-05-07 22:16:00 +0000
committersvncommit <devs@roundcube.net>2008-05-07 22:16:00 +0000
commit4f9c8337420327802baf73cde7d96b991b1fd1a9 (patch)
tree4b3e49ee7f75a2f2c544d93a3777570f4ff07659 /program/steps/mail
parent1854c4525bf1fce227a8cc0fa8aad06615df0eae (diff)
/tmp/out
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc16
1 files changed, 14 insertions, 2 deletions
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
+?>