diff options
| author | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-02-02 02:33:01 +0000 |
|---|---|---|
| committer | till <till@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-02-02 02:33:01 +0000 |
| commit | 1d9016e9e5edfdf26d2549587206138659137ae6 (patch) | |
| tree | a2f6574309349f81f6bdf21b10730d4ca937dfe0 /roundcubemail/program | |
| parent | 8736e7025103f10d77eb2599cb759c07ea63690d (diff) | |
* compose.patch from #1483899
git-svn-id: https://svn.roundcube.net/trunk@987 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/steps/mail/compose.inc | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc index a705d65a1..c3063e373 100644 --- a/roundcubemail/program/steps/mail/compose.inc +++ b/roundcubemail/program/steps/mail/compose.inc @@ -870,19 +870,52 @@ $OUTPUT->add_handlers(array( /****** get contacts for this user and add them to client scripts ********/ require_once('include/rcube_contacts.inc'); +require_once('include/rcube_ldap.inc'); $CONTACTS = new rcube_contacts($DB, $USER->ID); $CONTACTS->set_pagesize(1000); + +$a_contacts = array(); if ($result = $CONTACTS->list_records()) -{ - $a_contacts = array(); +{ while ($sql_arr = $result->iterate()) if ($sql_arr['email']) $a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name'])); - - $OUTPUT->set_env('contacts', $a_contacts); } +/* LDAP autocompletion */ +foreach ($CONFIG['ldap_public'] as $ldapserv_config) + { + if ($ldapserv_config['fuzzy_search'] != 1) + { + continue; + } + + $LDAP = new rcube_ldap($ldapserv_config); + $LDAP->connect(); + $LDAP->set_pagesize(1000); + + $results = $LDAP->search($ldapserv_config['mail_field'], ""); + + for ($i = 0; $i < $results->count; $i++) + { + if ($results->records[$i]['email'] != '') + { + $email = $results->records[$i]['email']; + $name = $results->records[$i]['name']; + + $a_contacts[] = format_email_recipient($email, JQ($name)); + } + } + + $LDAP->close(); + } + + if ($a_contacts) + { + $OUTPUT->set_env('contacts', $a_contacts); + } + parse_template('compose'); -?> +?>
\ No newline at end of file |
