- 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 1b6441a61595685dfedaa79df0e0e23dfd7d61f5..1dc778a3bb47d88d1cb8376ab69d5087bb7d3d47 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:
 
  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:
 
  Help System:
-  Lewis Bergman
+ ------------
+   Lewis Bergman
index a212a754ac85c94b24da27b1145d1536bc42b0c7..242f48f60e48bc027dea35766b3ece35f46c0b2c 100644 (file)
       echo "</TD></TR></TABLE>";
    }
 
       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);
 
     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 "   </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>";
       printf (_("Click here to return to %s"), $mailbox);
       echo "</A>.";
       echo "   </TD></TR>";
index c82e7a97167389419679946b56d2823cf7853368..89be0e2a4dd51dec2245a14c758700877539985a 100755 (executable)
@@ -45,7 +45,7 @@
    }
         
    function sqimap_get_small_header ($imap_stream, $id, $sent) {
    }
         
    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)");
       $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));
             $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])) {
          } else if (eregi ("^date:", $read[$i])) {
             $date = substr($read[$i], 5);
          } else if (eregi ("^subject:", $read[$i])) {
       if ($sent == true)
          $header->from = $to;
       else   
       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->date = $date;
       $header->subject = $subject;
       $header->to = $to;
       $header->priority = $priority;
       $header->message_id = $messageid;
+      $header->cc = $cc;
 
       return $header;
    }
 
       return $header;
    }
     **  the documentation folder for more information about this array.
     ******************************************************************************/
    function sqimap_get_message ($imap_stream, $id, $mailbox) {
     **  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);
       $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;
    }
 
       return $msg;
    }
 
    /******************************************************************************
     **  Returns the body of a message.
     ******************************************************************************/
    /******************************************************************************
     **  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);
        
       $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 = 0;
       $j = 0;
       while ($i < count($read)-1) {
          }
          $i++;
       }
          }
          $i++;
       }
+      */
       return decodeMime($body, &$header);
    }
 
       return decodeMime($body, &$header);
    }
 
index 9f82bfec675860bc4750a261693bebfb53a6f9ec..d1589cd5f0d2ba11cb9280c23f7a0397b29a8631 100644 (file)
                if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; }
       
       for ($i=0; $i < count($message_highlight_list); $i++) {
                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;
          }   
             $hlt_color = $message_highlight_list[$i]["color"];
             continue;
          }   
@@ -67,6 +72,7 @@
                                        $subject[$q] = $hdr->subject;
                $to[$q] = $hdr->to;
                $priority[$q] = $hdr->priority;
                                        $subject[$q] = $hdr->subject;
                $to[$q] = $hdr->to;
                $priority[$q] = $hdr->priority;
+               $cc[$q] = $hdr->cc;
 
                $flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
             }
 
                $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]["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])) {
    
             $num = 0;
             while ($num < count($flags[$j])) {
index 4cf74790ff96360841df2a915af0f503f84e9a36..ab021936083a3b2e1847d0954967c566843036a1 100644 (file)
       global $username, $key, $imapServerAddress, $imapPort;
       $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
       sqimap_mailbox_select($imap_stream, $header->mailbox);
       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
    }
 
    // 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); 
 
       $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 
 
       // If there are other types that shouldn't be formatted, add
       // them here 
index e6aa554cfb58b9a30eec09d467a3226ea3b0e04b..4c273614e558e85069bcdaf065cf4aee734667b6 100644 (file)
          writeBody ($imap_stream, $body); 
          sqimap_append_done ($imap_stream);
       }   
          writeBody ($imap_stream, $body); 
          sqimap_append_done ($imap_stream);
       }   
-
+      sqimap_logout($imap_stream); 
       // Delete the files uploaded for attaching (if any).
       deleteAttachments();
    }
       // Delete the files uploaded for attaching (if any).
       deleteAttachments();
    }
index 0cb53d5d68943b2a1c5fd0c29015d2a51ee98279..1270e0276fbfa7fe8e8a9da0e4db67901bf6380d 100644 (file)
    function replace_escaped_spaces ($string) {
       return str_replace("&nbsp;", " ", $string);
    }
    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 0914d2fa92fd4ba2711db48f9a1aad92a7982776..2e5cde837e0ebdde689db7fe57fbc1b8b58748b0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,25 +1,7 @@
 <?php
 <?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();
 ?>
    header("Location: $location/src/login.php\n\n");
    exit();
 ?>
