fix for bug #538641. Also fixes a few problems with sort types and the prev/next
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Apr 2002 03:00:40 +0000 (03:00 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 14 Apr 2002 03:00:40 +0000 (03:00 +0000)
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
functions/mailbox_display.php
src/left_main.php
src/options_display.php
src/read_body.php
src/right_main.php

index 9fd589676b5c5b243bc405eef99c3a856fee6ce6..f0291ab26829d0aec3cb9267127ed5dd2149ece5 100644 (file)
@@ -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,
 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 ) ) {
     $base_uri = sqm_baseuri();
     include_once($DOCUMENT_ROOT . $base_uri . 'functions/page_header.php' );
     if ( !isset( $org_logo ) ) {
index b3d97bc21902b1af27d555c7bb942ff3a8472c54..0c984df5f430522b332846a1bcf4964a2d83e789 100644 (file)
@@ -719,21 +719,21 @@ function mail_message_listing_beginning ($imapConnection, $moveURL,
       } else {
        echo '   <TD WIDTH="25%"><B>' . _("From") . '</B>';
       }
       } else {
        echo '   <TD WIDTH="25%"><B>' . _("From") . '</B>';
       }
-      if ($thread_sort_messages != 1) {
+      if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
        ShowSortButton($sort, $mailbox, 2, 3);
       }
       echo "</TD>\n";
       break;
     case 3: /* date */
       echo '   <TD NOWRAP WIDTH="5%"><B>' . _("Date") . '</B>';
        ShowSortButton($sort, $mailbox, 2, 3);
       }
       echo "</TD>\n";
       break;
     case 3: /* date */
       echo '   <TD NOWRAP WIDTH="5%"><B>' . _("Date") . '</B>';
-      if ($thread_sort_messages != 1) {
+      if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
        ShowSortButton($sort, $mailbox, 0, 1);
       }
       echo "</TD>\n";
       break;
     case 4: /* subject */
       echo '   <TD><B>' . _("Subject") . '</B> ';
        ShowSortButton($sort, $mailbox, 0, 1);
       }
       echo "</TD>\n";
       break;
     case 4: /* subject */
       echo '   <TD><B>' . _("Subject") . '</B> ';
-      if ($thread_sort_messages != 1) {
+      if ($allow_thread_sort != 'true' || $thread_sort_messages != 1) {
        ShowSortButton($sort, $mailbox, 4, 5);
       }
       echo "</TD>\n";
        ShowSortButton($sort, $mailbox, 4, 5);
       }
       echo "</TD>\n";
@@ -814,10 +814,6 @@ function get_selectall_link($start_msg, $sort) {
        . '&amp;what=' . urlencode($what);
     }
     
        . '&amp;what=' . urlencode($what);
     }
     
-    if ($PG_SHOWNUM == 999999) {
-      $result .= '&amp;PG_SHOWNUM=999999';
-    }
-    
     $result .= "\">";
     
     if (isset($checkall) && ($checkall == '1')) {
     $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) {
        }
       }
   } else if ($PG_SHOWNUM == 999999) {
-    $pg_str = "<A HREF=\"right_main.php?use_mailbox_cache=$use"
-      . "&amp;startMessage=1&amp;mailbox=$box\" TARGET=\"right\">"
-      . _("Paginate") . '</A>' . $spc;
+    $pg_str = "<A HREF=\"right_main.php?PG_SHOWALL=0"
+      . "&amp;use_mailbox_cache=$use&amp;startMessage=1&amp;mailbox=$box\" "
+      . "TARGET=\"right\">" ._("Paginate") . '</A>' . $spc;
   }
 
   /* If necessary, compute the 'show all' string. */
   if (($prv_str != '') || ($nxt_str != '')) {
   }
 
   /* If necessary, compute the 'show all' string. */
   if (($prv_str != '') || ($nxt_str != '')) {
-    $all_str = "<A HREF=\"right_main.php?PG_SHOWNUM=999999"
+    $all_str = "<A HREF=\"right_main.php?PG_SHOWALL=1"
       . "&amp;use_mailbox_cache=$use&amp;startMessage=1&amp;mailbox=$box\" "
       . "TARGET=\"right\">" . _("Show All") . '</A>';
   }
       . "&amp;use_mailbox_cache=$use&amp;startMessage=1&amp;mailbox=$box\" "
       . "TARGET=\"right\">" . _("Show All") . '</A>';
   }
index c9b1c217b6d0a5e98ac2b10ce02e3fd3b6c78b66..53c7d4ad396dca80590ac3234f8693d19b1c75ba 100644 (file)
@@ -65,7 +65,7 @@ function formatMailboxName($imapConnection, $box_array) {
     if ($unseen > 0) { $line .= '<B>'; }
 
     /* Crate the link for this folder. */
     if ($unseen > 0) { $line .= '<B>'; }
 
     /* Crate the link for this folder. */
-    $line .= "<A HREF=\"right_main.php?sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
+    $line .= "<A HREF=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
     if ($special_color) {
         $line .= "<FONT COLOR=\"$color[11]\">";
     }
     if ($special_color) {
         $line .= "<FONT COLOR=\"$color[11]\">";
     }
index d9414645ffbde5f36f9f5c34c776bde0fb26b568..113c35b091dce205943292f9b15758fd3425f989 100644 (file)
@@ -260,7 +260,7 @@ function load_optpage_data_display() {
         'type'    => SMOPT_TYPE_BOOLEAN,
         'refresh' => SMOPT_REFRESH_ALL
     );
         '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"),
         $optvals[SMOPT_GRP_MESSAGE][] = array(
             'name'    => 'sort_by_ref',
             'caption' => _("Use References header for thread sort"),
index ec9a7623abd140a69ba9e96520bc51bd1e549390..f9d15ba3ed38e409e048144fc2198e4f9f450100 100644 (file)
@@ -28,10 +28,10 @@ require_once('../functions/smtp.php');
  */
 function findNextMessage() {
     global $msort, $currentArrayIndex, $msgs, $sort, 
  */
 function findNextMessage() {
     global $msort, $currentArrayIndex, $msgs, $sort, 
-           $allow_thread_sort, $allow_server_sort,
+           $thread_sort_messages, $allow_server_sort,
            $server_sort_array;
     $result = -1;
            $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) {
         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;
         }
     }
         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;
         }
         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,
 /** 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;
            $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) {
         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;
         }
     } 
         $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;
         }
         if (!is_array($msort)) {
             return -1;
         }
index 01d7634c428b410543a59abc12eaf0e5b3e0f7e3..306bbdd031cb83d15433025bb78b24837249714c 100644 (file)
@@ -39,7 +39,19 @@ $bob = getHashedFile($username, $data_dir, "username.pref");
 
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
 
 $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;
 }
 
     $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;
 
 /* 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);
     if (isset($set_thread)) {
         if ($set_thread == 1) {
             setPref($data_dir, $username, "thread_$mailbox", 1);