X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsearch.php;h=7eb98a183faa78e51be51356758c4bff51f4fb4d;hb=16a973d70a51ec3e3a171b87fcf0fc2fd5de5351;hp=2fb69f6da38091833ad80ad12e354b3b9381d01f;hpb=acb61cb47119d22ce54765afefe1330e14fb07d7;p=squirrelmail.git diff --git a/src/search.php b/src/search.php index 2fb69f6d..7eb98a18 100644 --- a/src/search.php +++ b/src/search.php @@ -1,19 +1,32 @@ ', + $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"); + 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)) @@ -28,14 +41,15 @@ displayPageHeader($color, $mailbox); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - 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 "
\n"; @@ -43,7 +57,7 @@ $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") { + if (!in_array("noselect", $boxes[$i]["flags"])) { $box = $boxes[$i]["unformatted"]; $box2 = replace_spaces($boxes[$i]["formatted"]); if ($mailbox == $box) @@ -55,6 +69,8 @@ echo " "; echo " \n"; + if (!isset($what)) + $what = ""; $what_disp = ereg_replace(",", " ", $what); $what_disp = str_replace("\\\\", "\\", $what_disp); $what_disp = str_replace("\\\"", "\"", $what_disp); @@ -64,22 +80,22 @@ echo " \n"; echo " \n"; @@ -91,10 +107,12 @@ echo "
\n"; echo "
"; echo "
"; - if ($where && $what) { + do_hook("search_after_form"); + if (isset($where) && $where && isset($what) && $what) { sqimap_mailbox_select($imapConnection, $mailbox); sqimap_search($imapConnection, $where, $what, $mailbox, $color); } + do_hook("search_bottom"); sqimap_logout ($imapConnection); ?>