added CHARSET option to searching.. should fix the german character
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 19 Sep 2000 21:46:22 +0000 (21:46 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 19 Sep 2000 21:46:22 +0000 (21:46 +0000)
problem.  Please test it out.  It takes the charset from your current
language.

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

functions/imap_general.php
functions/imap_search.php
functions/mailbox_display.php
src/left_main.php
src/search.php

index a9682da..0d88396 100755 (executable)
    function sqimap_read_data ($imap_stream, $pre, $handle_errors, $response, $message) {
       global $color;
 
+      //$imap_general_debug = true;
+      $imap_general_debug = false;
+
       $read = fgets ($imap_stream, 1024);
-//             echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
+               if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
       $counter = 0;
       while ((substr($read, 0, strlen("$pre OK")) != "$pre OK") &&
              (substr($read, 0, strlen("$pre BAD")) != "$pre BAD") &&
              (substr($read, 0, strlen("$pre NO")) != "$pre NO")) {
          $data[$counter] = $read;
          $read = fgets ($imap_stream, 1024);
-//                     echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
+                       if ($imap_general_debug) echo "<small><tt><font color=cc0000>$read</font></tt></small><br>";
          $counter++;
       }       
-//      echo "--<br>";
+      if ($imap_general_debug) echo "--<br>";
       if (substr($read, 0, strlen("$pre OK")) == "$pre OK") {
          $response = "OK";
          $message = trim(substr($read, strlen("$pre OK"), strlen($read)));
index 1b42a98..667c795 100644 (file)
    $imap_search_php = true;
 
 function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
-   global $msgs, $message_highlight_list;
+   global $msgs, $message_highlight_list, $squirrelmail_language, $languages;
    $urlMailbox = urlencode($mailbox);
    
    # Construct the Search QuERY
    
-   $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n";
+   if ($languages[$squirrelmail_language]["CHARSET"]) {
+      $ss = "a001 SEARCH CHARSET ".$languages[$squirrelmail_language]["CHARSET"]." ALL $search_where \"$search_what\"\r\n";
+   } else {
+      $ss = "a001 SEARCH ALL $search_where \"$search_what\"\r\n";
+   }
    fputs($imapConnection,$ss);
 
    # Read Data Back From IMAP
index 87074a0..e4d3c68 100644 (file)
       global $msgs, $msort;
                global $sent_folder;
       global $message_highlight_list;
+      global $auto_expunge;
+
+      if ($auto_expunge) {
+         sqimap_mailbox_expunge($imapConnection, $mailbox);
+         sqimap_mailbox_select($imapConnection, $mailbox);
+      }
 
       if (!$use_cache) {
          if ($numMessages >= 1) {
index 39382ea..aff3083 100644 (file)
@@ -40,7 +40,6 @@
 
    displayHtmlHeader();
 
-
    function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) {
                global $folder_prefix, $trash_folder, $sent_folder;
                global $color, $move_to_sent, $move_to_trash;
             $line .= replace_spaces(readShortMailboxName($mailbox, $delimeter));
             $line .= "</FONT>";
          } else {
+            if ($auto_expunge) {
+               sqimap_mailbox_expunge($imapConnection, $boxes[$i]["unformatted-dm"]);
+            }
             $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
          }
       } else {
index 1db642f..f5b4798 100644 (file)
@@ -10,6 +10,8 @@
       exit;
    }
 
+   if (!isset($i18n_php))
+      include("../functions/i18n.php");
    if (!isset($config_php))
       include("../config/config.php");
    if (!isset($strings_php))