From cf710efeb46ad22432121211c29789bf5f2101b4 Mon Sep 17 00:00:00 2001 From: jmunro Date: Sun, 14 Apr 2002 03:00:40 +0000 Subject: [PATCH] fix for bug #538641. Also fixes a few problems with sort types and the prev/next links. also fixed a warning with incorrect login and E_ALL git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2719 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/display_messages.php | 3 ++- functions/mailbox_display.php | 18 +++++++----------- src/left_main.php | 2 +- src/options_display.php | 2 +- src/read_body.php | 20 ++++++++++---------- src/right_main.php | 16 ++++++++++++++-- 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/functions/display_messages.php b/functions/display_messages.php index 9fd58967..f0291ab2 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -93,7 +93,8 @@ function plain_error_message($message, $color) { function logout_error( $errString, $errTitle = '' ) { GLOBAL $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, - $hide_sm_attributions, $version, $DOCUMENT_ROOT; + $hide_sm_attributions, $version, $DOCUMENT_ROOT, + $squirrelmail_language; $base_uri = sqm_baseuri(); include_once($DOCUMENT_ROOT . $base_uri . 'functions/page_header.php' ); if ( !isset( $org_logo ) ) { diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index b3d97bc2..0c984df5 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -719,21 +719,21 @@ function mail_message_listing_beginning ($imapConnection, $moveURL, } else { echo ' ' . _("From") . ''; } - if ($thread_sort_messages != 1) { + if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) { ShowSortButton($sort, $mailbox, 2, 3); } echo "\n"; break; case 3: /* date */ echo ' ' . _("Date") . ''; - if ($thread_sort_messages != 1) { + if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) { ShowSortButton($sort, $mailbox, 0, 1); } echo "\n"; break; case 4: /* subject */ echo ' ' . _("Subject") . ' '; - if ($thread_sort_messages != 1) { + if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) { ShowSortButton($sort, $mailbox, 4, 5); } echo "\n"; @@ -814,10 +814,6 @@ function get_selectall_link($start_msg, $sort) { . '&what=' . urlencode($what); } - if ($PG_SHOWNUM == 999999) { - $result .= '&PG_SHOWNUM=999999'; - } - $result .= "\">"; if (isset($checkall) && ($checkall == '1')) { @@ -1025,14 +1021,14 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs, } } } else if ($PG_SHOWNUM == 999999) { - $pg_str = "" - . _("Paginate") . '' . $spc; + $pg_str = "" ._("Paginate") . '' . $spc; } /* If necessary, compute the 'show all' string. */ if (($prv_str != '') || ($nxt_str != '')) { - $all_str = "" . _("Show All") . ''; } diff --git a/src/left_main.php b/src/left_main.php index c9b1c217..53c7d4ad 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -65,7 +65,7 @@ function formatMailboxName($imapConnection, $box_array) { if ($unseen > 0) { $line .= ''; } /* Crate the link for this folder. */ - $line .= ""; + $line .= ""; if ($special_color) { $line .= ""; } diff --git a/src/options_display.php b/src/options_display.php index d9414645..113c35b0 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -260,7 +260,7 @@ function load_optpage_data_display() { 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_ALL ); - if ($allow_thread_sort == 'TRUE') { + if ($allow_thread_sort == 'true') { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'sort_by_ref', 'caption' => _("Use References header for thread sort"), diff --git a/src/read_body.php b/src/read_body.php index ec9a7623..f9d15ba3 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -28,10 +28,10 @@ require_once('../functions/smtp.php'); */ function findNextMessage() { global $msort, $currentArrayIndex, $msgs, $sort, - $allow_thread_sort, $allow_server_sort, + $thread_sort_messages, $allow_server_sort, $server_sort_array; $result = -1; - if ($allow_thread_sort == true || $allow_server_sort == true) { + if ($thread_sort_messages == 1 || $allow_server_sort == 'true') { reset($server_sort_array); while(list($key, $value) = each ($server_sort_array)) { if ($currentArrayIndex == $value) { @@ -44,13 +44,13 @@ function findNextMessage() { } } } - elseif ($sort == 6 && $allow_server_sort != true && - $allow_thread_sort != true) { + elseif ($sort == 6 && $allow_server_sort != 'true' && + $thread_sort_messages != 1) { if ($currentArrayIndex != 1) { $result = $currentArrayIndex - 1; } } - elseif ($allow_server_sort != true && $allow_thread_sort != true) { + elseif ($allow_server_sort != 'true' && $thread_sort_messages != 1 ) { if (!is_array($msort)) { return -1; } @@ -86,10 +86,10 @@ function RemoveAddress(&$addr_list, $addr) { /** returns the index of the previous message from the array. */ function findPreviousMessage() { global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection, - $mailbox, $data_dir, $username, $allow_thread_sort, + $mailbox, $data_dir, $username, $thread_sort_messages, $allow_server_sort, $server_sort_array; $result = -1; - if ($allow_thread_sort == true || $allow_server_sort == TRUE) { + if ($thread_sort_messages == 1 || $allow_server_sort == 'true') { reset($server_sort_array); while(list($key, $value) = each ($server_sort_array)) { if ($currentArrayIndex == $value) { @@ -102,14 +102,14 @@ function findPreviousMessage() { } } } - elseif ($sort == 6 && $allow_server_sort != TRUE && - $allow_thread_sort != true) { + elseif ($sort == 6 && $allow_server_sort != 'true' && + $thread_sort_messages != 1) { $numMessages = sqimap_get_num_messages($imapConnection, $mailbox); if ($currentArrayIndex != $numMessages) { $result = $currentArrayIndex + 1; } } - elseif ($allow_thread_sort != true && $allow_server_sort != TRUE) { + elseif ($thread_sort_messages != 1 && $allow_server_sort != 'true') { if (!is_array($msort)) { return -1; } diff --git a/src/right_main.php b/src/right_main.php index 01d7634c..306bbdd0 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -39,7 +39,19 @@ $bob = getHashedFile($username, $data_dir, "username.pref"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); -if( isset( $PG_SHOWNUM ) ) { +global $PG_SHOWNUM; +if (isset($PG_SHOWALL)) { + if ($PG_SHOWALL) { + $PG_SHOWNUM=999999; + $show_num=$PG_SHOWNUM; + session_register('PG_SHOWNUM'); + } + else { + session_unregister('PG_SHOWNUM'); + unset($PG_SHOWNUM); + } +} +else if( isset( $PG_SHOWNUM ) ) { $show_num = $PG_SHOWNUM; } @@ -69,7 +81,7 @@ if ($imap_server_type == 'uw' && (strstr($mailbox, '../') || /* decide if we are thread sorting or not */ global $allow_thread_sort; -if ($allow_thread_sort == TRUE) { +if ($allow_thread_sort == 'true') { if (isset($set_thread)) { if ($set_thread == 1) { setPref($data_dir, $username, "thread_$mailbox", 1); -- 2.25.1