if (!isset($mime_php))
include("../functions/mime.php");
+ $imap_search_php = true;
+
function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
- global $msgs;
+ global $msgs, $message_highlight_list;
$urlMailbox = urlencode($mailbox);
# Construct the Search QuERY
$hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], true);
else
$hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], false);
- $from[$q] = $hdr->from;
- $date[$q] = $hdr->date;
- $subject[$q] = $hdr->subject;
+
+ $from[$q] = $hdr->from;
+ $date[$q] = $hdr->date;
+ $subject[$q] = $hdr->subject;
+ $to[$q] = $hdr->to;
+ $priority[$q] = $hdr->priority;
+ $cc[$q] = $hdr->cc;
$id[$q] = $messagelist[$q];
$flags[$q] = sqimap_get_flags ($imapConnection, $messagelist[$q]);
$messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate);
$messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]);
- $messages[$j]["ID"] = $id[$j];
+ $messages[$j]["ID"] = $id[$j];
$messages[$j]["FROM"] = decodeHeader($from[$j]);
+ $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j])));
$messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
+ $messages[$j]["SUBJECT-SORT"] = strtolower(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])) {
while ($j < count($msgs)) {
printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what);
- //echo $msgs[$j]["SUBJECT"]."<br>";
$j++;
}
echo "</table>";
error message, show=true **/
global $body, $send_to, $subject, $color;
- if ($body == "" && $subject == "") {
- if ($show)
- plain_error_message(_("You have not entered a message body or a subject."), $color);
- return false;
- } else if ($send_to == "") {
+ if ($send_to == "") {
if ($show)
plain_error_message(_("You have not filled in the \"To:\" field."), $color);
return false;
if (!isset($auth_php))
include ("../functions/auth.php");
- if ($language) {
- setcookie("squirrelmail_language", $language, time()+2592000);
- $squirrelmail_language = $language;
- }
-
include("../src/load_prefs.php");
displayPageHeader($color, "None");
is_logged_in();
$helpdir[7] = "FAQ.hlp";
/****************[ HELP FUNCTIONS ]********************/
+ // parses through and gets the information from the different documents.
+ // this returns one section at a time. You must keep track of the position
+ // so that it knows where to start to look for the next section.
+
function get_info($doc, $pos) {
for ($n=$pos; $n < count($doc); $n++) {
if (trim(strtolower($doc[$n])) == "<chapter>" || trim(strtolower($doc[$n])) == "<section>") {
$context = "read";
}
- if (file_exists("../help/$user_language")) {
+ if (file_exists("../help/$squirrelmail_language")) {
$help_exists = true;
- $user_language = $user_language;
} else if (file_exists("../help/en")) {
$help_exists = true;
echo "<center><font color=\"$color[2]\">";
- echo _("The help has not been translated to your preferred language. It will be displayed in English instead.");
+ printf (_("The help has not been translated to %s. It will be displayed in English instead."), $languages[$squirrelmail_language]["NAME"]);
echo "</font></center><br>";
$user_language = "en";
} else {
setPref($data_dir, $username, "move_to_trash", true);
setPref($data_dir, $username, "trash_folder", $trash);
} else {
- setPref($data_dir, $username, "move_to_trash", false);
- setPref($data_dir, $username, "trash_folder", "");
+ setPref($data_dir, $username, "move_to_trash", "0");
+ setPref($data_dir, $username, "trash_folder", "none");
}
if ($sent != "none") {
setPref($data_dir, $username, "move_to_sent", true);
setPref($data_dir, $username, "sent_folder", $sent);
} else {
- setPref($data_dir, $username, "move_to_sent", false);
- setPref($data_dir, $username, "sent_folder", "");
+ setPref($data_dir, $username, "move_to_sent", "0");
+ setPref($data_dir, $username, "sent_folder", "none");
}
setPref($data_dir, $username, "folder_prefix", $folderprefix);
setPref($data_dir, $username, "unseen_notify", $unseennotify);
$to_string = "";
$to_ary = $message->header->to;
while ($i < count($to_ary)) {
- $to_ary[$i] = htmlspecialchars($to_ary[$i]);
+ $to_ary[$i] = htmlspecialchars(decodeHeader($to_ary[$i]));
if ($to_string)
$to_string = "$to_string<BR>$to_ary[$i]";
$i = 0;
$cc_string = "";
$cc_ary = $message->header->cc;
- while ($i < count($cc_ary)) {
+ while ($i < count(decodeHeader($cc_ary))) {
$cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
if ($cc_string)
$cc_string = "$cc_string<BR>$cc_ary[$i]";
echo _("Message List");
echo "</A> | ";
if ($where && $what) {
- echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1&where=".urlencode($where)."&what=".urlencode($what)."\">";
+ echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."\">";
} else {
echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">";
}