- added a bunch of sqimap_logout's where none existed
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Jul 2000 11:13:09 +0000 (11:13 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 Jul 2000 11:13:09 +0000 (11:13 +0000)
- deleting/moving takes you right back where you were
- Folders section is handled better, removed notification screens
- The options "cc" and "to and cc" were added to message highlighting

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@603 7612ce4b-ef26-0410-bec9-ea0150e637f0

21 files changed:
AUTHORS
functions/display_messages.php
functions/imap_messages.php
functions/mailbox_display.php
functions/mime.php
functions/smtp.php
functions/strings.php
index.php
src/compose.php
src/delete_message.php
src/folders.php
src/folders_create.php
src/folders_delete.php
src/folders_rename_do.php
src/folders_subscribe.php
src/left_main.php
src/move_messages.php
src/options_folder.php
src/options_highlight.php
src/read_body.php
src/webmail.php

diff --git a/AUTHORS b/AUTHORS
index 1b6441a..1dc778a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,20 +1,24 @@
- Luke Ehresman (luke@squirrelmail.org),
- Nathan Ehresman (nathan@squirrelmail.org),
- Gustav Foseid (gustavf@squirrelmail.org),
- Pål Løberg (pallo@squirrelmail.org),
- Shane Wilson,
- Sergiusz Pawlowicz,
- Steve Gare,
- Gerrit Padgham,
- Matt Phillips,
- David Whittington,
- Lewis Bergman,
+ Developers:
+ -----------
+   Luke Ehresman (luke@squirrelmail.org)
+   Nathan Ehresman (nathan@squirrelmail.org)
+   Gustav Foseid (gustavf@squirrelmail.org)
+   Pål Løberg (pallo@squirrelmail.org)
+   Shane Wilson
+   Sergiusz Pawlowicz
+   Steve Gare
+   Gerrit Padgham
+   Matt Phillips
+   David Whittington
+   Lewis Bergman
 
  Translations:
-  Norwegian:    Gustav Foseid (gustavf@squirrelmail.org),
-  German:       Chris Thil,
-  Russian:      Konstantin Riabitsev,
-  Polish:       Lukasz Klimek (casa@lo.pila.pl),
+ -------------
+   Norwegian:    Gustav Foseid (gustavf@squirrelmail.org)
+   German:       Chris Thil
+   Russian:      Konstantin Riabitsev
+   Polish:       Lukasz Klimek (casa@lo.pila.pl)
 
  Help System:
-  Lewis Bergman
+ ------------
+   Lewis Bergman
index a212a75..242f48f 100644 (file)
       echo "</TD></TR></TABLE>";
    }
 
-    function messages_deleted_message($mailbox, $sort, $startMessage, $color) {
-      $urlMailbox = urlencode($mailbox);
-
-      echo "<BR>";
-      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
-      echo "   <TR>";
-      echo "      <TD BGCOLOR=\"$color[0]\">";
-      echo "         <B><CENTER>". _("Messages Deleted") ."</CENTER></B>";
-      echo "   </TD></TR><TR><TD>";
-      echo "      <CENTER><BR>". _("The selected messages were deleted successfully.") ."<BR>\n";
-      echo "      <BR>";
-      echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
-      printf (_("Click here to return to %s"), $mailbox);
-      echo "</A>.";
-      echo "      </CENTER>";
-      echo "   </TD></TR>";
-      echo "</TABLE>";
-    }
-
-    function messages_moved_message($mailbox, $sort, $startMessage, $color) {
-      $urlMailbox = urlencode($mailbox);
-
-      echo "<BR>";
-      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
-      echo "   <TR>";
-      echo "      <TD BGCOLOR=\"$color[0]\">";
-      echo "         <B><CENTER>". _("Messages Moved") ."</CENTER></B>";
-      echo "   </TD></TR><TR><TD>";
-      echo "      <CENTER><BR>". _("The selected messages were moved successfully.") ."<BR>\n";
-      echo "      <BR>";
-      echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
-      printf (_("Click here to return to %s"), $mailbox);
-      echo "</A>.";
-      echo "      </CENTER>";
-      echo "   </TD></TR>";
-      echo "</TABLE>";
-    }
-
     function error_message($message, $mailbox, $sort, $startMessage, $color) {
       $urlMailbox = urlencode($mailbox);
 
       echo "   </TD></TR><TR><TD>";
       echo "      <CENTER><BR>$message<BR>\n";
       echo "      <BR>";
-      echo "              <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
+      echo "         <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
       printf (_("Click here to return to %s"), $mailbox);
       echo "</A>.";
       echo "   </TD></TR>";
index c82e7a9..89be0e2 100755 (executable)
@@ -45,7 +45,7 @@
    }
         
    function sqimap_get_small_header ($imap_stream, $id, $sent) {
-      fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject Message-Id X-Priority)]\r\n");
+      fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
       $subject = _("(no subject)");
