Addressbook Fix. This code was suppose to allow the user to select
authorcigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 26 Mar 2004 14:23:07 +0000 (14:23 +0000)
committercigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 26 Mar 2004 14:23:07 +0000 (14:23 +0000)
whether to have the fullname, nickname, ect... returned from the addressbook to
the the compose screen, but it was not working at all.  Granted we do not have
an option for this yet either, but that will follow fairly quickly.

Thanks to William Bishop

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6904 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/addressbook.php

index ef757cf6e78fe39d8cd097701165c221f9b19fd8..f5e6351ee1f094704f914c3da3eef3b7e4d05184 100644 (file)
@@ -213,12 +213,10 @@ class AddressBook {
 
     function full_address($row) {
         global $addrsrch_fullname, $data_dir, $username;
-
-        if (($prefix = getPref($data_dir, $username, 'addrsrch_fullname') or
-            isset($addrsrch_fullname) and $prefix = $addrsrch_fullname)
-            and $prefix !== 'noprefix') {
-            $name = ($prefix === 'nickname') ? $row['nickname']
-                : $row['name'];
+        $prefix = getPref($data_dir, $username, 'addrsrch_fullname');
+        if (($prefix != "" || (isset($addrsrch_fullname) &&
+            $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') {
+            $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']);
             return $name . ' <' . trim($row['email']) . '>';
         } else {
             return trim($row['email']);