Source for file search.php

Documentation is available at search.php

  1. <?php
  2.  
  3. /**
  4.  * search.php
  5.  *
  6.  * IMAP search page
  7.  *
  8.  * @copyright 1999-2020 The SquirrelMail Project Team
  9.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.  * @version $Id: search.php 14840 2020-01-07 07:42:38Z pdontthink $
  11.  * @package squirrelmail
  12.  * @subpackage search
  13.  */
  14.  
  15. /** This is the search page */
  16. define('PAGE_NAME''search');
  17.  
  18. /**
  19.  * Path for SquirrelMail required files.
  20.  * @ignore
  21.  */
  22. define('SM_PATH','../');
  23.  
  24. /** SquirrelMail required files.
  25.  */
  26. require_once(SM_PATH 'include/validate.php');
  27. require_once(SM_PATH 'functions/imap.php');
  28. require_once(SM_PATH 'functions/imap_search.php');
  29. require_once(SM_PATH 'functions/imap_mailbox.php');
  30. require_once(SM_PATH 'functions/strings.php');
  31. require_once(SM_PATH 'functions/forms.php');
  32.  
  33. global $allow_thread_sort;
  34.  
  35. /* get globals we may need */
  36.  
  37. sqgetGlobalVar('username'$usernameSQ_SESSION);
  38. sqgetGlobalVar('key'$keySQ_COOKIE);
  39. sqgetGlobalVar('delimiter'$delimiterSQ_SESSION);
  40. sqgetGlobalVar('onetimepad'$onetimepadSQ_SESSION);
  41. sqgetGlobalVar('composenew' $composenewSQ_FORM);
  42. sqgetGlobalVar('composesession' $composesession SQ_SESSION);
  43.  
  44. if (!sqgetGlobalVar('mailbox',$mailbox,SQ_GET)) {
  45.     unset($mailbox);
  46. }
  47. if (!sqgetGlobalVar('submit',$submit,SQ_GET)) {
  48.     $submit '';
  49. }
  50. if (!sqgetGlobalVar('what',$what,SQ_GET)) {
  51.     $what='';
  52. }
  53. if (sqgetGlobalVar('where',$where,SQ_GET||
  54.     in_array$wherearray('BODY','TEXT','SUBJECT','FROM','CC','TO','TO_CC','TO_CC_FROM','TO_CC_FROM_SUBJECT'))) {
  55.     // make sure that 'where' is one if standard IMAP SEARCH keywords
  56.     if (isset($mailbox&& isSentMailbox($mailboxTRUE))
  57.         $where 'TO';
  58.     else
  59.         $where 'FROM';
  60. }
  61. if !sqgetGlobalVar('preselected'$preselectedSQ_GET|| !is_array($preselected)) {
  62.   $preselected array();
  63. else {
  64.   $preselected array_keys($preselected);
  65. }
  66. if (!sqgetGlobalVar('checkall',$checkall,SQ_GET)) {
  67.     unset($checkall);
  68. }
  69. if (sqgetGlobalVar('count',$count,SQ_GET)) {
  70.     $count = (int) $count;
  71. else {
  72.     unset($count);
  73. }
  74. if (!sqgetGlobalVar('smtoken',$submitted_tokenSQ_GET)) {
  75.     $submitted_token '';
  76. }
  77. /* end of get globals */
  78.  
  79. /*  here are some functions, could go in imap_search.php
  80.     this was here, pretty handy  */
  81. function s_opt$val$sel$tit {
  82.     echo "            <option value=\"$val\"";
  83.     if $sel == $val {
  84.         echo ' selected="selected"';
  85.     }
  86.     echo  ">$tit</option>\n";
  87. }
  88.  
  89. /*  function to get the recent searches and put them in the attributes array  */
  90. function get_recent($username$data_dir{
  91.     $attributes array();
  92.     $types array('search_what''search_where''search_folder');
  93.     $recent_count getPref($data_dir$username'search_memory'0);
  94.     for ($x=1;$x<=$recent_count;$x++{
  95.         reset($types);
  96.         foreach ($types as $key{
  97.             $attributes[$key][$xgetPref($data_dir$username$key.$x"");
  98.         }
  99.     }
  100.     return $attributes;
  101. }
  102.  
  103. /*  function to get the saved searches and put them in the saved_attributes array  */
  104. function get_saved($username$data_dir{
  105.     $saved_attributes array();
  106.     $types array('saved_what''saved_where''saved_folder');
  107.     foreach ($types as $key{
  108.         for ($x=1;;$x++{
  109.             $prefval getPref($data_dir$username$key."$x""");
  110.             if ($prefval == ""{
  111.                 break;
  112.             else {
  113.                 $saved_attributes[$key][$x$prefval;
  114.             }
  115.         }
  116.     }
  117.     return $saved_attributes;
  118. }
  119.  
  120. /*  function to update recent pref arrays  */
  121. function update_recent($what$where$mailbox$username$data_dir{
  122.     $attributes array();
  123.     $types array('search_what''search_where''search_folder');
  124.     $input array($what$where$mailbox);
  125.     $attributes get_recent$username$data_dir);
  126.     reset($types);
  127.     $dupe 'no';
  128.     for ($i=1;$i<=count($attributes['search_what']);$i++{
  129.         if (isset($attributes['search_what'][$i])) {
  130.             if ($what == $attributes['search_what'][$i&&
  131.                 $where == $attributes['search_where'][$i&&
  132.                 $mailbox == $attributes['search_folder'][$i]{
  133.                     $dupe 'yes';
  134.             }
  135.         }
  136.     }
  137.     if ($dupe == 'no'{
  138.         $i 0;
  139.         foreach ($types as $key{
  140.             array_push ($attributes[$key]$input[$i]);
  141.             array_shift ($attributes[$key]);
  142.             $i++;
  143.         }
  144.         $recent_count getPref($data_dir$username'search_memory'0);
  145.         $n=0;
  146.         for ($i=1;$i<=$recent_count;$i++{
  147.             reset($types);
  148.             foreach ($types as $key{
  149.                 setPref($data_dir$username$key.$i$attributes[$key][$n]);
  150.             }
  151.             $n++;
  152.         }
  153.     }
  154. }
  155.  
  156. /*  function to forget a recent search  */
  157. function forget_recent($forget_index$username$data_dir{
  158.     $attributes array();
  159.     $types array('search_what''search_where''search_folder');
  160.     $attributes get_recent$username$data_dir);
  161.     reset($types);
  162.     foreach ($types as $key{
  163.         array_splice($attributes[$key]$forget_index 11);
  164.         array_unshift($attributes[$key]'');
  165.     }
  166.     reset($types);
  167.     $recent_count getPref($data_dir$username'search_memory'0);
  168.     $n=0;
  169.     for ($i=1;$i<=$recent_count;$i++{
  170.         reset($types);
  171.         foreach ($types as $key{
  172.             setPref($data_dir$username$key.$i$attributes[$key][$n]);
  173.         }
  174.         $n++;
  175.     }
  176. }
  177.  
  178. /*  function to delete a saved search  */
  179. function delete_saved($delete_index$username$data_dir{
  180.     $types array('saved_what''saved_where''saved_folder');
  181.     $attributes get_saved($username$data_dir);
  182.     foreach ($types as $key{
  183.         array_splice($attributes[$key]$delete_index1);
  184.     }
  185.     reset($types);
  186.     $n=0;
  187.     $saved_count count($attributes['saved_what']);
  188.     $last_element $saved_count 1;
  189.         for ($i=1;$i<=$saved_count;$i++{
  190.             reset($types);
  191.             foreach ($types as $key{
  192.                 setPref($data_dir$username$key.$i$attributes[$key][$n]);
  193.             }
  194.         $n++;
  195.         }
  196.     reset($types);
  197.     foreach($types as $key{
  198.     removePref($data_dir$username$key.$last_element);
  199.     }
  200. }
  201.  
  202. /*  function to save a search from recent to saved  */
  203. function save_recent($save_index$username$data_dir{
  204.     $attributes array();
  205.     $types array('search_what''search_where''search_folder');
  206.     $saved_types array(=> 'saved_what'=> 'saved_where'=> 'saved_folder');
  207.     $saved_array get_saved($username$data_dir);
  208.     $save_index $save_index -1;
  209.     if (isset($saved_array['saved_what'])) {
  210.         $saved_count (count($saved_array['saved_what']1);
  211.     else {
  212.         // there are no saved searches. Function is used to save first search
  213.         $saved_count 1;
  214.     }
  215.     $attributes get_recent ($username$data_dir);
  216.     $n 0;
  217.     foreach ($types as $key{
  218.         $slice array_slice($attributes[$key]$save_index1);
  219.         $name $saved_types[$n];
  220.         setPref($data_dir$username$name.$saved_count$slice[0]);
  221.         $n++;
  222.     }
  223. }
  224.  
  225. function printSearchMessages($msgs,$mailbox$cnt$imapConnection$where$what$usecache false$newsort false{
  226.     global $sort$color$allow_server_sort$allow_server_thread;
  227.  
  228.     if ($cnt 0{
  229.         if ((!empty($allow_server_sort&& $allow_server_sort|| (!empty($allow_server_thread&& $allow_server_thread)) {
  230.             $msort $msgs;
  231.         else {
  232.             $msort calc_msort($msgs$sort$mailbox);
  233.         }
  234.  
  235.         if $mailbox == 'INBOX' {
  236.             $showbox _("INBOX");
  237.         else {
  238.             $showbox imap_utf7_decode_local($mailbox);
  239.         }
  240.         echo html_tag'div''<b><big>' _("Folder:"' '.
  241.             sm_encode_html_special_chars($showbox.'</big></b>','center'"\n";
  242.  
  243.         $msg_cnt_str get_msgcnt_str(1$cnt$cnt);
  244.         $toggle_all get_selectall_link(1$sort);
  245.  
  246.         do_hook('search_index_before');
  247.  
  248.         $safe_name preg_replace("/[^0-9A-Za-z_]/"'_'$mailbox);
  249.         $form_name "FormMsgs" $safe_name;
  250.         echo '<form name="' $form_name '" method="post" action="move_messages.php">' ."\n" .
  251.              '<input type="hidden" name="mailbox" value="'.sm_encode_html_special_chars($mailbox).'">' "\n" .
  252.              '<input type="hidden" name="startMessage" value="1">' "\n" .
  253.              addHidden('smtoken'sm_generate_security_token()) "\n";
  254.  
  255.         echo '<table border="0" width="100%" cellpadding="0" cellspacing="0">';
  256.         echo '<tr><td>';
  257.  
  258.         mail_message_listing_beginning($imapConnection$mailbox$sort,
  259.                                        $msg_cnt_str$toggle_all1);
  260.  
  261.         echo '<tr><td height="5" bgcolor="'.$color[4].'"></td></tr>';
  262.         echo '<tr><td>';
  263.         echo '    <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
  264.         echo '     <tr><td>';
  265.         echo '       <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[5].'">';
  266.  
  267.         printHeader($mailbox6$colorfalse);
  268.  
  269.         displayMessageArray($imapConnection$cnt1,
  270.             $msort$mailbox$sort$color$cnt$where$what);
  271.  
  272.         echo '</table></td></tr></table>';
  273.         // space for paginator argument is intentional, so html_tag() closes the tag
  274.         mail_message_listing_end($cnt' '$msg_cnt_str$color);
  275.         echo "\n</table></form>\n\n";
  276.     }
  277. }
  278.  
  279. /* ------------------------ main ------------------------ */
  280.  
  281. /*  reset these arrays on each page load just in case  */
  282. $attributes array ();
  283. $saved_attributes array ();
  284. $search_all 'none';
  285. $perbox_count array ();
  286. $recent_count getPref($data_dir$username'search_memory'0);
  287.  
  288. /*  get mailbox names  */
  289. global $imap_stream_options// in case not defined in config
  290. $imapConnection sqimap_login($username$key$imapServerAddress$imapPort0$imap_stream_options);
  291. $boxes sqimap_mailbox_list($imapConnection);
  292.  
  293. /*  set current mailbox to INBOX if none was selected or if page
  294.     was called to search all folders.  */
  295. if !isset($mailbox|| $mailbox == 'None' || $mailbox == '' {
  296.     $mailbox $boxes[0]['unformatted'];
  297. }
  298. if ($mailbox == 'All Folders'{
  299.     $search_all 'all';
  300. }
  301.  
  302. // the preg_match() is a fix for Dovecot wherein UIDs can be bigger than
  303. // normal integers - this isn't in 1.4 yet, but when adding new code, why not...
  304. if (sqgetGlobalVar('unread_passed_id'$unread_passed_idSQ_GET)
  305.  && preg_match('/^[0-9]+$/'$unread_passed_id)) {
  306.     sqimap_mailbox_select($imapConnection$mailbox);
  307.     sqimap_toggle_flag($imapConnection$unread_passed_id'\\Seen'falsetrue);
  308. }
  309.  
  310. if (isset($composenew&& $composenew{
  311.     $comp_uri "../src/compose.php?mailbox="urlencode($mailbox).
  312.         "&amp;session=$composesession&amp";
  313.     displayPageHeader($color$mailbox"comp_in_new('$comp_uri');"false);
  314. else {
  315.     displayPageHeader($color$mailbox);
  316. }
  317. /*  See how the page was called and fire off correct function  */
  318. if (empty($submit&& !empty($what)) {
  319.     $submit _("Search");
  320. }
  321.  
  322. // need to verify security token if user wants to do anything
  323. if (!empty($submit)) {
  324.     sm_validate_security_token($submitted_token-1TRUE);
  325. }
  326.  
  327. if ($submit == 'forget' && isset($count)) {
  328.     forget_recent($count$username$data_dir);
  329. }
  330. elseif ($submit == 'save' && isset($count)) {
  331.     save_recent($count$username$data_dir);
  332. }
  333. elseif ($submit == 'delete' && isset($count)) {
  334.     delete_saved($count$username$data_dir);
  335. }
  336. elseif (!empty($submit&& !empty($what)) {
  337.     $submit _("Search");
  338.     if ($recent_count 0{
  339.         update_recent($what$where$mailbox$username$data_dir);
  340.     }
  341. }
  342.  
  343. do_hook('search_before_form');
  344.  
  345. echo html_tag'table',
  346.          html_tag'tr'"\n" .
  347.              html_tag'td''<b>' _("Search"'</b>''center'$color[0)
  348.          ,
  349.      '''''width="100%"'"\n";
  350.  
  351. /*  update the recent and saved searches from the pref files  */
  352. $attributes get_recent($username$data_dir);
  353. $saved_attributes get_saved($username$data_dir);
  354. if (isset($saved_attributes['saved_what'])) {
  355.     $saved_count count($saved_attributes['saved_what']);
  356. else {
  357.     $saved_count 0;
  358. }
  359. $count_all 0;
  360.  
  361. /* Saved Search Table */
  362. if ($saved_count 0{
  363.     echo "<br />\n"
  364.     . html_tag'table''''center'$color[9]'width="95%" cellpadding="1" cellspacing="1" border="0"' )
  365.     . html_tag'tr',
  366.           html_tag'td''<b>'._("Saved Searches"'</b>''center' )
  367.       )
  368.     . html_tag'tr' )
  369.     . html_tag'td' )
  370.     . html_tag'table''''center''''width="100%" cellpadding="2" cellspacing="2" border="0"' );
  371.     for ($i=0$i $saved_count++$i{
  372.         if ($i 2{
  373.             echo html_tag'tr'''''$color[0);
  374.         else {
  375.             echo html_tag'tr'''''$color[4);
  376.         }
  377.         echo html_tag'td'sm_encode_html_special_chars(imap_utf7_decode_local($saved_attributes['saved_folder'][$i 1]))'left''''width="35%"' )
  378.         . html_tag'td'sm_encode_html_special_chars($saved_attributes['saved_what'][$i 1])'left''''width="35%"' )
  379.         . html_tag'td'sm_encode_html_special_chars($saved_attributes['saved_where'][$i 1])'center' )
  380.         . html_tag'td''''right' )
  381.         .   '<a href="search.php'
  382.         .     '?mailbox=' urlencode($saved_attributes['saved_folder'][$i 1])
  383.         .     '&amp;what=' urlencode($saved_attributes['saved_what'][$i 1])
  384.         .     '&amp;where=' urlencode($saved_attributes['saved_where'][$i 1])
  385.         .     '&amp;smtoken=' sm_generate_security_token()
  386.         .   '">' _("edit"'</a>'
  387.         .   '&nbsp;|&nbsp;'
  388.         .   '<a href="search.php'
  389.         .     '?mailbox=' urlencode($saved_attributes['saved_folder'][$i 1])
  390.         .     '&amp;what=' urlencode($saved_attributes['saved_what'][$i 1])
  391.         .     '&amp;where=' urlencode($saved_attributes['saved_where'][$i 1])
  392.         .     '&amp;submit=Search_no_update'
  393.         .     '&amp;smtoken=' sm_generate_security_token()
  394.         .   '">' _("search"'</a>'
  395.         .   '&nbsp;|&nbsp;'
  396.         .   "<a href=\"search.php?count=$i&amp;submit=delete&amp;smtoken=sm_generate_security_token(.'">'
  397.         .     _("delete")
  398.         .   '</a>'
  399.         . '</td></tr>';
  400.     }
  401.     echo "</table></td></tr></table>\n";
  402. }
  403.  
  404. if ($recent_count 0{
  405.     echo "<br />\n"
  406.        . html_tag'table''''center'$color[9]'width="95%" cellpadding="1" cellspacing="1" border="0"' )
  407.        . html_tag'tr',
  408.              html_tag'td''<b>' _("Recent Searches"'</b>''center' )
  409.          )
  410.        . html_tag'tr' )
  411.        . html_tag'td' )
  412.        . html_tag'table''''center''''width="100%" cellpadding="0" cellspacing="0" border="0"' );
  413.     for ($i=1$i <= $recent_count++$i{
  414.             if (isset($attributes['search_folder'][$i])) {
  415.             if ($attributes['search_folder'][$i== ""{
  416.                 $attributes['search_folder'][$i"INBOX";
  417.             }
  418.             }
  419.             if ($i 2{
  420.                 echo html_tag'tr'''''$color[0);
  421.             else {
  422.                 echo html_tag'tr'''''$color[0);
  423.             }
  424.             if (isset($attributes['search_what'][$i]&&
  425.                 !empty($attributes['search_what'][$i])) {
  426.             echo html_tag'td'sm_encode_html_special_chars(imap_utf7_decode_local($attributes['search_folder'][$i]))'left''''width="35%"' )
  427.                . html_tag'td'sm_encode_html_special_chars($attributes['search_what'][$i])'left''''width="35%"' )
  428.                . html_tag'td'sm_encode_html_special_chars($attributes['search_where'][$i])'center' )
  429.                . html_tag'td''''right' )
  430.                .   "<a href=\"search.php?count=$i&amp;submit=save&amp;smtoken=sm_generate_security_token('">'
  431.                .     _("save")
  432.                .   '</a>'
  433.                .   '&nbsp;|&nbsp;'
  434.                .   '<a href="search.php'
  435.                .     '?mailbox=' urlencode($attributes['search_folder'][$i])
  436.                .     '&amp;what=' urlencode($attributes['search_what'][$i])
  437.                .     '&amp;where=' urlencode($attributes['search_where'][$i])
  438.                .     '&amp;submit=Search_no_update'
  439.                .     '&amp;smtoken=' sm_generate_security_token()
  440.                .   '">' _("search"'</a>'
  441.                .   '&nbsp;|&nbsp;'
  442.                .   "<a href=\"search.php?count=$i&amp;submit=forget&amp;smtoken=sm_generate_security_token('">'
  443.                .     _("forget")
  444.                .   '</a>'
  445.                . '</td></tr>';
  446.         }
  447.         }
  448.     echo '</table></td></tr></table><br />';
  449. }
  450.  
  451. /** FIXME: remove or fix it. $newsort is not set and not extracted from request
  452. if (isset($newsort)) {
  453.     $sort = $newsort;
  454.     sqsession_register($sort, 'sort');
  455. }*/
  456.  
  457. /*********************************************************************
  458.  * Check to see if we can use cache or not. Currently the only time  *
  459.  * when you will not use it is when a link on the left hand frame is *
  460.  * used. Also check to make sure we actually have the array in the   *
  461.  * registered session data.  :)                                      *
  462.  *********************************************************************/
  463.  
  464. /** FIXME: remove or fix it. $use_mailbox_cache is not set and not extracted from request
  465. if (! isset($use_mailbox_cache)) {
  466.     $use_mailbox_cache = 0;
  467. }*/
  468.  
  469. /* There is a problem with registered vars in 4.1 */
  470. /*
  471. if( substr( phpversion(), 0, 3 ) == '4.1'  ) {
  472.     $use_mailbox_cache = FALSE;
  473. }
  474. */
  475.  
  476. /* Search Form */
  477. echo html_tag'div''<b>' _("Current Search"'</b>''left' "\n"
  478.    . '<form action="search.php" name="s">'
  479.    . addHidden('smtoken'sm_generate_security_token())
  480.    . '<select name="mailbox">'
  481.    . '<option value="All Folders"';
  482. if ($mailbox == 'All Folders'{
  483.     echo ' selected="selected"';
  484. }
  485. echo '>[ ' _("All Folders"" ]</option>\n";
  486.  
  487. $show_selected array(strtolower($mailbox));
  488. echo sqimap_mailbox_option_list($imapConnection$show_selected0$boxes);
  489.  
  490. // FIXME: explain all str_replace calls.
  491. $what_disp str_replace(','' '$what);
  492. $what_disp str_replace('\\\\''\\'$what_disp);
  493. $what_disp str_replace('\\"''"'$what_disp);
  494. $what_disp str_replace('"''&quot;'$what_disp);
  495.  
  496. echo '         </select>'
  497.    . '<input type="text" size="35" name="what" value="' $what_disp '" />'
  498.    . "<select name=\"where\">";
  499. s_opt'BODY'$where_("Body") );
  500. s_opt'TEXT'$where_("Everywhere") );
  501. s_opt'SUBJECT'$where_("Subject") );
  502. s_opt'FROM'$where_("From") );
  503. s_opt'CC'$where_("Cc") );
  504. s_opt'TO'$where_("To") );
  505. s_opt'TO_CC'$where_("To/Cc") );
  506. s_opt'TO_CC_FROM'$where_("To/Cc/From") );
  507. s_opt'TO_CC_FROM_SUBJECT'$where_("To/Cc/From/Subject") );
  508. echo "         </select>\n" 
  509.    . '<input type="submit" name="submit" value="' _("Search"'" />'
  510.    . "</form>\n";
  511.  
  512.  
  513. do_hook('search_after_form');
  514.  
  515.  
  516. /*
  517.     search all folders option still in the works. returns a table for each
  518.     folder it finds a match in.
  519. */
  520.  
  521. $old_value 0;
  522. if ($allow_thread_sort == TRUE{
  523.     $old_value $allow_thread_sort;
  524.     $allow_thread_sort FALSE;
  525. }
  526.  
  527. if ($search_all == 'all'{
  528.     $mailbox == '';
  529.     $boxcount count($boxes);
  530.     echo '<br /><center><b>' .
  531.          _("Search Results".
  532.          "</b></center><br />\n";
  533.     for ($x=0;$x<$boxcount;$x++{
  534.         if (!in_array('noselect'$boxes[$x]['flags'])) {
  535.             $mailbox $boxes[$x]['unformatted'];
  536.             if (($submit == _("Search"|| $submit == 'Search_no_update'&& !empty($what)) {
  537.                 sqimap_mailbox_select($imapConnection$mailbox);
  538.                 $msgs sqimap_search($imapConnection$where$what$mailbox$color0$search_all$count_all);
  539.                 $count_all count($msgs);
  540.                 printSearchMessages($msgs$mailbox$count_all$imapConnection,
  541.                                     $where$whatfalsefalse);
  542.                 array_push($perbox_count$count_all);
  543.             }
  544.         }
  545.     }
  546.     for ($i=0;$i<count($perbox_count);$i++{
  547.         if ($perbox_count[$i]{
  548.             $count_all true;
  549.             break;
  550.         }
  551.     }
  552.     if (!$count_all{
  553.        echo '<br /><center>' _("No Messages Found"'</center>';
  554.     }
  555. }
  556.  
  557. /*  search one folder option  */
  558. else {
  559.     if (($submit == _("Search"|| $submit == 'Search_no_update'&& !empty($what)) {
  560.         echo '<br />'
  561.         . html_tag'div''<b>' _("Search Results"'</b>''center' "\n";
  562.         sqimap_mailbox_select($imapConnection$mailbox);
  563.         $msgs sqimap_search($imapConnection$where$what$mailbox$color0$search_all$count_all);
  564.         if (count($msgs)) {
  565.             printSearchMessages($msgs$mailboxcount($msgs)$imapConnection,
  566.                                 $where$whatfalsefalse);
  567.         else {
  568.             echo '<br /><center>' _("No Messages Found"'</center>';
  569.         }
  570.     }
  571. }
  572.  
  573. /*  must have search terms to search  */
  574. if ($submit == _("Search"&& empty($what)) {
  575.         echo '<br />'
  576.         . html_tag'div''<b>' _("Please enter something to search for"'</b>''center' "\n";
  577. }
  578.  
  579. $allow_thread_sort $old_value;
  580.  
  581.  
  582. do_hook('search_bottom');
  583. sqimap_logout($imapConnection);
  584. echo '</body></html>';

Documentation generated on Mon, 13 Jan 2020 04:25:15 +0100 by phpDocumentor 1.4.3