X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsearch.php;h=e090e887a925d5d2dd3248ee02908a72f89309b8;hb=4a73225b56b6ab6f463df3d0923b7ef5877bd131;hp=3bdcbdbe5dfb3a789977c230fe406f5ffd965715;hpb=245a6892bf5c780904ef9677f24d624ea17e0749;p=squirrelmail.git diff --git a/src/search.php b/src/search.php index 3bdcbdbe..e090e887 100644 --- a/src/search.php +++ b/src/search.php @@ -2,101 +2,70 @@ /* $Id$ */ - session_start(); - - if(!isset($logged_in)) { - set_up_language($squirrelmail_language, true); - echo _("You must login first."); - exit; - } - if(!isset($username) || !isset($key)) { - include ("../themes/default_theme.php"); - include ("../functions/display_messages.php"); - printf('', - $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($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"); - if (!isset($imap_php)) - include("../functions/imap.php"); - if (!isset($imap_search_php)) - include("../functions/imap_search.php"); - if (!isset($array_php)) - include("../functions/array.php"); - - include("../src/load_prefs.php"); + require_once('../src/validate.php'); + require_once('../functions/imap.php'); + require_once('../functions/imap_search.php'); + require_once('../functions/array.php'); displayPageHeader($color, $mailbox); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - do_hook("search_before_form"); + do_hook('search_before_form'); echo "
\n"; echo " \n"; echo " \n"; - echo "
\n"; echo "
"._("Search")."
\n"; echo "
"; + echo '
'; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " "; + echo ' '; echo " \n"; @@ -115,4 +84,4 @@ do_hook("search_bottom"); sqimap_logout ($imapConnection); ?> - + \ No newline at end of file
\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"; 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); + $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 "