summaryrefslogtreecommitdiff
path: root/program/steps/addressbook
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-19 11:08:32 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-19 11:08:32 +0100
commit37557b5f086d64348a42dccaf922e541b87c2d13 (patch)
tree6764eb17cb50f2ec10c3508e5baa723fdcb48722 /program/steps/addressbook
parentac382e114570537e038eca79d2c8b90a4b95af12 (diff)
parent6459d86291d39879316694373e13d9e5e3129f5e (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r--program/steps/addressbook/func.inc18
1 files changed, 10 insertions, 8 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index cefe49e01..e42e26e1e 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -63,12 +63,6 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) {
// add list of address sources to client env
$js_list = $RCMAIL->get_address_sources();
- $source = get_input_value('_source', RCUBE_INPUT_GPC);
-
- // use first directory by default
- if (!strlen($source) || !isset($js_list[$source]))
- $source = $js_list[key($js_list)]['id'];
-
// count all/writeable sources
$writeable = 0;
$count = 0;
@@ -93,8 +87,16 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) {
$_SESSION['addressbooks_count'] = $count;
$_SESSION['addressbooks_count_writeable'] = $writeable;
- if (!strlen($source))
- $source = strval(key($js_list));
+ // select address book
+ $source = get_input_value('_source', RCUBE_INPUT_GPC);
+
+ // use first directory by default
+ if (!strlen($source) || !isset($js_list[$source])) {
+ $source = $RCMAIL->config->get('default_addressbook');
+ if (!strlen($source) || !isset($js_list[$source])) {
+ $source = strval(key($js_list));
+ }
+ }
$CONTACTS = rcmail_contact_source($source, true);
}