From 0ad7dbda6b8c49dcc2de6d52fc27ff26c915a674 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Fri, 24 Mar 2000 12:24:47 +0000 Subject: [PATCH] fixed color problems with error messagees in compose. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@329 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 1 - src/compose.php | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index f92a6184..963f7d43 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -83,7 +83,6 @@ ******************************************************************************/ function sqimap_mailbox_delete ($imap_stream, $mailbox) { fputs ($imap_stream, "a001 DELETE \"$mailbox\"\r\n"); - echo "mailbox: $mailbox
"; $read_ary = sqimap_read_data($imap_stream, "a001", true, $response, $message); sqimap_unsubscribe ($imap_stream, $mailbox); } diff --git a/src/compose.php b/src/compose.php index 3571c55e..000eb0f0 100644 --- a/src/compose.php +++ b/src/compose.php @@ -255,32 +255,39 @@ echo ""; } - function checkInput () { - global $body, $send_to, $subject; + function checkInput ($show) { + /** I implemented the $show variable because the error messages + were getting sent before the page header. So, I check once + using $show=false, and then when i'm ready to display the + error message, show=true **/ + global $body, $send_to, $subject, $color; if ($body == "") { - plain_error_message(_("You have not entered a message body."), $color); + if ($show) + plain_error_message(_("You have not entered a message body."), $color); return false; } else if ($send_to == "") { - displayPageHeader($color, "None"); - plain_error_message(_("You have not filled in the \"To:\" field."), $color); + if ($show) + plain_error_message(_("You have not filled in the \"To:\" field."), $color); return false; } else if ($subject == "") { - plain_error_message(_("You have not entered a subject."), $color); + if ($show) + plain_error_message(_("You have not entered a subject."), $color); return false; } return true; } // function checkInput() if(isset($send)) { - if (checkInput()) { + if (checkInput(false)) { sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body); header ("Location: right_main.php"); } else { echo "\n"; $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); displayPageHeader($color, "None"); - + checkInput(true); + showInputForm(); } } else if (isset($attach)) { -- 2.25.1