diff options
author | alecpl <alec@alec.pl> | 2010-10-13 19:15:51 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-13 19:15:51 +0000 |
commit | f6aac389bfc29e0f6d1f2d43aa900a2ba017bc2f (patch) | |
tree | d9c57cca7f4f110c96a16063b7000bceac77a5cf /program/steps/mail/func.inc | |
parent | ad334a12579f21e4e04a47e257b9d0ac71d50b98 (diff) |
- Minimize session data size by storing only last search result
and by removing search result from session after listing with empty search filter
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r-- | program/steps/mail/func.inc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 9a24a97c0..678dc0494 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -72,33 +72,32 @@ if (isset($_GET['_threads'])) { $IMAP->set_threading($a_threading[$_SESSION['mbox']]); // set message set for search result -if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) - { - $IMAP->set_search_set($_SESSION['search'][$_REQUEST['_search']]); +if (!empty($_REQUEST['_search']) && isset($_SESSION['search']) + && $_SESSION['search_request'] == $_REQUEST['_search'] +) { + $IMAP->set_search_set($_SESSION['search']); $OUTPUT->set_env('search_request', $_REQUEST['_search']); $OUTPUT->set_env('search_text', $_SESSION['last_text_search']); - } +} // set main env variables, labels and page title -if (empty($RCMAIL->action) || $RCMAIL->action == 'list') - { +if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { $mbox_name = $IMAP->get_mailbox_name(); - if (empty($RCMAIL->action)) - { + if (empty($RCMAIL->action)) { // initialize searching result if search_filter is used - if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') - { + if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') { $search_request = md5($mbox_name.$_SESSION['search_filter']); $IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']); - $_SESSION['search'][$search_request] = $IMAP->get_search_set(); + $_SESSION['search'] = $IMAP->get_search_set(); + $_SESSION['search_request'] = $search_request; $OUTPUT->set_env('search_request', $search_request); } $search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT); $OUTPUT->set_env('search_mods', $search_mods); - } + } // set current mailbox and some other vars in client environment $OUTPUT->set_env('mailbox', $mbox_name); @@ -135,7 +134,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') 'movingmessage', 'copyingmessage', 'copy', 'move', 'quota'); $OUTPUT->set_pagetitle(rcmail_localize_foldername($mbox_name)); - } +} /** |