index 60ff75823fdbc2d61300d9c7af282239d278e4f7..0b90800d4ec53e75e8da29635901e0145f1944cb 100644 (file)
       else if ($reply_id)
          $id = $reply_id;
 
       else if ($reply_id)
          $id = $reply_id;
 
+
       if ($id) {
          sqimap_mailbox_select($imapConnection, $mailbox);
          $message = sqimap_get_message($imapConnection, $id, $mailbox);
       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") {
 
          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 = "";
          }
          } else {
             $body = "";
          }
          $body_ary = explode("\n", $body);
          $body = "";
          for ($i=0; $i < count($body_ary); $i++) {
          $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)
             
             if ($forward_id)
-               $body = "$body$tmp\n";
+               $body .= "$body$tmp\n";
             else
             else
-               $body = "$body> $tmp\n";
+               $body .= "$body> $tmp\n";
          }
          }
-            
+         return $body;   
       }
 
       if (!$send_to) {
       }
 
       if (!$send_to) {
          checkInput(true);
          
          showInputForm();
          checkInput(true);
          
          showInputForm();
+         sqimap_logout($imapConnection);
       }
    } else if ($html_addr_search_done) {
       is_logged_in();
       }
    } else if ($html_addr_search_done) {
       is_logged_in();
       $newmail = true;
       newMail();
       showInputForm();
       $newmail = true;
       newMail();
       showInputForm();
+      sqimap_logout($imapConnection);
    }
 ?>
    }
 ?>
index 5caa9f29a3e6e68fff6a19c43082b630401f63ec..fd274d3e3e9e5490c06ac8d10358237d81b80a7d 100644 (file)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    sqimap_mailbox_select($imapConnection, $mailbox);
 
    $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);
 
    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 ce164ae0b16017ba6a34afd7434b7cc029324f14..f4366b47cd6d945e8eda0be6b99a0a8cac7dbc18 100644 (file)
 
    displayPageHeader($color, "None");
 
 
    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";
 
    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);
 
    $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";
     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 _("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)) {
        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 **/
    }
 
    /** 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 _("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;
 
    $count_special_folders = 0;
        $num_max = 1;
       echo "<INPUT TYPE=SUBMIT VALUE=\"";
       echo _("Delete");
       echo "\">\n";
       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>";
    }
 
    } else {
       echo _("No mailboxes found") . "<br><br></td><tr>";
    }
 
+   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
 
    /** CREATING FOLDERS **/
 
    /** 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 _("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 "<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 "<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 **/
 
    /** 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 _("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";
    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 _("No mailboxes found") . "<br><br></td></tr>";
    }
    $boxes_sub = $boxes;
+
+   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
    
    /** UNSUBSCRIBE FOLDERS **/
    
    /** 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 _("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";
    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 **/
    $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);
    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";
          }
       }
             echo "         <OPTION VALUE=\"$box\">$box2\n";
          }
       }
+      sqimap_logout($imap_stream);
       echo "</select></tt>";
       echo "<INPUT TYPE=SUBMIT VALUE=\"";
       echo _("Subscribe");
       echo "</select></tt>";
       echo "<INPUT TYPE=SUBMIT VALUE=\"";
       echo _("Subscribe");
       echo _("No mailboxes found") . "<br><br></td></tr></table>";
    }
 
       echo _("No mailboxes found") . "<br><br></td></tr></table>";
    }
 
+   sqimap_logout($imapConnection);
 ?>
 </BODY></HTML>
 ?>
 </BODY></HTML>
index 505e10a716d332956ae0001e6c5b48bb44e2d050..ee58120d64d4b52b39579ff5495de6ab242908ad 100644 (file)
    }
    fputs($imapConnection, "1 logout\n");
 
    }
    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!");
       displayPageHeader($color, "None");
       echo "<BR><BR><BR><CENTER><B>";
       echo _("Folder Created!");
@@ -67,6 +68,6 @@
       echo _("to continue.");
       echo "</CENTER>";
       echo "</BODY></HTML>";
       echo _("to continue.");
       echo "</CENTER>";
       echo "</BODY></HTML>";
-//   }
+   */
 ?>
 
 ?>
 
index d3a1ff307e2217f4d4c55a3bff82770fba2435a5..e98794b70eb0aa9a1ecc66579a8820ce90dcd0cb 100644 (file)
@@ -31,8 +31,6 @@
 
    include("../src/load_prefs.php");
 
 
    include("../src/load_prefs.php");
 
