From 1aecba700bd67f03dbddadc67fc8f8326d69abd7 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 19 Feb 2009 23:34:11 +0000 Subject: [PATCH] Allow multiple addresses in one abook entry (separate with commas), although we HIGHLY DISCOURAGE grouping in this manner - note amongst other issues that can come up, sizing for large groups will be a problem git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13407 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/addressbook.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/functions/addressbook.php b/functions/addressbook.php index 905e630a..d260258a 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -516,12 +516,26 @@ class AddressBook { function full_address($row) { global $data_dir, $username; $addrsrch_fullname = getPref($data_dir, $username, 'addrsrch_fullname'); - if ($addrsrch_fullname == 'fullname') - return '"' . $row['name'] . '" <' . trim($row['email']) . '>'; - else if ($addrsrch_fullname == 'nickname') - return '"' . $row['nickname'] . '" <' . trim($row['email']) . '>'; - else // "noprefix" - return trim($row['email']); + + // allow multiple addresses in one row (poor person's grouping - bah) + // (separate with commas) + // + $return = ''; + $addresses = explode(',', $row['email']); + foreach ($addresses as $address) { + + if (!empty($return)) $return .= ', '; + + if ($addrsrch_fullname == 'fullname') + $return .= '"' . $row['name'] . '" <' . trim($address) . '>'; + else if ($addrsrch_fullname == 'nickname') + $return .= '"' . $row['nickname'] . '" <' . trim($address) . '>'; + else // "noprefix" + $return .= trim($address); + + } + + return $return; } /** -- 2.25.1