From 111a6fc31457e0efa8276e58aeb7632a64a32cbf Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 31 Mar 2011 06:07:15 +0000 Subject: - Add info about indexcontacts.sh script in upgrade procedure --- UPGRADING | 14 ++++++++++---- program/steps/mail/autocomplete.inc | 9 ++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/UPGRADING b/UPGRADING index f20364345..88e9c53f8 100644 --- a/UPGRADING +++ b/UPGRADING @@ -3,12 +3,13 @@ UPGRADING instructions Follow these instructions if upgrading from a previous version of Roundcube Webmail. We recommend to carefully backup the existing -installation as well as the database before executig the following steps. +installation as well as the database before going through the following steps. Using the update script ----------------------- There is a shell script (for unix based systems) that does the job for you. -To use it, unpack the archive of the new Roundcube version to a temporary location (don't replace the Roundcube installation you want to update) +To use it, unpack the archive of the new Roundcube version to a temporary location +(don't replace the Roundcube installation you want to update) and cd into that directory. From there, run the following command in a shell: ./bin/installto.sh @@ -18,11 +19,12 @@ which should be updated. The update script will then copy all new files to the target location and check and update the configuration and database schema. After all is done, the temporary folder with the new Roundcube files can be removed again. +See Post-Upgrade Activities section. Updating manually ----------------- -If you don't have shell access to the Roundcube instalaltion or if not running +If you don't have shell access to the Roundcube installation or if not running it on a unix system, you need to do the following operations by hand: 1. Replace index.php and all files in @@ -39,6 +41,10 @@ it on a unix system, you need to do the following operations by hand: 3. Let the update script/installer check your configuration and update your config files and database schema as suggested by the updater. 4. Make sure 'enable_installer' is set to false again. -5. Check .htaccess settings (some php settings could become required) +5. See Post-Upgrade Activities section. +Post-Upgrade Activities +----------------------- +1. Check .htaccess settings (some php settings could become required) +2. If you're using build-in addressbook, run indexing script /bin/indexcontacts.sh. diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc index 36542caec..85f3cf352 100644 --- a/program/steps/mail/autocomplete.inc +++ b/program/steps/mail/autocomplete.inc @@ -47,8 +47,15 @@ else if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_GPC, tr if ($result = $abook->search(array('email','name'), $search, false, true, true, 'email')) { while ($sql_arr = $result->iterate()) { - foreach ((array)$abook->get_col_values('email', $sql_arr, true) as $email) { + // Contact can have more than one e-mail address + $email_arr = (array)$abook->get_col_values('email', $sql_arr, true); + $email_cnt = count($email_arr); + foreach ($email_arr as $email) { $contact = format_email_recipient($email, $sql_arr['name']); + // skip entries that don't match + if ($email_cnt > 1 && strpos($contact, $search) === false) { + continue; + } // when we've got more than one book, we need to skip duplicates if ($books_num == 1 || !in_array($contact, $contacts)) { $contacts[] = $contact; -- cgit v1.2.3