Allow override of mail_sent value by plugins
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 5 Feb 2007 23:23:42 +0000 (23:23 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 5 Feb 2007 23:23:42 +0000 (23:23 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12223 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index e774fd82b54e72ae4c661bcc3dd78e521f5ab62b..389ccd8337e99116b8e14640fff01ad515a748df 100644 (file)
@@ -492,10 +492,15 @@ if ($send) {
 
         $Result = deliverMessage($composeMessage);
 
+        if ($Result)
+            $mail_sent = 'yes';
+        else
+            $mail_sent = 'no';
+
         // NOTE: this hook changed in 1.5.2 from sending $Result and
         //       $composeMessage as args #2 and #3 to being in an array
         //       under arg #2
-        do_hook('compose_send_after', $temp=array(&$Result, &$composeMessage));
+        do_hook('compose_send_after', $temp=array(&$Result, &$composeMessage, &$mail_sent));
         if (! $Result) {
             showInputForm($session);
             exit();
@@ -523,21 +528,21 @@ if ($send) {
 
         if ($compose_new_win == '1') {
             if ( !isset($pageheader_sent) || !$pageheader_sent ) {
-                Header("Location: $location/compose.php?mail_sent=yes");
+                Header("Location: $location/compose.php?mail_sent=$mail_sent");
             } else {
                 echo '   <br><br><div style="text-align: center;"><a href="' . $location
-                    . '/compose.php?mail_sent=yes">'
+                    . '/compose.php?mail_sent=$mail_sent">'
                     . _("Return") . '</a></div>';
             }
             exit();
         } else {
             if ( !isset($pageheader_sent) || !$pageheader_sent ) {
                 Header("Location: $location/right_main.php?mailbox=$urlMailbox".
-                    "&startMessage=$startMessage&mail_sent=yes");
+                    "&startMessage=$startMessage&mail_sent=$mail_sent");
             } else {
                 echo '   <br><br><div style="text-align: center;"><a href="' . $location
                     . "/right_main.php?mailbox=$urlMailbox"
-                    . "&amp;startMessage=$startMessage&amp;mail_sent=yes\">"
+                    . "&amp;startMessage=$startMessage&amp;mail_sent=$mail_sent\">"
                     . _("Return") . '</a></div>';
             }
             exit();