summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-27 11:22:56 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-27 11:22:56 +0000
commitf665aaaffa4023cfc13980833634684c0524f427 (patch)
tree969b8fd2b2c79d23ef7d69b639e64442a7ea0278 /roundcubemail/program/steps/mail
parent46e72cb2f9b755139e3c0bb4cc34897ef1e754a3 (diff)
- Added option to specify to which address book add new contacts
git-svn-id: https://svn.roundcube.net/trunk@4811 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
-rw-r--r--roundcubemail/program/steps/mail/addcontact.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/addcontact.inc b/roundcubemail/program/steps/mail/addcontact.inc
index 0baf6cd63..57bc2a1c6 100644
--- a/roundcubemail/program/steps/mail/addcontact.inc
+++ b/roundcubemail/program/steps/mail/addcontact.inc
@@ -23,8 +23,16 @@
if (!$OUTPUT->ajax_call)
return;
-$done = false;
-$CONTACTS = $RCMAIL->get_address_book(null, true);
+$abook = $RCMAIL->config->get('default_addressbook');
+
+// Get configured addressbook
+$CONTACTS = $RCMAIL->get_address_book($abook, true);
+
+// Get first writeable addressbook if the configured doesn't exist
+// This can happen when user deleted the addressbook (e.g. Kolab folder)
+if ($abook !== null && !is_object($CONTACTS)) {
+ $CONTACTS = $RCMAIL->get_address_book(null, true);
+}
if (!empty($_POST['_address']) && is_object($CONTACTS))
{