summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-08-26 10:28:34 +0200
committerAleksander Machniak <alec@alec.pl>2013-08-26 10:28:34 +0200
commit62350ba021d479e459cbbf7957841fbb440b9846 (patch)
treeed6209667488660bcf342983c4283cc7b5d249a0 /program/steps
parentcccf8a5b088654148bc080f3dcead92312019686 (diff)
Fix bugs when invoking contact creation form when read-only addressbook is selected (#1489296)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/edit.inc14
1 files changed, 6 insertions, 8 deletions
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index d175c05d9..7ddd3e516 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -43,16 +43,14 @@ if ($RCMAIL->action == 'edit') {
else {
$source = get_input_value('_source', RCUBE_INPUT_GPC);
- if (!strlen($source)) {
- // Give priority to configured default
- $source = $RCMAIL->config->get('default_addressbook');
+ if (strlen($source)) {
+ $CONTACTS = $RCMAIL->get_address_book($source, true);
}
- $CONTACTS = $RCMAIL->get_address_book($source, true);
-
- // find writable addressbook
- if (!$CONTACTS || $CONTACTS->readonly)
- $source = $RCMAIL->get_address_book(-1, true);
+ if (!$CONTACTS || $CONTACTS->readonly) {
+ $CONTACTS = $RCMAIL->get_address_book(-1, true);
+ $source = $RCMAIL->get_address_book_id($CONTACTS);
+ }
// Initialize addressbook
$CONTACTS = rcmail_contact_source($source, true);