X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fsearch.php;h=0dd0a49f23f3d78ef7fb9944d44666d15e09ceff;hp=0aad14b77db5606fa62e63f8bad077262d93f705;hb=15e6162eacc97158393bc75aed3afeb7b19c24a6;hpb=6553723cb8b2d2395bb10578c7dc4cc8b47b45a2 diff --git a/src/search.php b/src/search.php index 0aad14b7..0dd0a49f 100644 --- a/src/search.php +++ b/src/search.php @@ -1,118 +1,95 @@ ', - $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; - } +function s_opt( $val, $sel, $tit ) { + echo " \n"; +} - 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'); +displayPageHeader($color, $mailbox); +$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - include('../src/load_prefs.php'); +do_hook('search_before_form'); +echo "
\n". + " \n". + " \n". + '
\n". + "
"._("Search")."
\n". + "
'. - displayPageHeader($color, $mailbox); - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + "
\n". + " \n". + " \n". + " \n"; - echo " '; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n". + ' \n"; - echo " \n"; - echo ' \n". + " '. + "
\n"; - echo "
"._("Search")."
\n"; - echo "
'; +$boxes = sqimap_mailbox_list($imapConnection); +for ($i = 0; $i < count($boxes); $i++) { + if (!in_array('noselect', $boxes[$i]['flags'])) { + $box = $boxes[$i]['unformatted']; + $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']); + if ($mailbox == $box) { + echo " \n"; + } else { + echo " \n"; + } + } +} +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); +echo " \n". + '\n". + '\n"; - echo " \n"; - echo " \n". + " \n". + " \n". + "
\n"; - echo ' \n" . + " \n". + " \n". + "
\n". + "". + "
"; +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); + +echo ''; - $boxes = sqimap_mailbox_list($imapConnection); - for ($i = 0; $i < count($boxes); $i++) { - if (!in_array('noselect', $boxes[$i]['flags'])) { - $box = $boxes[$i]['unformatted']; - $box2 = replace_spaces($boxes[$i]['unformatted-disp']); - if ($mailbox == $box) - 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); - echo " \n"; - echo ' \n"; - echo ' \n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo ""; - echo "
"; - 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); ?> -