diff options
| author | richs <richs@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-07 22:16:00 +0000 |
|---|---|---|
| committer | richs <richs@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-07 22:16:00 +0000 |
| commit | 51c6e989dc939b140637b0e04776e7af85221d22 (patch) | |
| tree | f9b1edc20bf0ac71060cd8b7177983ea48307ab9 /roundcubemail/program/steps/mail | |
| parent | b45dc036d214d3cfb0f320921f510f6b85c9fdac (diff) | |
/tmp/out
git-svn-id: https://svn.roundcube.net/trunk@1361 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
| -rw-r--r-- | roundcubemail/program/steps/mail/addcontact.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/addcontact.inc b/roundcubemail/program/steps/mail/addcontact.inc index 0ad10313b..6f4187ba4 100644 --- a/roundcubemail/program/steps/mail/addcontact.inc +++ b/roundcubemail/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 +?> |
