add labels to login page
[squirrelmail.git] / src / addressbook.php
index 214a6f8fd8fb8b51fea2f6a66cea970d6afe5ac6..3a7977f9c4a75819e963145c4f1a1b5751fee258 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Manage personal address book.
  *
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright © 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -49,8 +49,12 @@ if (!sqGetGlobalVar('show_all', $show_all, SQ_FORM))
 /* Get sorting order */
 $abook_sort_order = get_abook_sort();
 
-/* Create page header before addressbook_init in order to  display error messages correctly. */
-displayPageHeader($color);
+// Create page header before addressbook_init in order to
+// display error messages correctly, unless we might be
+// redirecting the browser to the compose page.
+//
+if ((empty($compose_to)) || sizeof($sel) < 1)
+    displayPageHeader($color);
 
 /* Open addressbook with error messages on.
  remote backends (LDAP) are enabled because they can be used. (list_addr function)
@@ -194,6 +198,9 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P
             if ($lookup_failed || empty($send_to)) {
                 $showaddrlist = true;
                 $defselected  = $sel;
+
+                // we skipped the page header above for this functionality, so add it here
+                displayPageHeader($color);
             }