From 99fa2b21527197e185f1fbb3b51aca57ddd079eb Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sun, 30 Jul 2000 18:12:53 +0000 Subject: [PATCH] - did decodeHeader on to_ary and cc_ary - removed requirements for subject and body of message (by request from the list a while ago) - fixed some language problems in help.php - fixed some bugs with saving sent and trash folders in prefs - let the searched results use message highlighting git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@653 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_search.php | 22 ++++++++++++++++------ src/compose.php | 6 +----- src/help.php | 14 ++++++-------- src/options.php | 8 ++++---- src/read_body.php | 6 +++--- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/functions/imap_search.php b/functions/imap_search.php index b40cb4f7..a82242fd 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -13,8 +13,10 @@ 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 @@ -55,9 +57,13 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $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]); @@ -70,9 +76,14 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $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])) { @@ -166,7 +177,6 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo while ($j < count($msgs)) { printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what); - //echo $msgs[$j]["SUBJECT"]."
"; $j++; } echo ""; diff --git a/src/compose.php b/src/compose.php index ccf4f7eb..5617da79 100644 --- a/src/compose.php +++ b/src/compose.php @@ -285,11 +285,7 @@ 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; diff --git a/src/help.php b/src/help.php index 60f92358..e8c4b43c 100644 --- a/src/help.php +++ b/src/help.php @@ -28,11 +28,6 @@ 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(); @@ -47,6 +42,10 @@ $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])) == "" || trim(strtolower($doc[$n])) == "
") { @@ -111,13 +110,12 @@ $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 "
"; - 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 "

"; $user_language = "en"; } else { diff --git a/src/options.php b/src/options.php index e32ef0dd..1f7d38b3 100644 --- a/src/options.php +++ b/src/options.php @@ -74,15 +74,15 @@ 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); diff --git a/src/read_body.php b/src/read_body.php index 11829d6f..59e6f0d3 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -135,7 +135,7 @@ $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
$to_ary[$i]"; @@ -169,7 +169,7 @@ $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
$cc_ary[$i]"; @@ -218,7 +218,7 @@ echo _("Message List"); echo " | "; if ($where && $what) { - echo " "; + echo " "; } else { echo " "; } -- 2.25.1