Browse Source

Restart the session after forward as attachment.
sqsession_is_active doesn't restart the session because it does a check on
session_id which isn't empty after a session_write_close.

stekkel 20 years ago
parent
commit
8126fb406f
2 changed files with 7 additions and 5 deletions
  1. 4 4
      src/right_main.php
  2. 3 1
      src/search.php

+ 4 - 4
src/right_main.php

@@ -254,8 +254,9 @@ if (isset($aMailbox['FORWARD_SESSION'])) {
         // write the session in order to make sure that the compose window has
         // access to the composemessages array which is stored in the session
         session_write_close();
-        sqsession_is_active();
-
+        // restart the session. Do not use sqsession_is_active because the session_id
+        // isn't empty after a session_write_close
+        session_start();
         if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
             $compose_width = '640';
         }
@@ -265,7 +266,7 @@ if (isset($aMailbox['FORWARD_SESSION'])) {
         // do not use &, it will break the query string and $session will not be detected!!!
         $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
                     '&session='.$aMailbox['FORWARD_SESSION'];
-        displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri', $compose_width, $compose_height);", false);
+        displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri', $compose_width, $compose_height);", '');
     } else {
         $mailbox_cache[$account.'_'.$aMailbox['NAME']] = $aMailbox;
         sqsession_register($mailbox_cache,'mailbox_cache');
@@ -281,7 +282,6 @@ if (isset($aMailbox['FORWARD_SESSION'])) {
     }
 } else {
     displayPageHeader($color, $mailbox);
-//    $compose_uri = $base_uri.'src/compose.php?newmessage=1';
 }
 
 do_hook('right_main_after_header');

+ 3 - 1
src/search.php

@@ -1354,7 +1354,9 @@ if (isset($aMailbox['FORWARD_SESSION'])) {
         // write the session in order to make sure that the compose window has
         // access to the composemessages array which is stored in the session
         session_write_close();
-        sqsession_is_active();
+        // restart the session. Do not use sqsession_is_active because the session_id
+        // isn't empty after a session_write_close
+        session_start();
 
         if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
             $compose_width = '640';