Allow plugins to submit security token via GET request
[squirrelmail.git] / src / read_body.php
index 3b5ead8bca5fee0334c08a71ea1851ce77d675f3..ab3f7040bb759c247f93b9339b6f9f9340184e45 100644 (file)
@@ -6,7 +6,7 @@
  * This file is used for reading the msgs array and displaying
  * the resulting emails in the right frame.
  *
- * @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
@@ -554,7 +554,8 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,
                        '&mailbox='.$urlMailbox.'&sort='.$sort.
                        '&startMessage='.$startMessage.'&show_more=0'.
                        "&where=$where&what=$what" .
-                       '&delete_id='.$passed_id;
+                       '&delete_id='.$passed_id .
+                       '&smtoken='.sm_generate_security_token();
             }
 
             if ($next >= 0) {
@@ -562,7 +563,8 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,
                        '&mailbox='.$urlMailbox.'&sort='.$sort.
                        '&startMessage='.$startMessage.'&show_more=0'.
                        "&where=$where&what=$what" .
-                       '&delete_id='.$passed_id;
+                       '&delete_id='.$passed_id .
+                       '&smtoken='.sm_generate_security_token();
             }
         }
     }
@@ -628,8 +630,8 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,
 
     // If Draft folder - create Resume link
     $resume_draft = $edit_as_new = false;
-    if (($mailbox == $draft_folder) && ($save_as_draft)) {
-        $resume_draft = true; 'smaction_draft';
+    if (isDraftMailbox($mailbox) && ($save_as_draft)) {
+        $resume_draft = true;
     } else if (handleAsSent($mailbox)) {
         $edit_as_new = true;
     }