@@ -65,6 +65,8 @@
             $priority = trim(substr($read[$i], 11));
          } else if (eregi ("^message-id:", $read[$i])) {
             $messageid = trim(substr($read[$i], 11));
+         } else if (eregi ("^cc:", $read[$i])) {
+            $cc = substr($read[$i], 3);
          } else if (eregi ("^date:", $read[$i])) {
             $date = substr($read[$i], 5);
          } else if (eregi ("^subject:", $read[$i])) {
       if ($sent == true)
          $header->from = $to;
       else   
-        $header->from = $from;
+         $header->from = $from;
 
       $header->date = $date;
       $header->subject = $subject;
       $header->to = $to;
       $header->priority = $priority;
       $header->message_id = $messageid;
+      $header->cc = $cc;
 
       return $header;
    }
     **  the documentation folder for more information about this array.
     ******************************************************************************/
    function sqimap_get_message ($imap_stream, $id, $mailbox) {
-      
       $header = sqimap_get_message_header($imap_stream, $id, $mailbox);
-      $msg = sqimap_get_message_body($imap_stream, &$header);
+      $msg = sqimap_get_message_body(&$header);
       return $msg;
    }
 
    /******************************************************************************
     **  Returns the body of a message.
     ******************************************************************************/
-   function sqimap_get_message_body ($imap_stream, &$header) {
+   function sqimap_get_message_body (&$header) {
       $id = $header->id;
       //fputs ($imap_stream, "a001 FETCH $id:$id BODY[TEXT]\r\n");
       //$read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
        
+      /*
       $i = 0;
       $j = 0;
       while ($i < count($read)-1) {
          }
          $i++;
       }
+      */
       return decodeMime($body, &$header);
    }
 
index 9f82bfe..d1589cd 100644 (file)
                if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; }
       
       for ($i=0; $i < count($message_highlight_list); $i++) {
-         if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) {
+         if ($message_highlight_list[$i]["match_type"] == "to_cc") {
+            if (eregi($message_highlight_list[$i]["value"],$msg["TO"]) || eregi($message_highlight_list[$i]["value"],$msg["CC"])) {
+               $hlt_color = $message_highlight_list[$i]["color"];
+               continue;
+            }
+         } else if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) {
             $hlt_color = $message_highlight_list[$i]["color"];
             continue;
          }   
@@ -67,6 +72,7 @@
                                        $subject[$q] = $hdr->subject;
                $to[$q] = $hdr->to;
                $priority[$q] = $hdr->priority;
+               $cc[$q] = $hdr->cc;
 
                $flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
             }
@@ -84,6 +90,7 @@
             $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
             $messages[$j]["TO"] = decodeHeader($to[$j]);
                                $messages[$j]["PRIORITY"] = $priority[$j];
