浏览代码

fixed color problems with error messagees in compose.

Luke Ehresman 25 年之前
父节点
当前提交
6de839d69e
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 0 1
      functions/imap_mailbox.php
  2. 15 8
      src/compose.php

+ 0 - 1
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<BR>";
       $read_ary = sqimap_read_data($imap_stream, "a001", true, $response, $message);
       sqimap_unsubscribe ($imap_stream, $mailbox);
    }

+ 15 - 8
src/compose.php

@@ -255,32 +255,39 @@
       echo "</CENTER>";
    }
 
-   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 "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
          $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
          displayPageHeader($color, "None");
-
+         checkInput(true);
+         
          showInputForm();
       }
    } else if (isset($attach)) {