added RECENT response to result array of sqimap_get_status in order to
[squirrelmail.git] / src / right_main.php
index 5dcaf7a3b17f5c13f40c7a9faf0992a6791b2638..c634e0755f983d77395b2e679614a2d815a6902f 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * right_main.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This is where the mailboxes are listed. This controls most of what
@@ -19,7 +19,6 @@ define('SM_PATH','../');
 require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/date.php');
-require_once(SM_PATH . 'functions/array.php');
 require_once(SM_PATH . 'functions/mime.php');
 require_once(SM_PATH . 'functions/mailbox_display.php');
 require_once(SM_PATH . 'functions/display_messages.php');
@@ -49,9 +48,9 @@ $base_uri = $_SESSION['base_uri'];
 $delimiter = $_SESSION['delimiter'];
  
 if (isset($_GET['startMessage'])) {
-    $startMessage = $_GET['startMessage'];
+    $startMessage = (int) $_GET['startMessage'];
 } elseif (isset($_POST['startMessage'])) {
-    $startMessage = $_POST['startMessage'];
+    $startMessage = (int) $_POST['startMessage'];
 }
 if (isset($_GET['mailbox'])) {
     $mailbox = $_GET['mailbox'];
@@ -59,27 +58,41 @@ if (isset($_GET['mailbox'])) {
     $mailbox = $_POST['mailbox'];
 }
 if (isset($_GET['PG_SHOWNUM'])) {
-    $PG_SHOWNUM = $_GET['PG_SHOWNUM'];
+    $PG_SHOWNUM = (int) $_GET['PG_SHOWNUM'];
 }
 elseif (isset($_SESSION['PG_SHOWNUM'])) {
-    $PG_SHOWNUM = $_SESSION['PG_SHOWNUM'];
+    $PG_SHOWNUM = (int) $_SESSION['PG_SHOWNUM'];
 }
 if (isset($_GET['PG_SHOWALL'])) {
-    $PG_SHOWALL = $_GET['PG_SHOWALL'];
+    $PG_SHOWALL = (int) $_GET['PG_SHOWALL'];
 }
 if (isset($_GET['newsort'])) {
-    $newsort = $_GET['newsort'];
+    $newsort = (int) $_GET['newsort'];
 }
+if (isset($_GET['composenew'])) {
+    $composenew = $_GET['composenew'];
+} else {
+    $composenew = false;
+}
+
 if (isset($_GET['checkall'])) {
-    $checkall = $_GET['checkall'];
+    $checkall = (int) $_GET['checkall'];
 }
 if (isset($_GET['set_thread'])) {
-    $set_thread = $_GET['set_thread'];
+    $set_thread = (int) $_GET['set_thread'];
 }
 if (isset($_SESSION['lastTargetMailbox'])) {
     $lastTargetMailbox =$_SESSION['lastTargetMailbox'];
 }
 
+if (isset($_GET['session'])) {
+    $session = $_GET['session'];
+}
+
+if (isset($_GET['note'])) {
+       $note = $_GET['note'];
+}
+
 /* end of get globals */
 
 
@@ -150,9 +163,9 @@ do_hook ('generic_header');
 
 sqimap_mailbox_select($imapConnection, $mailbox);
 
-if (isset($composenew) && $composenew) {
-    $comp_uri = '../src/compose.php?mailbox='. urlencode($mailbox).
-               "&session=$composesession";
+if ($composenew) {
+    $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
+               "&session=$session";
     displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri');", false);
 } else {
     displayPageHeader($color, $mailbox);