+            $messages[$j]["CC"] = $cc[$j];
    
             $num = 0;
             while ($num < count($flags[$j])) {
index 4cf7479..ab02193 100644 (file)
       global $username, $key, $imapServerAddress, $imapPort;
       $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
       sqimap_mailbox_select($imap_stream, $header->mailbox);
-
-      return mime_structure ($imap_stream, $header);
+      $struct = mime_structure ($imap_stream, $header);
+      sqimap_logout($imap_stream);
+      return $struct;
    }
 
    // This is here for debugging purposese.  It will print out a list
 
       $ent_num = findDisplayEntity ($message);
       $body = mime_fetch_body ($imap_stream, $id, $ent_num); 
+      sqimap_logout($imap_stream); 
 
       // If there are other types that shouldn't be formatted, add
       // them here 
index e6aa554..4c27361 100644 (file)
          writeBody ($imap_stream, $body); 
          sqimap_append_done ($imap_stream);
       }   
-
+      sqimap_logout($imap_stream); 
       // Delete the files uploaded for attaching (if any).
       deleteAttachments();
    }
index 0cb53d5..1270e02 100644 (file)
    function replace_escaped_spaces ($string) {
       return str_replace("&nbsp;", " ", $string);
    }
+
+   function get_location () {
+      # This determines the location to forward to relative
+      # to your server.  If this doesn't work correctly for
+      # you (although it should), you can remove all this 
+      # code except the last two lines, and change the header()
+      # function to look something like this, customized to
+      # the location of SquirrelMail on your server:
+      #
+      #   http://www.myhost.com/squirrelmail/src/login.php
+   
+      global $PHP_SELF, $SERVER_NAME, $HTTPS, $HTTP_HOST;
+
+      // Get the path
+      $path = substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'));
+   
+      // Check if this is a HTTPS or regular HTTP request
+      $proto = "http://";
+      if(isset($HTTPS) && $HTTPS == 'on' ) {
+        $proto = "https://";
+      }
+   
+      // Get the hostname from the Host header or server config.
+      // Fallback is to omit the server name and use a relative URI,
+      // although this is not RFC 2616 compliant.
+      if(isset($HTTP_HOST) && !empty($HTTP_HOST)) {
+        $location = $proto . $HTTP_HOST . $path;
+      } else if(isset($SERVER_NAME) && !empty($SERVER_NAME)) {
+        $location = $proto . $SERVER_NAME . $path;
+      } else {
+        $location = $path;
+      }
+      return $location;
+   }   
 ?>
index 0914d2f..2e5cde8 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,25 +1,7 @@
 <?php
-   // Get the path
-   $path = substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'));
+   include "functions/strings.php";
 
-   // Check if this is a HTTPS or regular HTTP request
-   $proto = "http://";
-   if(isset($HTTPS) && $HTTPS == 'on' ) {
-     $proto = "https://";
-   }
-
-   // Get the hostname from the Host header or server config.
-   // Fallback is to omit the server name and use a relative URI,
-   // although this is not RFC 2616 compliant.
-   if(isset($HTTP_HOST) && !empty($HTTP_HOST)) {
-     $location = $proto . $HTTP_HOST . $path;
-   } else if(isset($SERVER_NAME) && !empty($SERVER_NAME)) {
-     $location = $proto . $SERVER_NAME . $path;
-   } else {
-     $location = $path;
-   }
-
-   // Redirect
+   $location = get_location();
    header("Location: $location/src/login.php\n\n");
    exit();
 ?>
index 60ff758..0b90800 100644 (file)
       else if ($reply_id)
          $id = $reply_id;
 
