summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/save.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-07-27 13:42:15 +0000
committeralecpl <alec@alec.pl>2011-07-27 13:42:15 +0000
commit70c31118264e447699d4ed628f45b7853799423d (patch)
tree1405a48f5ea135c8370839057a0ba54255289936 /program/steps/addressbook/save.inc
parent5ed119e5341a9c1225bbb40c6e3d6ea787ca17ed (diff)
- Fix fallback to default source (#1488009)
Diffstat (limited to 'program/steps/addressbook/save.inc')
-rw-r--r--program/steps/addressbook/save.inc11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index d5d4537f6..599c2f6a6 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -19,11 +19,10 @@
*/
-$CONTACTS = rcmail_contact_source(null, true);
+$CONTACTS = rcmail_contact_source(null, true, true);
$cid = get_input_value('_cid', RCUBE_INPUT_POST);
$return_action = empty($cid) ? 'add' : 'edit';
-
// Source changed, display the form again
if (!empty($_GET['_reload'])) {
rcmail_overwrite_action($return_action);
@@ -220,6 +219,11 @@ if (!empty($cid))
// insert a new contact
else {
$source = get_input_value('_source', RCUBE_INPUT_GPC);
+ // Name of the addressbook already selected on the list
+ $orig_source = get_input_value('_orig_source', RCUBE_INPUT_GPC);
+
+ if (!strlen($source))
+ $source = $orig_source;
// show notice if existing contacts with same e-mail are found
$existing = false;
@@ -254,9 +258,6 @@ else {
}
}
- // Name of the addressbook already selected on the list
- $orig_source = get_input_value('_orig_source', RCUBE_INPUT_GPC);
-
if ((string)$source === (string)$orig_source) {
// add contact row or jump to the page where it should appear
$CONTACTS->reset();