if no date is sent in the header of a message, it takes the IMAP server's
[squirrelmail.git] / src / search.php
index de730d096deb3a7f7bbff3d35b934ae8a65da7e3..f5b4798db4f8d69959373032f9cd97e502a1879a 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))
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
    do_hook("search_before_form");
-   echo "<br>
-      <table width=95% align=center cellpadding=2 cellspacing=0 border=0>
-      <tr><td bgcolor=\"$color[0]\">
-          <center><b>"._("Search")."</b></center>
-      </td></tr>
-      <tr><td align=center>";
+   echo "<br>\n";
+   echo "      <table width=95% align=center cellpadding=2 cellspacing=0 border=0>\n";
+   echo "      <tr><td bgcolor=\"$color[0]\">\n";
+   echo "          <center><b>"._("Search")."</b></center>\n";
+   echo "      </td></tr>\n";
+   echo "      <tr><td align=center>";
 
-   echo "<FORM ACTION=\"search.php\">\n";
+   echo "<FORM ACTION=\"search.php\" NAME=s>\n";
    echo "   <TABLE WIDTH=75%>\n";
    echo "     <TR>\n";
    echo "       <TD WIDTH=33%>\n";
@@ -96,6 +98,7 @@
    if ($where && $what) {   
       sqimap_mailbox_select($imapConnection, $mailbox);
       sqimap_search($imapConnection, $where, $what, $mailbox, $color);
+      sqimap_mailbox_close($imapConnection);
    }
    do_hook("search_bottom");
    sqimap_logout ($imapConnection);