+
       if ($id) {
          sqimap_mailbox_select($imapConnection, $mailbox);
          $message = sqimap_get_message($imapConnection, $id, $mailbox);
-         $message = getEntity($message, $ent_num);
+         if ($ent_num)
+            $message = getEntity($message, $ent_num);
 
          if ($message->header->type0 == "text" || $message->header->type1 == "message") {
-            $body = decodeBody(mime_fetch_body($imapConnection, $id, $message->header->entity_id), $message->header->encoding);
+            if ($ent_num)
+               $body = decodeBody(mime_fetch_body($imapConnection, $id, $ent_num), $message->header->encoding);
+            else
+               $body = decodeBody(mime_fetch_body($imapConnection, $id, 1), $message->header->encoding);
          } else {
             $body = "";
          }
          $body_ary = explode("\n", $body);
          $body = "";
          for ($i=0; $i < count($body_ary); $i++) {
-            $tmp = $body_ary[$i];
+            if ($i==0 && $forward_id)
+               $tmp = _("-------- Original Message ---------\n") . $body_ary[$i];
+            else
+               $tmp = $body_ary[$i];
             
             if ($forward_id)
-               $body = "$body$tmp\n";
+               $body .= "$body$tmp\n";
             else
-               $body = "$body> $tmp\n";
+               $body .= "$body> $tmp\n";
          }
-            
+         return $body;   
       }
 
       if (!$send_to) {
          checkInput(true);
          
          showInputForm();
+         sqimap_logout($imapConnection);
       }
    } else if ($html_addr_search_done) {
       is_logged_in();
       $newmail = true;
       newMail();
       showInputForm();
+      sqimap_logout($imapConnection);
    }
 ?>
index 5caa9f2..fd274d3 100644 (file)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    sqimap_mailbox_select($imapConnection, $mailbox);
 
-   displayPageHeader($color, $mailbox);
-
    sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
    if ($auto_expunge)
       sqimap_mailbox_expunge($imapConnection, $mailbox);
 
-   messages_deleted_message($mailbox, $sort, $startMessage, $color);
+   $location = get_location();
+   header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=".urlencode($mailbox));
 ?>
-</BODY></HTML>
index ce164ae..f4366b4 100644 (file)
 
    displayPageHeader($color, "None");
 
-   echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
-   echo "   <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
+   echo "<br>";
+   echo "<TABLE WIDTH=95% COLS=1 ALIGN=CENTER>\n";
+   echo "   <TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER>\n";
    echo _("Folders");
    echo "   </TD></TR>\n";
    echo "</TABLE>\n";
 
+   if ($success) {
+      echo "<table width=100% align=center cellpadding=3 cellspacing=0 border=0>\n";
+      echo "   <tr><td><center><font color=\"$color[1]\">\n";
+      if ($success == "subscribe") {
+         echo "<b>" . _("Subscribed successfully!") . "</b><br>";
+      } else if ($success == "unsubscribe") {
+         echo "<b>" . _("Unsubscribed successfully!") . "</b><br>";
+      } else if ($success == "delete") {
+         echo "<b>" . _("Deleted folder successfully!") . "</b><br>";
+      } else if ($success == "create") {
+         echo "<b>" . _("Created folder successfully!") . "</b><br>";
+      } else if ($success == "rename") {
+         echo "<b>" . _("Renamed successfully!") . "</b><br>";
+      }
+      echo "</font><a href=\"../src/left_main.php\" target=left><font color=\"$color[1]\">" . _("refresh folder list") . "</font></a>";
+      echo "   </center></td></tr>\n";
+      echo "</table><br>\n";
+   }
    $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list($imapConnection);
 
     if ($imap_server_type == "cyrus") {
        if ((!sqimap_mailbox_exists ($imapConnection, $sent_folder)) || (!sqimap_mailbox_exists ($imapConnection, $trash_folder))) {
        echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER>\n";
-       echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+       echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
        echo _("Special Folder Options");
        echo "</B></TD></TR>";
-       echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+       echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
        echo _("In order for SquirrelMail to provide the full set of options you need to create the special folders listed below.  Just click the check box and hit the create button.");
        echo "<FORM ACTION=\"folders.php\" METHOD=\"POST\">\n";
            if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
    }
 
    /** DELETING FOLDERS **/
-   echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER>\n";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+   echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 cellspacing=0 border=0>\n";
+   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
    echo _("Delete Folder");
    echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
 
    $count_special_folders = 0;
        $num_max = 1;
       echo "<INPUT TYPE=SUBMIT VALUE=\"";
       echo _("Delete");
       echo "\">\n";
-      echo "</FORM><BR></TD></TR>\n";
+      echo "</FORM></TD></TR>\n";
    } else {
       echo _("No mailboxes found") . "<br><br></td><tr>";
    }
 
