Added some error correction on compose_send.php
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 7 Dec 1999 20:24:45 +0000 (20:24 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 7 Dec 1999 20:24:45 +0000 (20:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@69 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/display_messages.php
src/compose_send.php

index 4f8fd00..661cd27 100644 (file)
       echo "   </TD></TR>";
       echo "</TABLE>";
     }
+
+    function plain_error_message($message) {
+      echo "<BR>";
+      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=FFFFFF ALIGN=CENTER>";
+      echo "   <TR>";
+      echo "      <TD BGCOLOR=DCDCDC>";
+      echo "         <FONT FACE=\"Arial,Helvetica\" COLOR=CC0000><B><CENTER>ERROR</CENTER></B></FONT>";
+      echo "   </TD></TR><TR><TD>";
+      echo "      <CENTER><FONT FACE=\"Arial,Helvetica\"><BR>$message";
+      echo "      </FONT></CENTER>";
+      echo "   </TD></TR>";
+      echo "</TABLE>";
+    }
 ?>
index b3d6a79..4532f63 100644 (file)
@@ -1,15 +1,53 @@
 <HTML>
-<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=right_main.php">
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#0000EE" ALINK="#0000EE">
 <?
    include("../config/config.php");
    include("../functions/strings.php");
    include("../functions/page_header.php");
    include("../functions/mailbox.php");
    include("../functions/smtp.php");
+   include("../functions/display_messages.php");
+
+   if ($passed_to == "") {
+      echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
+      displayPageHeader("None");
+      plain_error_message("You have not filled in the \"To:\" field.");
+      echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
+
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_subject\" NAME=passed_subject><BR>";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_cc\" NAME=passed_cc><BR>";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_bcc\" NAME=passed_bcc><BR>";
+      echo "<CENTER><FONT FACE=\"Arial,Helvetica\">To: </FONT><INPUT TYPE=TEXT NAME=passed_to SIZE=60><BR>";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_body\" NAME=passed_body><BR>";
+      echo "<INPUT TYPE=SUBMIT VALUE=\"Send\">";
+      echo "</CENTER></FORM>\n";
+
+      exit;
+
+      echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
+      displayPageHeader("None");
+      plain_error_message("Message NOT sent<BR><BR>You have not entered anything into the To: field.<BR>Press the BACK button on your browser");
+      exit;
+   } else if ($passed_subject == "") {
+      echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
+      displayPageHeader("None");
+      plain_error_message("You have not entered a subject.");
+      echo "<FORM action=\"compose_send.php\" METHOD=POST>\n";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_cc\" NAME=passed_cc><BR>";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_bcc\" NAME=passed_bcc><BR>";
+      echo "<CENTER><FONT FACE=\"Arial,Helvetica\">Subject: </FONT><INPUT TYPE=TEXT NAME=passed_subject SIZE=60 VALUE=\"(no subject)\"><BR>";
+      echo "<INPUT TYPE=HIDDEN VALUE=\"$passed_body\" NAME=passed_body><BR>";
+      echo "<INPUT TYPE=SUBMIT VALUE=\"Send\">";
+      echo "</CENTER></FORM>\n";
+
+      exit;
+   }
 
    sendMessage($smtpServerAddress, $smtpPort, $username, $domain, $passed_to, $passed_cc, $passed_bcc, $passed_subject, $passed_body, $version);
 
+   echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=right_main.php\">";
+   echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
+
+   displayPageHeader("None");
    echo "<FONT FACE=\"Arial,Helvetica\">";
    echo "<BR><BR><BR><CENTER><B>Message Sent!</B><BR><BR>";
    echo "You will be automatically forwarded.<BR>If not, <A HREF=\"right_main.php\">click here</A>";