Browse Source

fix for thread pref not kicking in on INBOX

jmunro 23 years ago
parent
commit
b841816c63
1 changed files with 23 additions and 22 deletions
  1. 23 22
      src/right_main.php

+ 23 - 22
src/right_main.php

@@ -47,6 +47,26 @@ if (isset($newsort) && $newsort != $sort) {
     setPref($data_dir, $username, 'sort', $newsort);
     setPref($data_dir, $username, 'sort', $newsort);
 }
 }
 
 
+
+
+/* If the page has been loaded without a specific mailbox, */
+/* send them to the inbox                                  */
+if (!isset($mailbox)) {
+    $mailbox = 'INBOX';
+    $startMessage = 1;
+}
+
+
+if (!isset($startMessage) || ($startMessage == '')) {
+    $startMessage = 1;
+}
+
+/* compensate for the UW vulnerability. */
+if ($imap_server_type == 'uw' && (strstr($mailbox, '../') ||
+                                  substr($mailbox, 0, 1) == '/')) {
+   $mailbox = 'INBOX';
+}
+
 /* decide if we are thread sorting or not */
 /* decide if we are thread sorting or not */
 global $allow_thread_sort;
 global $allow_thread_sort;
 if ($allow_thread_sort == TRUE) {
 if ($allow_thread_sort == TRUE) {
@@ -68,30 +88,11 @@ else {
     $thread_sort_messages = 0;
     $thread_sort_messages = 0;
 } 
 } 
 
 
-
-/* If the page has been loaded without a specific mailbox, */
-/* send them to the inbox                                  */
-if (!isset($mailbox)) {
-    $mailbox = 'INBOX';
-    $startMessage = 1;
+global $color;
+if( isset($do_hook) && $do_hook ) {
+    do_hook ("generic_header");
 }
 }
 
 
-
-if (!isset($startMessage) || ($startMessage == '')) {
-    $startMessage = 1;
-}
-
-/* compensate for the UW vulnerability. */
-if ($imap_server_type == 'uw' && (strstr($mailbox, '../') ||
-                                  substr($mailbox, 0, 1) == '/')) {
-   $mailbox = 'INBOX';
-}
-    global $color;
-
-    if( isset($do_hook) && $do_hook ) {
-        do_hook ("generic_header");
-    }
-
 sqimap_mailbox_select($imapConnection, $mailbox);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
 
 if (isset($composenew)) {
 if (isset($composenew)) {