+   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
 
    /** CREATING FOLDERS **/
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
    echo _("Create Folder");
    echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
    echo "<FORM ACTION=\"folders_create.php\" METHOD=\"POST\">\n";
    echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
    echo _("as a subfolder of");
       echo "<BR>";
    }   
    echo "<INPUT TYPE=SUBMIT VALUE=Create>\n";
-   echo "</FORM><BR></TD></TR><BR>\n";
+   echo "</FORM></TD></TR>\n";
+
+   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
 
    /** RENAMING FOLDERS **/
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
    echo _("Rename a Folder");
    echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
    if ($count_special_folders < count($boxes)) {
       echo "<FORM ACTION=\"folders_rename_getname.php\" METHOD=\"POST\">\n";
       echo "<TT><SELECT NAME=old>\n";
       echo _("No mailboxes found") . "<br><br></td></tr>";
    }
    $boxes_sub = $boxes;
+
+   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
    
    /** UNSUBSCRIBE FOLDERS **/
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
+   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
    echo _("Unsubscribe/Subscribe");
    echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
    if ($count_special_folders < count($boxes)) {
       echo "<FORM ACTION=\"folders_subscribe.php?method=unsub\" METHOD=\"POST\">\n";
       echo "<TT><SELECT NAME=mailbox>\n";
    $boxes_sub = $boxes;
    
    /** SUBSCRIBE TO FOLDERS **/
-
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
    if ($count_special_folders <= count($boxes)) {
       $imap_stream = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 1);
       $boxes_all = sqimap_mailbox_list_all ($imap_stream);
             echo "         <OPTION VALUE=\"$box\">$box2\n";
          }
       }
+      sqimap_logout($imap_stream);
       echo "</select></tt>";
       echo "<INPUT TYPE=SUBMIT VALUE=\"";
       echo _("Subscribe");
       echo _("No mailboxes found") . "<br><br></td></tr></table>";
    }
 
+   sqimap_logout($imapConnection);
 ?>
 </BODY></HTML>
index 505e10a..ee58120 100644 (file)
    }
    fputs($imapConnection, "1 logout\n");
 
-//   if ($auto_forward == true) {
-//      header ("Location: webmail.php?right_frame=folders.php");
-//   } else {
+   $location = get_location();
+   header ("Location: $location/folders.php?success=create");
+   sqimap_logout($imapConnection);
+   /*   
       displayPageHeader($color, "None");
       echo "<BR><BR><BR><CENTER><B>";
       echo _("Folder Created!");
@@ -67,6 +68,6 @@
       echo _("to continue.");
       echo "</CENTER>";
       echo "</BODY></HTML>";
-//   }
+   */
 ?>
 
index d3a1ff3..e98794b 100644 (file)
@@ -31,8 +31,6 @@
 
    include("../src/load_prefs.php");
 
-   displayPageHeader($color, "None");  
-
    
    $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list ($imap_stream);
@@ -86,6 +84,9 @@
    /** Log out this session **/
    sqimap_logout($imap_stream);
 
+   $location = get_location();
+   header ("Location: $location/folders.php?success=delete");
+   /*
    echo "<BR><BR><BR><CENTER><B>";
    echo _("Folder Deleted!");
    echo "</B><BR><BR>";
@@ -97,4 +98,5 @@
    echo "</CENTER>"; 
    
    echo "</BODY></HTML>";
+   */
 ?>
index 67de7ea..f6108e1 100644 (file)
@@ -59,7 +59,6 @@
 
    include("../src/load_prefs.php");
 
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $dm = sqimap_get_delimiter($imapConnection);
 
    if (strpos($orig, $dm))
 
    /** Log out this session **/
    sqimap_logout($imapConnection);
-
+   $location = get_location();
+   header ("Location: $location/folders.php?success=rename");
+   sqimap_logout($imapConnection);
+   /*
    displayPageHeader($color, "None");
    echo "<BR><BR><BR><CENTER><B>";
    echo _("Folder Renamed!");
    echo "</CENTER>";
    
    echo "</BODY></HTML>"; 
+   */
 ?>
