squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

search.php
Go to the documentation of this file.
1 <?php
2 
16 define('PAGE_NAME', 'search');
17 
22 define('SM_PATH','../');
23 
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', $username, SQ_SESSION);
38 sqgetGlobalVar('key', $key, SQ_COOKIE);
39 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
40 sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
41 sqgetGlobalVar('composenew' , $composenew, SQ_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( $where, array('BODY','TEXT','SUBJECT','FROM','CC','TO'))) {
55  // make sure that 'where' is one if standard IMAP SEARCH keywords
56  if (isset($mailbox) && isSentMailbox($mailbox, TRUE))
57  $where = 'TO';
58  else
59  $where = 'FROM';
60 }
61 if ( !sqgetGlobalVar('preselected', $preselected, SQ_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_token, SQ_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 */
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][$x] = getPref($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 */
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);
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');
161  reset($types);
162  foreach ($types as $key) {
163  array_splice($attributes[$key], $forget_index - 1, 1);
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');
182  foreach ($types as $key) {
183  array_splice($attributes[$key], $delete_index, 1);
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(0 => 'saved_what', 1 => 'saved_where', 2 => '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  }
216  $n = 0;
217  foreach ($types as $key) {
218  $slice = array_slice($attributes[$key], $save_index, 1);
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  htmlspecialchars($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  $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $mailbox);
247  $form_name = "FormMsgs" . $safe_name;
248  echo '<form name="' . $form_name . '" method="post" action="move_messages.php">' ."\n" .
249  '<input type="hidden" name="mailbox" value="'.htmlspecialchars($mailbox).'">' . "\n" .
250  '<input type="hidden" name="startMessage" value="1">' . "\n" .
251  addHidden('smtoken', sm_generate_security_token()) . "\n";
252 
253  echo '<table border="0" width="100%" cellpadding="0" cellspacing="0">';
254  echo '<tr><td>';
255 
257  $msg_cnt_str, $toggle_all, 1);
258 
259  echo '</td></tr>';
260  echo '<tr><td height="5" bgcolor="'.$color[4].'"></td></tr>';
261  echo '<tr><td>';
262  echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
263  echo ' <tr><td>';
264  echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[5].'">';
265  echo '<tr><td>';
266 
267  printHeader($mailbox, 6, $color, false);
268 
270  $msort, $mailbox, $sort, $color, $cnt, $where, $what);
271 
272  echo '</td></tr></table></td></tr></table>';
273  mail_message_listing_end($cnt, '', $msg_cnt_str, $color);
274  echo "\n</table></form>\n\n";
275  }
276 }
277 
278 /* ------------------------ main ------------------------ */
279 
280 /* reset these arrays on each page load just in case */
281 $attributes = array ();
282 $saved_attributes = array ();
283 $search_all = 'none';
284 $perbox_count = array ();
285 $recent_count = getPref($data_dir, $username, 'search_memory', 0);
286 
287 /* get mailbox names */
290 
291 /* set current mailbox to INBOX if none was selected or if page
292  was called to search all folders. */
293 if ( !isset($mailbox) || $mailbox == 'None' || $mailbox == '' ) {
294  $mailbox = $boxes[0]['unformatted'];
295 }
296 if ($mailbox == 'All Folders') {
297  $search_all = 'all';
298 }
299 
300 // the preg_match() is a fix for Dovecot wherein UIDs can be bigger than
301 // normal integers - this isn't in 1.4 yet, but when adding new code, why not...
302 if (sqgetGlobalVar('unread_passed_id', $unread_passed_id, SQ_GET)
303  && preg_match('/^[0-9]+$/', $unread_passed_id)) {
305  sqimap_toggle_flag($imapConnection, $unread_passed_id, '\\Seen', false, true);
306 }
307 
308 if (isset($composenew) && $composenew) {
309  $comp_uri = "../src/compose.php?mailbox=". urlencode($mailbox).
310  "&amp;session=$composesession&amp";
311  displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri');", false);
312 } else {
314 }
315 /* See how the page was called and fire off correct function */
316 if (empty($submit) && !empty($what)) {
317  $submit = _("Search");
318 }
319 
320 // need to verify security token if user wants to do anything
321 if (!empty($submit)) {
322  sm_validate_security_token($submitted_token, 3600, TRUE);
323 }
324 
325 if ($submit == _("Search") && !empty($what)) {
326  if ($recent_count > 0) {
327  update_recent($what, $where, $mailbox, $username, $data_dir);
328  }
329 }
330 elseif ($submit == 'forget' && isset($count)) {
332 }
333 elseif ($submit == 'save' && isset($count)) {
335 }
336 elseif ($submit == 'delete' && isset($count)) {
338 }
339 
340 do_hook('search_before_form');
341 
342 echo html_tag( 'table',
343  html_tag( 'tr', "\n" .
344  html_tag( 'td', '<b>' . _("Search") . '</b>', 'center', $color[0] )
345  ) ,
346  '', '', 'width="100%"') . "\n";
347 
348 /* update the recent and saved searches from the pref files */
351 if (isset($saved_attributes['saved_what'])) {
352  $saved_count = count($saved_attributes['saved_what']);
353 } else {
354  $saved_count = 0;
355 }
357 
358 /* Saved Search Table */
359 if ($saved_count > 0) {
360  echo "<br />\n"
361  . html_tag( 'table', '', 'center', $color[9], 'width="95%" cellpadding="1" cellspacing="1" border="0"' )
362  . html_tag( 'tr',
363  html_tag( 'td', '<b>'._("Saved Searches") . '</b>', 'center' )
364  )
365  . html_tag( 'tr' )
366  . html_tag( 'td' )
367  . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"' );
368  for ($i=0; $i < $saved_count; ++$i) {
369  if ($i % 2) {
370  echo html_tag( 'tr', '', '', $color[0] );
371  } else {
372  echo html_tag( 'tr', '', '', $color[4] );
373  }
374  echo html_tag( 'td', htmlspecialchars(imap_utf7_decode_local($saved_attributes['saved_folder'][$i + 1])), 'left', '', 'width="35%"' )
375  . html_tag( 'td', htmlspecialchars($saved_attributes['saved_what'][$i + 1]), 'left' )
376  . html_tag( 'td', htmlspecialchars($saved_attributes['saved_where'][$i + 1]), 'center' )
377  . html_tag( 'td', '', 'right' )
378  . '<a href="search.php'
379  . '?mailbox=' . urlencode($saved_attributes['saved_folder'][$i + 1])
380  . '&amp;what=' . urlencode($saved_attributes['saved_what'][$i + 1])
381  . '&amp;where=' . urlencode($saved_attributes['saved_where'][$i + 1])
382  . '&amp;smtoken=' . sm_generate_security_token()
383  . '">' . _("edit") . '</a>'
384  . '&nbsp;|&nbsp;'
385  . '<a href="search.php'
386  . '?mailbox=' . urlencode($saved_attributes['saved_folder'][$i + 1])
387  . '&amp;what=' . urlencode($saved_attributes['saved_what'][$i + 1])
388  . '&amp;where=' . urlencode($saved_attributes['saved_where'][$i + 1])
389  . '&amp;submit=Search_no_update'
390  . '&amp;smtoken=' . sm_generate_security_token()
391  . '">' . _("search") . '</a>'
392  . '&nbsp;|&nbsp;'
393  . "<a href=\"search.php?count=$i&amp;submit=delete&amp;smtoken=" . sm_generate_security_token() .'">'
394  . _("delete")
395  . '</a>'
396  . '</td></tr>';
397  }
398  echo "</table></td></tr></table>\n";
399 }
400 
401 if ($recent_count > 0) {
402  echo "<br />\n"
403  . html_tag( 'table', '', 'center', $color[9], 'width="95%" cellpadding="1" cellspacing="1" border="0"' )
404  . html_tag( 'tr',
405  html_tag( 'td', '<b>' . _("Recent Searches") . '</b>', 'center' )
406  )
407  . html_tag( 'tr' )
408  . html_tag( 'td' )
409  . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="0" cellspacing="0" border="0"' );
410  for ($i=1; $i <= $recent_count; ++$i) {
411  if (isset($attributes['search_folder'][$i])) {
412  if ($attributes['search_folder'][$i] == "") {
413  $attributes['search_folder'][$i] = "INBOX";
414  }
415  }
416  if ($i % 2) {
417  echo html_tag( 'tr', '', '', $color[0] );
418  } else {
419  echo html_tag( 'tr', '', '', $color[0] );
420  }
421  if (isset($attributes['search_what'][$i]) &&
422  !empty($attributes['search_what'][$i])) {
423  echo html_tag( 'td', htmlspecialchars(imap_utf7_decode_local($attributes['search_folder'][$i])), 'left', '', 'width="35%"' )
424  . html_tag( 'td', htmlspecialchars($attributes['search_what'][$i]), 'left' )
425  . html_tag( 'td', htmlspecialchars($attributes['search_where'][$i]), 'center' )
426  . html_tag( 'td', '', 'right' )
427  . "<a href=\"search.php?count=$i&amp;submit=save&amp;smtoken=" . sm_generate_security_token() . '">'
428  . _("save")
429  . '</a>'
430  . '&nbsp;|&nbsp;'
431  . '<a href="search.php'
432  . '?mailbox=' . urlencode($attributes['search_folder'][$i])
433  . '&amp;what=' . urlencode($attributes['search_what'][$i])
434  . '&amp;where=' . urlencode($attributes['search_where'][$i])
435  . '&amp;submit=Search_no_update'
436  . '&amp;smtoken=' . sm_generate_security_token()
437  . '">' . _("search") . '</a>'
438  . '&nbsp;|&nbsp;'
439  . "<a href=\"search.php?count=$i&amp;submit=forget&amp;smtoken=" . sm_generate_security_token() . '">'
440  . _("forget")
441  . '</a>'
442  . '</td></tr>';
443  }
444  }
445  echo '</table></td></tr></table><br />';
446 }
447 
454 /*********************************************************************
455  * Check to see if we can use cache or not. Currently the only time *
456  * when you will not use it is when a link on the left hand frame is *
457  * used. Also check to make sure we actually have the array in the *
458  * registered session data. :) *
459  *********************************************************************/
460 
466 /* There is a problem with registered vars in 4.1 */
467 /*
468 if( substr( phpversion(), 0, 3 ) == '4.1' ) {
469  $use_mailbox_cache = FALSE;
470 }
471 */
472 
473 /* Search Form */
474 echo html_tag( 'div', '<b>' . _("Current Search") . '</b>', 'left' ) . "\n"
475  . '<form action="search.php" name="s">'
476  . addHidden('smtoken', sm_generate_security_token())
477  . html_tag( 'table', '', '', '', 'width="95%" cellpadding="0" cellspacing="0" border="0"' )
478  . html_tag( 'tr' )
479  . html_tag( 'td', '', 'left' )
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));
489 
490  echo ' </select>'.
491  " </td>\n";
492 
493 // FIXME: explain all str_replace calls.
494 $what_disp = str_replace(',', ' ', $what);
495 $what_disp = str_replace('\\\\', '\\', $what_disp);
496 $what_disp = str_replace('\\"', '"', $what_disp);
497 $what_disp = str_replace('"', '&quot;', $what_disp);
498 
499 echo html_tag( 'td', '<input type="text" size="35" name="what" value="' . $what_disp . '" />' . "\n", 'center' )
500  . html_tag( 'td', '', 'right' )
501  . "<select name=\"where\">";
502 s_opt( 'BODY', $where, _("Body") );
503 s_opt( 'TEXT', $where, _("Everywhere") );
504 s_opt( 'SUBJECT', $where, _("Subject") );
505 s_opt( 'FROM', $where, _("From") );
506 s_opt( 'CC', $where, _("Cc") );
507 s_opt( 'TO', $where, _("To") );
508 echo " </select>\n" .
509  " </td>\n".
510  html_tag( 'td', '<input type="submit" name="submit" value="' . _("Search") . '" />' . "\n", 'center', '', 'colspan="3"' ) .
511  " </tr>\n".
512  " </table>\n".
513  "</form>\n";
514 
515 
516 do_hook('search_after_form');
517 
518 flush();
519 
520 /*
521  search all folders option still in the works. returns a table for each
522  folder it finds a match in.
523 */
524 
525 $old_value = 0;
526 if ($allow_thread_sort == TRUE) {
528  $allow_thread_sort = FALSE;
529 }
530 
531 if ($search_all == 'all') {
532  $mailbox == '';
533  $boxcount = count($boxes);
534  echo '<br /><center><b>' .
535  _("Search Results") .
536  "</b></center><br />\n";
537  for ($x=0;$x<$boxcount;$x++) {
538  if (!in_array('noselect', $boxes[$x]['flags'])) {
539  $mailbox = $boxes[$x]['unformatted'];
540  if (($submit == _("Search") || $submit == 'Search_no_update') && !empty($what)) {
543  $count_all = count($msgs);
545  $where, $what, false, false);
546  array_push($perbox_count, $count_all);
547  }
548  }
549  }
550  for ($i=0;$i<count($perbox_count);$i++) {
551  if ($perbox_count[$i]) {
552  $count_all = true;
553  break;
554  }
555  }
556  if (!$count_all) {
557  echo '<br /><center>' . _("No Messages Found") . '</center>';
558  }
559 }
560 
561 /* search one folder option */
562 else {
563  if (($submit == _("Search") || $submit == 'Search_no_update') && !empty($what)) {
564  echo '<br />'
565  . html_tag( 'div', '<b>' . _("Search Results") . '</b>', 'center' ) . "\n";
568  if (count($msgs)) {
570  $where, $what, false, false);
571  } else {
572  echo '<br /><center>' . _("No Messages Found") . '</center>';
573  }
574  }
575 }
576 
577 /* must have search terms to search */
578 if ($submit == _("Search") && empty($what)) {
579  echo '<br />'
580  . html_tag( 'div', '<b>' . _("Please enter something to search for") . '</b>', 'center' ) . "\n";
581 }
582 
584 
585 
586 do_hook('search_bottom');
588 echo '</body></html>';
delete_saved
delete_saved($delete_index, $username, $data_dir)
Definition: search.php:179
get_selectall_link
get_selectall_link($start_msg, $sort)
Definition: mailbox_display.php:956
$attributes
$attributes
Definition: search.php:281
elseif
if(! sqgetGlobalVar('sound', $sound, SQ_GET)) elseif($sound=='(none)')
Definition: testsound.php:25
sqgetGlobalVar
sqgetGlobalVar($name, &$value, $search=SQ_INORDER)
Definition: global.php:344
getPref
getPref($data_dir, $username, $string, $default='')
Definition: db_prefs.php:316
mail_message_listing_end
mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color)
Definition: mailbox_display.php:832
$cnt
$cnt
Definition: options_identities.php:86
$perbox_count
$perbox_count
Definition: search.php:284
html_tag
html_tag( $tag, $val='', $align='', $bgcolor='', $xtra='')
Definition: html.php:27
$count
$count
Definition: message_details_bottom.php:97
$imapServerAddress
$imapServerAddress
Definition: config_default.php:202
sqimap_login
sqimap_login($username, $password, $imap_server_address, $imap_port, $hide)
Definition: imap_general.php:481
$show_selected
$show_selected
Definition: search.php:486
printSearchMessages
printSearchMessages($msgs, $mailbox, $cnt, $imapConnection, $where, $what, $usecache=false, $newsort=false)
Definition: search.php:225
$data_dir
$data_dir
Definition: config_default.php:499
$old_value
$old_value
Definition: search.php:524
SQ_SESSION
const SQ_SESSION
Definition: global.php:18
get_recent
get_recent($username, $data_dir)
Definition: search.php:90
sqimap_toggle_flag
sqimap_toggle_flag($imap_stream, $id, $flag, $set, $handle_errors)
Definition: imap_messages.php:1173
displayPageHeader
displayPageHeader($color, $mailbox, $xtra='', $session=false)
Definition: page_header.php:105
$mailbox
$mailbox
Definition: options.php:28
setPref
setPref($data_dir, $username, $string, $set_to)
Definition: db_prefs.php:352
$search_all
$search_all
Definition: search.php:283
$username
global $username
Definition: validate.php:55
do_hook
do_hook($name)
Definition: plugin.php:42
$count_all
$count_all
Definition: search.php:356
sqimap_mailbox_select
sqimap_mailbox_select($imap_stream, $mailbox)
Definition: imap_mailbox.php:238
$boxes
$boxes
Definition: search.php:289
$sort
$sort
Definition: load_prefs.php:170
sm_validate_security_token
sm_validate_security_token($token, $validity_period=0, $show_error=FALSE)
Definition: strings.php:1405
forget_recent
forget_recent($forget_index, $username, $data_dir)
Definition: search.php:157
update_recent
update_recent($what, $where, $mailbox, $username, $data_dir)
Definition: search.php:121
$what_disp
$what_disp
Definition: search.php:493
$recent_count
$recent_count
Definition: search.php:285
isSentMailbox
isSentMailbox($box, $include_subs=true)
Definition: imap_mailbox.php:173
save_recent
save_recent($save_index, $username, $data_dir)
Definition: search.php:203
sqimap_logout
sqimap_logout($imap_stream)
Definition: imap_general.php:639
SM_PATH
const SM_PATH
Definition: search.php:22
removePref
removePref($data_dir, $username, $string)
Definition: db_prefs.php:331
sm_generate_security_token
sm_generate_security_token()
Definition: strings.php:1340
$allow_thread_sort
global $allow_thread_sort
Definition: search.php:26
SQ_GET
const SQ_GET
Definition: global.php:16
sqimap_mailbox_option_list
sqimap_mailbox_option_list($imap_stream, $show_selected=0, $folder_skip=0, $boxes=0, $flag='noselect', $use_long_format=false)
Definition: imap_mailbox.php:521
get_msgcnt_str
get_msgcnt_str($start_msg, $end_msg, $num_msgs)
Definition: mailbox_display.php:1014
addHidden
addHidden($name, $value)
Definition: forms.php:58
imap_utf7_decode_local
imap_utf7_decode_local($s)
Definition: imap_utf7_local.php:88
s_opt
if(!sqgetGlobalVar('smtoken', $submitted_token, SQ_GET)) s_opt( $val, $sel, $tit)
Definition: search.php:81
printHeader
printHeader($mailbox, $sort, $color, $showsort=true)
Definition: mailbox_display.php:857
_
_($str)
Definition: gettext.php:160
get_saved
get_saved($username, $data_dir)
Definition: search.php:104
$allow_server_sort
$allow_server_sort
Definition: config_default.php:625
sqimap_search
sqimap_search($imapConnection, $search_where, $search_what, $mailbox, $color, $search_position='', $search_all, $count_all)
Definition: imap_search.php:23
$imapConnection
$imapConnection
Definition: search.php:288
$imapPort
$imapPort
Definition: config_default.php:210
SQ_FORM
const SQ_FORM
Definition: global.php:21
$boxcount
$boxcount
Definition: left_main.php:420
displayMessageArray
displayMessageArray($imapConnection, $num_msgs, $start_msg, $msort, $mailbox, $sort, $color, $show_num, $where=0, $what=0)
Definition: mailbox_display.php:619
$color
$color
Definition: load_prefs.php:28
$sel
$sel
Definition: login.php:44
SQ_COOKIE
const SQ_COOKIE
Definition: global.php:19
calc_msort
calc_msort($msgs, $sort, $mailbox='INBOX')
Definition: mailbox_display.php:563
$msgs
if(isset($sendreceipt)) $msgs[$passed_id]['FLAG_SEEN']
Definition: read_body.php:852
$saved_attributes
$saved_attributes
Definition: search.php:282
sqimap_mailbox_list
sqimap_mailbox_list($imap_stream, $force=false)
Definition: imap_mailbox.php:597
mail_message_listing_beginning
mail_message_listing_beginning($imapConnection, $mailbox='', $sort=-1, $msg_cnt_str='', $paginator='&nbsp;', $start_msg=1)
Definition: mailbox_display.php:716