X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fsearch.php;h=da18910d28bc37c3e9a76d025e13b12c75c418af;hp=de730d096deb3a7f7bbff3d35b934ae8a65da7e3;hb=0cd84d75b1d2c786b88c859a049443669b37d96d;hpb=06ad27a2ea5e8cef7e172f2d39a5c43b06dd2410 diff --git a/src/search.php b/src/search.php index de730d09..da18910d 100644 --- a/src/search.php +++ b/src/search.php @@ -1,87 +1,102 @@ ', + $color[8], $color[4], $color[7], $color[7], $color[7]); + plain_error_message(_("You need a valid user and password to access this page!") + . '
' + . _("Click here to log back in.") . '.', $color); + echo ''; exit; } - if (!isset($config_php)) - include("../config/config.php"); if (!isset($strings_php)) - include("../functions/strings.php"); + include('../functions/strings.php'); + if (!isset($i18n_php)) + include('../functions/i18n.php'); + if (!isset($config_php)) + include('../config/config.php'); if (!isset($page_header_php)) - include("../functions/page_header.php"); + include('../functions/page_header.php'); if (!isset($imap_php)) - include("../functions/imap.php"); + include('../functions/imap.php'); if (!isset($imap_search_php)) - include("../functions/imap_search.php"); + include('../functions/imap_search.php'); if (!isset($array_php)) - include("../functions/array.php"); + include('../functions/array.php'); - include("../src/load_prefs.php"); + include('../src/load_prefs.php'); displayPageHeader($color, $mailbox); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - do_hook("search_before_form"); - echo "
- - -
-
"._("Search")."
-
"; + do_hook('search_before_form'); + echo "
\n"; + echo " \n"; + echo " \n"; + echo '
\n"; + echo "
"._("Search")."
\n"; + echo "
'; - echo "
\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " "; + echo ' '; echo " \n"; @@ -93,7 +108,7 @@ echo ""; echo "
\n"; - echo " '; $boxes = sqimap_mailbox_list($imapConnection); for ($i = 0; $i < count($boxes); $i++) { - if ($boxes[$i]["flags"][0] != "noselect" && $boxes[$i]["flags"][1] != "noselect" && $boxes[$i]["flags"][2] != "noselect") { - $box = $boxes[$i]["unformatted"]; - $box2 = replace_spaces($boxes[$i]["formatted"]); + if (!in_array('noselect', $boxes[$i]['flags'])) { + $box = $boxes[$i]['unformatted']; + $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']); if ($mailbox == $box) echo " "; + echo ' '; echo " \n"; - $what_disp = ereg_replace(",", " ", $what); - $what_disp = str_replace("\\\\", "\\", $what_disp); - $what_disp = str_replace("\\\"", "\"", $what_disp); - $what_disp = str_replace("\"", """, $what_disp); + if (!isset($what)) + $what = ''; + $what_disp = ereg_replace(',', ' ', $what); + $what_disp = str_replace('\\\\', '\\', $what_disp); + $what_disp = str_replace('\\"', '"', $what_disp); + $what_disp = str_replace('"', '"', $what_disp); echo " \n"; - echo " \n"; - echo " '; - if ($where == "BODY") echo "
"; do_hook("search_after_form"); - if ($where && $what) { + if (isset($where) && $where && isset($what) && $what) { sqimap_mailbox_select($imapConnection, $mailbox); sqimap_search($imapConnection, $where, $what, $mailbox, $color); }