-   displayPageHeader($color, "None");  
-
    
    $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list ($imap_stream);
    
    $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);
 
    /** 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>";
    echo "<BR><BR><BR><CENTER><B>";
    echo _("Folder Deleted!");
    echo "</B><BR><BR>";
@@ -97,4 +98,5 @@
    echo "</CENTER>"; 
    
    echo "</BODY></HTML>";
    echo "</CENTER>"; 
    
    echo "</BODY></HTML>";
+   */
 ?>
 ?>
index 67de7ea50d2c386f2cff84b31811c9b5ae0d838f..f6108e1152ed57f2d56de7ff0187205b727dc09b 100644 (file)
@@ -59,7 +59,6 @@
 
    include("../src/load_prefs.php");
 
 
    include("../src/load_prefs.php");
 
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $dm = sqimap_get_delimiter($imapConnection);
 
    if (strpos($orig, $dm))
    $dm = sqimap_get_delimiter($imapConnection);
 
    if (strpos($orig, $dm))
 
    /** Log out this session **/
    sqimap_logout($imapConnection);
 
    /** 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!");
    displayPageHeader($color, "None");
    echo "<BR><BR><BR><CENTER><B>";
    echo _("Folder Renamed!");
    echo "</CENTER>";
    
    echo "</BODY></HTML>"; 
    echo "</CENTER>";
    
    echo "</BODY></HTML>"; 
+   */
 ?>
 ?>
index ddaccc75c992f163a180a00972587dc191515876..423252619014e17eeb4d9c888995ce258e8d693b 100644 (file)
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $dm = sqimap_get_delimiter($imapConnection);
 
    $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);
    if ($method == "sub") {
       $mailbox = trim($mailbox);
       sqimap_subscribe ($imapConnection, $mailbox);
+      header("Location: $location/folders.php?success=subscribe");
    } else {
       sqimap_unsubscribe ($imapConnection, $mailbox);
    } 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") {
    displayPageHeader($color, "None");
    echo "<BR><BR><BR><CENTER><B>";
    if ($method == "sub") {
@@ -51,5 +56,6 @@
    echo _("to continue.");
    echo "</CENTER>";
    echo "</BODY></HTML>";
    echo _("to continue.");
    echo "</CENTER>";
    echo "</BODY></HTML>";
+   */
 ?>
 
 ?>
 
index 5ec8a4f3e4dabef9cf80c99e8db201ea11e53e5d..4a435097d3fe8612aef9d8cac5334af366428c02 100644 (file)
       echo "\n$line<BR>\n";
    }
 
       echo "\n$line<BR>\n";
    }
 
-
-   fclose($imapConnection);
-
+   sqimap_logout($imapConnection);
 ?>
 </BODY></HTML>
 ?>
 </BODY></HTML>
index de17ca937dfc12b213684b0d2b7cdabeb0da1930..3281867be4f4a5c0cb13e239a8cc6612c11d9474 100644 (file)
          if ($auto_expunge) {
             sqimap_mailbox_expunge($imapConnection, $mailbox);
          }
          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);
       } 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_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);
       } else {
          displayPageHeader($color, $mailbox);
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
index 4955f35ba6210fe34b54f15ca9832804fcdef04f..306f91488706e083b83199817653cfc59a8b384b 100644 (file)
@@ -31,8 +31,7 @@
 
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
    $boxes = sqimap_mailbox_list($imapConnection, $boxes);
 
    $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>
 ?>
    <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 09ce14663200af871ce431a872862716edd5681e..44060331ceac5690cb5953ac891eb498c1c43130 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";
       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";
       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 c6137dc222b78a1538623fa67fd3c46d018e985f..022ddd014ba3748316cc00112fb990f6b8ed31d7 100644 (file)
@@ -9,11 +9,6 @@
    **  the resulting emails in the right frame.
    **/
 
    **  the resulting emails in the right frame.
    **/
 
-
-
-
-
-
    session_start();
 
    if (!isset($config_php))
    session_start();
 
    if (!isset($config_php))
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";
 
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";
 
+   sqimap_logout($imapConnection);
 ?>
 ?>
index ee37c639bc3585edac470e70ec5f4f6c4a4b2370..aad2e838d54baaea66924a4047c3d5c6f66a8f78 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);
       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");
    }
 
       do_hook ("login_verified");
    }