Allow multiple addresses in one abook entry (separate with commas), although we HIGHL...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 19 Feb 2009 23:34:11 +0000 (23:34 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 19 Feb 2009 23:34:11 +0000 (23:34 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13407 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/addressbook.php

index 905e630af022cff95b0779e62d915f09877828c5..d260258aeb3a6dccd7ae2c835f4fe51e69abd9b1 100644 (file)
@@ -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;
     }
 
     /**