index ddaccc7..4232526 100644 (file)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $dm = sqimap_get_delimiter($imapConnection);
 
+   $location = get_location();
    if ($method == "sub") {
       $mailbox = trim($mailbox);
       sqimap_subscribe ($imapConnection, $mailbox);
+      header("Location: $location/folders.php?success=subscribe");
    } else {
       sqimap_unsubscribe ($imapConnection, $mailbox);
+      header("Location: $location/folders.php?success=unsubscribe");
    }
+   sqimap_logout($imapConnection);
 
+   /*
    displayPageHeader($color, "None");
    echo "<BR><BR><BR><CENTER><B>";
    if ($method == "sub") {
@@ -51,5 +56,6 @@
    echo _("to continue.");
    echo "</CENTER>";
    echo "</BODY></HTML>";
+   */
 ?>
 
index 5ec8a4f..4a43509 100644 (file)
       echo "\n$line<BR>\n";
    }
 
-
-   fclose($imapConnection);
-
+   sqimap_logout($imapConnection);
 ?>
 </BODY></HTML>
index de17ca9..3281867 100644 (file)
          if ($auto_expunge) {
             sqimap_mailbox_expunge($imapConnection, $mailbox);
          }
-         if ($auto_forward) {   
-            header ("Location: right_main.php");
-         } else {
-            displayPageHeader($color, $mailbox);
-            messages_deleted_message($mailbox, $sort, $startMessage, $color);
-         }
+         $location = get_location();
+         header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=". urlencode($mailbox));
       } else {
          displayPageHeader($color, $mailbox);
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
          if ($auto_expunge == true)
             sqimap_mailbox_expunge($imapConnection, $mailbox);
 
-         if ($auto_forward) {   
-            header ("Location: right_main.php");
-         } else {
-            displayPageHeader($color, $mailbox);
-            messages_moved_message($mailbox, $sort, $startMessage, $color);
-         }
+         $location = get_location();
+         header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=". urlencode($mailbox));
       } else {
          displayPageHeader($color, $mailbox);
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
index 4955f35..306f914 100644 (file)
@@ -31,8 +31,7 @@
 
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list($imapConnection, $boxes);
-   fputs($imapConnection, "1 logout\n");
-
+   sqimap_logout($imapConnection);
 ?>
    <table width=100% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<? echo $color[0] ?>">
       <center><b><? echo _("Options") . " - " . _("Folder Preferences"); ?></b></center>
index 09ce146..4406033 100644 (file)
       else                                                         echo "            <option value=\"from\">From\n";
       if ($message_highlight_list[$id]["match_type"] == "to")      echo "            <option value=\"to\" selected>To\n";
       else                                                         echo "            <option value=\"to\">To\n";
+      if ($message_highlight_list[$id]["match_type"] == "cc")      echo "            <option value=\"cc\" selected>Cc\n";
+      else                                                         echo "            <option value=\"cc\">Cc\n";
+      if ($message_highlight_list[$id]["match_type"] == "to_cc")   echo "            <option value=\"to_cc\" selected>To or Cc\n";
+      else                                                         echo "            <option value=\"to_cc\">To or Cc\n";
       if ($message_highlight_list[$id]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n";
       else                                                         echo "            <option value=\"subject\">Subject\n";
       echo "         </select>\n";
index c6137dc..022ddd0 100644 (file)
@@ -9,11 +9,6 @@
    **  the resulting emails in the right frame.
    **/
 
-
-
-
-
-
    session_start();
 
    if (!isset($config_php))
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";
 
+   sqimap_logout($imapConnection);
 ?>
index ee37c63..aad2e83 100644 (file)
@@ -49,6 +49,7 @@
       do_hook ("login_before");
       // verify that username and password are correct
       $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+      sqimap_logout($imapConnection);
       do_hook ("login_verified");
    }